Offizielles FHEM Docker Basis Image für verschiedene Plattformen

Begonnen von Loredo, 28 Juli 2018, 21:24:57

Vorheriges Thema - Nächstes Thema

rob

Hallo volschin.

Zitat von: volschin am 07 Juni 2024, 19:04:51Ich bin jetzt auf die Beta10 zurück, dort lief das nämlich bei mir auch noch tadellos.
...

Schau mal bitte in diesen Fred: https://forum.fhem.de/index.php?topic=137309.msg1314847#msg1314847.
Sidey benötigt sicher die Info, wo weitere Module noch zusätzliche Perl-Module benötigen und einen Test. Die für Deinen Fall (DbLog) könntest Du z.B. direkt als Issue auf Github melden: https://github.com/fhem/fhem-docker/issues.

Auf Dauer kannst Du ja nicht auf der Beta10 bleiben :)
Ich hab zwar DbLog schon angesprochen gehabt, kann es selber aber nicht sinnvoll testen (da nicht im Einsatz).

Viele Grüße
rob

Christoph.A

#2041
Ich habe/hatte das gleiche Problem mit fhem/fhem:latest habe ich den fhempyserver_15733 mit dockerge auf bookworm nicht mehr zum Laufen gebracht. Ich hatte wohl unbewusst ein Update vom Container durchgeführt und dann ging nichts mehr.
Daraufhin habe ich auf einem IntelNuc einen LXC mit meiner fhem.cfg gestartet - ging alles ohne Probleme.
Jetzt bin ich wieder auf das Zimaborad  zurück mit fhem/fhem:bullseye und siehe da alle läuft als wäre nichts gewesen. Hier mein dockerge yaml file:
version: "3"
services:
  fhem5033:
    container_name: fhem5033
    environment:
      - FHEM_GID=1000
      - FHEM_UID=1000
      - RESTART=1
      - TELNETPORT=7072
      - TIMEOUT=10
      - TZ=Europe/Berlin
    image: fhem/fhem:bullseye
    ports:
      - 8083:8083
      - 8084:8084
      - 7072:7072
    volumes:
      - type: bind
        source: /DATA/AppData/FHEM5033
        target: /opt/fhem
    restart: always
    networks:
      meinmacvlan50:
        ipv4_address: 192.168.50.33
networks:
  meinmacvlan50:
    external: true

rallye

#2042
Hallo!
Ich habe mein FHEM mit "fusionsolar" und "google_weather" auf dem RasPi 4 im Docker unter Raspberian Buster einwandfrei laufen.

Nun möchte ich etwas "modernisieren", hab mir einen RasPi 5 zugelegt und Rasperian Bookworm installiert, mit sudo apt install python3 python3-pip python3-dev python3-venv libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libglib2.0-dev libdbus-1-dev bluez libbluetooth-dev git libprotocol-websocket-perl die geforderten Pakete. Dann den Portainer und Docker-Compose mit folgender config.yml
services:

  portainer:
    image: portainer/portainer-ce:latest
    container_name: portainer
    ports:
      - "8000:8000"
      - "9443:9443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - portainer_data:/data
    restart: unless-stopped

##### ----- fhem ----- ########################################################
  fhem:
    image:  ghcr.io/fhem/fhem-docker:latest
    container_name: fhem
    restart: always
    volumes:
      - /opt/fhem/:/opt/fhem/
    environment:
      FHEM_UID: 999
      FHEM_GID: 20
      TZ: Europe/Vienna
    networks:
      fhem_net:
        ipv4_address: 172.16.57.2
    ports:
      - "8083:8083"
      - "1883:1883"
#      - "1885:1885"
      - "8883:8883"
      - "8084:8084"
#
##### ----- network definitions ----- ##########################################
networks:
  fhem_net:
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: 172.16.57.0/24
          gateway: 172.16.57.1
#
#
##### ----- volume definitions ----- ###########################################
#
volumes:
  portainer_data:
    name: portainer_data
    external: true

Mit docker compose up -dgestartet, in FHEM
update und shutdown restart eingegeben und dann update add https://raw.githubusercontent.com/fhempy/fhempy/master/controls_pythonbinding.txt mit nochmaligem shutdown restart.
Mein Versuch fhempy_local zu definieren
define fhempy_local BindingsIo fhempy wird mit einem Cannot load module Bindin quittiert und folgendes steht im Log
2024.07.07 15:58:27.747 1: Please consider using the global attribute sendStatistics
2024.07.07 15:58:57.140 1:
2024.07.07 15:58:57.141 1: Downloading https://fhem.de/fhemupdate/controls_fhem.txt
2024.07.07 15:58:57.141 1: fhem
2024.07.07 15:58:57.446 1: nothing to do...
2024.07.07 15:58:57.449 1:
2024.07.07 15:58:57.449 1: Downloading https://raw.githubusercontent.com/fhempy/fhempy/master/controls_pythonbinding.txt
2024.07.07 15:58:57.450 1: pythonbinding
2024.07.07 15:58:57.834 1: UPD FHEM/10_BindingsIo.pm
2024.07.07 15:58:57.984 1: UPD FHEM/10_PythonBinding.pm
2024.07.07 15:58:58.144 1: UPD FHEM/10_PythonModule.pm
2024.07.07 15:58:58.295 1: UPD FHEM/10_fhempy.pm
2024.07.07 15:58:58.443 1: UPD FHEM/10_fhempyServer.pm
2024.07.07 15:58:58.607 1: UPD FHEM/bindings/python/bin/fhempy
2024.07.07 15:58:58.785 1: UPD FHEM/bindings/python/bin/start_fhempy.py
2024.07.07 15:58:58.945 1: saving fhem.cfg
2024.07.07 15:58:58.945 1:
2024.07.07 15:58:58.945 1: New entries in the CHANGED file:
2024.07.07 15:58:58.945 1: See https://github.com/fhempy/fhempy/releases for details
2024.07.07 15:58:58.946 1: Calling /usr/local/bin/perl ./contrib/commandref_modular.pl, this may take a while
2024.07.07 15:58:59.017 1:
2024.07.07 15:58:59.017 1: update finished, "shutdown restart" is needed to activate the changes.
2024.07.07 15:58:59.017 1:
2024.07.07 15:58:59.018 1: Please consider using the global attribute sendStatistics
2024.07.07 15:59:16.438 0: Server shutdown
2024.07.07 15:59:19 3: logfile is readonly, it is set in the FHEM_GLOBALATTR environment
2024.07.07 15:59:19.796 3: From the FHEM_GLOBALATTR environment: attr global updateInBackground 1
2024.07.07 15:59:19.796 3: From the FHEM_GLOBALATTR environment: attr global pidfilename log/fhem.pid
2024.07.07 15:59:19.796 3: From the FHEM_GLOBALATTR environment: attr global nofork 0
2024.07.07 15:59:19.796 3: From the FHEM_GLOBALATTR environment: attr global logfile log/fhem-%Y-%m-%d.log
2024.07.07 15:59:19.800 1: Including fhem.cfg
2024.07.07 15:59:19.802 3: logfile is readonly, it is set in the FHEM_GLOBALATTR environment
2024.07.07 15:59:19.874 3: WEB: port 8083 opened
2024.07.07 15:59:19.890 2: eventTypes: loaded 0 lines from ./log/eventTypes.txt
2024.07.07 15:59:19.911 1: Including ./log/fhem.save
2024.07.07 15:59:19.913 3: From the FHEM_GLOBALATTR environment: attr global updateInBackground 1
2024.07.07 15:59:19.913 3: From the FHEM_GLOBALATTR environment: attr global pidfilename log/fhem.pid
2024.07.07 15:59:19.913 3: From the FHEM_GLOBALATTR environment: attr global nofork 0
2024.07.07 15:59:19.913 3: From the FHEM_GLOBALATTR environment: attr global logfile log/fhem-%Y-%m-%d.log
2024.07.07 15:59:19.913 1: Messages collected while initializing FHEM:configfile: logfile is readonly, it is set in the FHEM_GLOBALATTR environment
SecurityCheck:
  WEB is not password protected

Protect this FHEM installation by defining an allowed device with define allowed allowed
You can disable this message with attr global motd none
Autosave deactivated
2024.07.07 15:59:19.931 1: usb create starting
2024.07.07 15:59:19.956 1: usb create end
2024.07.07 15:59:19.957 0: Featurelevel: 6.3
2024.07.07 15:59:19.957 0: Server started with 7 defined entities (fhem.pl:28849/2024-05-07 perl:5.036003 os:linux user:fhem pid:4692)
2024.07.07 16:00:10.505 1: reload: Error:Modul 10_BindingsIo deactivated:
 Can't locate Protocol/WebSocket/Frame.pm in @INC (you may need to install the Protocol::WebSocket::Frame module) (@INC contains: ./lib ./FHEM . /usr/src/app/core/lib/perl5/5.36.3/aarch64-linux-gnu /usr/src/app/core/lib/perl5/5.36.3 /usr/src/app/core/lib/perl5/aarch64-linux-gnu /usr/src/app/core/lib/perl5 /usr/src/app/3rdparty/lib/perl5/5.36.3/aarch64-linux-gnu /usr/src/app/3rdparty/lib/perl5/5.36.3 /usr/src/app/3rdparty/lib/perl5/aarch64-linux-gnu /usr/src/app/3rdparty/lib/perl5 /usr/local/lib/perl5/site_perl/5.36.3/aarch64-linux-gnu /usr/local/lib/perl5/site_perl/5.36.3 /usr/local/lib/perl5/vendor_perl/5.36.3/aarch64-linux-gnu /usr/local/lib/perl5/vendor_perl/5.36.3 /usr/local/lib/perl5/5.36.3/aarch64-linux-gnu /usr/local/lib/perl5/5.36.3 ./FHEM/lib) at ./FHEM/10_BindingsIo.pm line 10.
BEGIN failed--compilation aborted at ./FHEM/10_BindingsIo.pm line 10.

2024.07.07 16:00:10.505 0: Can't locate Protocol/WebSocket/Frame.pm in @INC (you may need to install the Protocol::WebSocket::Frame module) (@INC contains: ./lib ./FHEM . /usr/src/app/core/lib/perl5/5.36.3/aarch64-linux-gnu /usr/src/app/core/lib/perl5/5.36.3 /usr/src/app/core/lib/perl5/aarch64-linux-gnu /usr/src/app/core/lib/perl5 /usr/src/app/3rdparty/lib/perl5/5.36.3/aarch64-linux-gnu /usr/src/app/3rdparty/lib/perl5/5.36.3 /usr/src/app/3rdparty/lib/perl5/aarch64-linux-gnu /usr/src/app/3rdparty/lib/perl5 /usr/local/lib/perl5/site_perl/5.36.3/aarch64-linux-gnu /usr/local/lib/perl5/site_perl/5.36.3 /usr/local/lib/perl5/vendor_perl/5.36.3/aarch64-linux-gnu /usr/local/lib/perl5/vendor_perl/5.36.3 /usr/local/lib/perl5/5.36.3/aarch64-linux-gnu /usr/local/lib/perl5/5.36.3 ./FHEM/lib) at ./FHEM/10_BindingsIo.pm line 10.
BEGIN failed--compilation aborted at ./FHEM/10_BindingsIo.pm line 10.

Nun bin ich etwas ratlos. Wie bekomme ich das hin? Auch mit image:  ghcr.io/fhem/fhem-docker:dev-bullseye war ich erfolglos.

Lieben Dank!


EDIT:
Ich gebe mir die Antwort selbst, vielleicht hilft sie jemandem.

Das Problem liegt im fehlenden Websocket-Protokoll. Durch update der FHEM-Section (Nachinstallieren von WebSocket) läuft es nun problemlos. Der Teil meiner compose.yml sieht nun so aus:
##### ----- fhem ----- ########################################################
  fhem:
    build:
      context: .
      dockerfile_inline: |
        FROM ghcr.io/fhem/fhem-docker:latest
        RUN <<EOF
          cpm install --show-build-log-on-failure --configure-timeout=360 --workers=$(nproc) --local-lib-contained /usr/src/app/3rdparty/  Protocol::WebSocket
        EOF
    restart: always
    volumes:
      - /opt/fhem/:/opt/fhem/
    container_name: fhem
    environment:
      FHEM_UID: 999
      FHEM_GID: 20
      TZ: Europe/Vienna
    networks:
      fhem_net:
        ipv4_address: 172.16.57.2
    ports:
      - "8083:8083"
      - "1883:1883"
      - "8883:8883"
      - "8084:8084"
#
RaspiPi v4, HM-LGW, 6x HM-TC-IT-WM-W-EU, 11x HM-CC-RT-DN, 1x HUE Bridge, 4x HUE-RC, 5x HUE White&Color, 15xHUE White, 3xHM-LC-SW1-FM, 1xHM-LC-SW2-FM, 1x ConBeeII, 15x Shelly1, 5xShellyplug, Aquara: 2x Temp-Sensor, 1x Vibrationssensor, 2x Lichtsensor, 19x Tür/Fenstersensor

Sidey

Das FHEM Image ist nicht dafür gemacht, fhempy darin laufen zu lassen.

Dafür gibt es spezielle Images, denn Fhempy compiliert und installiert zur Laufzeit nach:

https://github.com/fhem/fhempy-docker


Wegen dem fehlenden Protocol::WebSocket schau ich mal nach, wieso der Bedarf nicht erkannt wird.

Grüße Sidey
Signalduino, Homematic, Raspberry Pi, Mysensors, MQTT, Alexa, Docker, AlexaFhem

Maintainer von: SIGNALduino, fhem-docker, alexa-fhem-docker, fhempy-docker

rallye

Zitat von: Sidey am 07 Juli 2024, 21:10:27Das FHEM Image ist nicht dafür gemacht, fhempy darin laufen zu lassen.

Dafür gibt es spezielle Images, denn Fhempy compiliert und installiert zur Laufzeit nach:

https://github.com/fhem/fhempy-docker
Danke, so mache ich das in meiner Produktionsumgebung - ebenso mit Alexa u.s.w.. Den FHEMpy-docker (fusionsolar und googleweather) habe ich in meinem initialen Post herausgenommen bzw. zur Fehlersuche weggelasse.

Zitat von: Sidey am 07 Juli 2024, 21:10:27Wegen dem fehlenden Protocol::WebSocket schau ich mal nach, wieso der Bedarf nicht erkannt wird.
Heißt das, dass in einer künftigen FHEM-Docker Version das Protocol::WebSocket drinnen sein wird und das Nachinstalliweren nicht mehr notwendig sein wird?

Danke, Grüße Rallye
RaspiPi v4, HM-LGW, 6x HM-TC-IT-WM-W-EU, 11x HM-CC-RT-DN, 1x HUE Bridge, 4x HUE-RC, 5x HUE White&Color, 15xHUE White, 3xHM-LC-SW1-FM, 1xHM-LC-SW2-FM, 1x ConBeeII, 15x Shelly1, 5xShellyplug, Aquara: 2x Temp-Sensor, 1x Vibrationssensor, 2x Lichtsensor, 19x Tür/Fenstersensor

Sidey

Zitat von: rallye am 08 Juli 2024, 08:05:28Heißt das, dass in einer künftigen FHEM-Docker Version das Protocol::WebSocket drinnen sein wird und das Nachinstalliweren nicht mehr notwendig sein wird?


Ja, ab dem Nächsten (minor) Release wird es so sein.
Signalduino, Homematic, Raspberry Pi, Mysensors, MQTT, Alexa, Docker, AlexaFhem

Maintainer von: SIGNALduino, fhem-docker, alexa-fhem-docker, fhempy-docker