(Gelöst) Proxmox: HM-CFG-USB wird im Container ignoriert

Begonnen von Clyde, 12 Januar 2025, 13:31:59

Vorheriges Thema - Nächstes Thema

Otto123

#30
Zitat von: Clyde am 19 Januar 2025, 12:34:33192.168.2.36
Das ist die IP von deinem Host?

was sagt ss -lntu auf deinem Host? sieht man den Port 1234 ?

Weil im debug Modus zeigt er ja
Zitat2025-01-19 12:00:14.251172: Client 192.168.2.37 connected!
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

Clyde

#31
@Wernieman

Der Symlink wird auf dem Host eingerichtet mit (udev rule)

/dev/hmusb -> bus/usb/003/002               
In der Containerconfig wird er zum Durchreichen eingetragen:

lxc.mount.entry: /dev/hmusb            dev/hmusb             none bind,optional,create=file


Der Stick wird auf dem Host angezeigt mit

/dev/bus/usb/003/002                     
In der Containerconfig muss er zum Durchreichen eingetragen werden:

lxc.mount.entry: /dev/bus/usb/003/002  dev/bus/usb/003/002   none bind,optional,create=file

Das kann ich ja aber nur einrichten, wenn mir ..003/002 bekannt sind.
Es könnte auch ..003/006 sein. Dem folgt der Symlick durch die .rules aber nicht der
statisch angelegte mount. Da liegt ja das Problem. Oder verstehe ich dich falsch?

Wie würdest du beides durchreichen?
Proxmox auf MINIX-Z100, LXC: FHEM, FS20, FHT, HM, Tradfri, Alexa, Anker Solix Solarbank 2

Clyde


HostIP ist 192.168.2.36 Ja

Und der Port ist auch da.

root@proxmox:~# service hmland status
● hmland.service - LSB: Start hmland daemon at boot time
     Loaded: loaded (/etc/init.d/hmland; generated)
     Active: active (running) since Sun 2025-01-19 14:48:36 CET; 24min ago
       Docs: man:systemd-sysv-generator(8)
    Process: 664 ExecStart=/etc/init.d/hmland start (code=exited, status=0/SUCCESS)
      Tasks: 2 (limit: 18845)
     Memory: 1.1M
        CPU: 4ms
     CGroup: /system.slice/hmland.service
             ├─668 perl -ne "\$|=1; print localtime . \": [hmland] \$_\""
             └─675 /opt/hmcfgusb/hmland -r 0 -d -P -l 127.0.0.1 -p 1234

Jan 19 14:48:36 proxmox systemd[1]: Starting hmland.service - LSB: Start hmland daemon at boot time...
Jan 19 14:48:36 proxmox systemd[1]: Started hmland.service - LSB: Start hmland daemon at boot time.
root@proxmox:~# ss -lntu
Netid       State        Recv-Q        Send-Q               Local Address:Port               Peer Address:Port       Process       
udp         UNCONN       0             0                          0.0.0.0:111                     0.0.0.0:*                       
udp         UNCONN       0             0                        127.0.0.1:323                     0.0.0.0:*                       
udp         UNCONN       0             0                             [::]:111                        [::]:*                       
udp         UNCONN       0             0                            [::1]:323                        [::]:*                       
tcp         LISTEN       0             128                        0.0.0.0:22                      0.0.0.0:*                       
tcp         LISTEN       0             4096                       0.0.0.0:111                     0.0.0.0:*                       
tcp         LISTEN       0             4096                     127.0.0.1:85                      0.0.0.0:*                       
tcp         LISTEN       0             100                      127.0.0.1:25                      0.0.0.0:*                       
tcp         LISTEN       0             1                        127.0.0.1:1234                    0.0.0.0:*                       
tcp         LISTEN       0             128                           [::]:22                         [::]:*                       
tcp         LISTEN       0             4096                          [::]:111                        [::]:*                       
tcp         LISTEN       0             100                          [::1]:25                         [::]:*                       
tcp         LISTEN       0             4096                             *:3128                          *:*                       
tcp         LISTEN       0             4096                             *:8006                          *:*                       
root@proxmox:~#

2025-01-19 12:00:14.251172: Client 192.168.2.37 connected!
Stimmt, er ist mit dem Client connected.
Proxmox auf MINIX-Z100, LXC: FHEM, FS20, FHT, HM, Tradfri, Alexa, Anker Solix Solarbank 2

Clyde

Aber am Client 192.168.2.37 geht er nicht drauf.

2025.01.19 15:17:50 3: Opening hmusb device 192.168.2.36:1234
2025.01.19 15:17:50 1: hmusb: Can't connect to 192.168.2.36:1234: Connection refused
2025.01.19 15:17:50 1: HMLAN_Parse: hmusb new condition disconnected
Proxmox auf MINIX-Z100, LXC: FHEM, FS20, FHT, HM, Tradfri, Alexa, Anker Solix Solarbank 2

Otto123

Zitat von: Clyde am 19 Januar 2025, 15:16:48tcp         LISTEN       0             1                        127.0.0.1:1234                    0.0.0.0:*         
ok das ist die crux: der service bindet sich nur an die localhost Adresse  >:(  hatte ich irgendwie befürchtet.

Mal schauen ob man dies dem hmland sagen kann.
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

Otto123

die Zeile ändern:
/opt/hmcfgusb/hmland -r 0 -d -P -l 192.168.2.36 -p $port 2>&1 | perl -ne '$|=1; print localtime . ": [hmland] $_"' >> /var/log/hmland.log &oder
/opt/hmcfgusb/hmland -r 0 -d -P -l 0.0.0.0 -p $port 2>&1 | perl -ne '$|=1; print localtime . ": [hmland] $_"' >> /var/log/hmland.log &
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

Clyde

root@proxmox:~# service hmland stop
root@proxmox:~# /opt/hmcfgusb/hmland -r 0 -d -P -l 192.168.2.36 -p $port 2>&1 | perl -ne '$|=1; print localtime . ": [hmland] $_"' >> /var/log/hmland.log &
[1] 14938
root@proxmox:~# tail -10 /var/log/hmland.log
Sun Jan 19 15:35:48 2025: [hmland]      -i              interactive mode (connect HM-CFG-USB to terminal)
Sun Jan 19 15:35:48 2025: [hmland]      -l ip           listen on given IP address only (for example 127.0.0.1)
Sun Jan 19 15:35:48 2025: [hmland]      -L logfile      log network-communication to logfile
Sun Jan 19 15:35:48 2025: [hmland]      -P              create PID file /var/run/hmland.pid in daemon mode
Sun Jan 19 15:35:48 2025: [hmland]      -p n            listen on port n (default: 1000)
Sun Jan 19 15:35:48 2025: [hmland]      -r n            reboot HM-CFG-USB after n seconds (0: no reboot, default: 86400 if FW < 0.967, 0 otherwise)
Sun Jan 19 15:35:48 2025: [hmland]         hh:mm        reboot HM-CFG-USB daily at hh:mm
Sun Jan 19 15:35:48 2025: [hmland]      -S serial       use HM-CFG-USB with given serial (for multiple hmland instances)
Sun Jan 19 15:35:48 2025: [hmland]      -v              verbose mode
Sun Jan 19 15:35:48 2025: [hmland]      -V              show version (0.103-git)
[1]+  Done                    /opt/hmcfgusb/hmland -r 0 -d -P -l 192.168.2.36 -p $port 2>&1 | perl -ne '$|=1; print localtime . ": [hmland] $_"' >> /var/log/hmland.log
root@proxmox:~# ss -lntu
Netid       State        Recv-Q        Send-Q               Local Address:Port               Peer Address:Port       Process       
udp         UNCONN       0             0                          0.0.0.0:111                     0.0.0.0:*                       
udp         UNCONN       0             0                        127.0.0.1:323                     0.0.0.0:*                       
udp         UNCONN       0             0                             [::]:111                        [::]:*                       
udp         UNCONN       0             0                            [::1]:323                        [::]:*                       
tcp         LISTEN       0             128                        0.0.0.0:22                      0.0.0.0:*                       
tcp         LISTEN       0             4096                       0.0.0.0:111                     0.0.0.0:*                       
tcp         LISTEN       0             4096                     127.0.0.1:85                      0.0.0.0:*                       
tcp         LISTEN       0             100                      127.0.0.1:25                      0.0.0.0:*                       
tcp         LISTEN       0             128                           [::]:22                         [::]:*                       
tcp         LISTEN       0             4096                          [::]:111                        [::]:*                       
tcp         LISTEN       0             100                          [::1]:25                         [::]:*                       
tcp         LISTEN       0             4096                             *:3128                          *:*                       
tcp         LISTEN       0             4096                             *:8006                          *:*                       
root@proxmox:~#
Proxmox auf MINIX-Z100, LXC: FHEM, FS20, FHT, HM, Tradfri, Alexa, Anker Solix Solarbank 2

Otto123

#37
aber so hast Du es jetzt ohne port aufgerufen?
/opt/hmcfgusb/hmland -r 0 -d -P -l 192.168.2.36 -p 1234 Ich meinte ja die Zeile in dem Script aus deinem Link. Wie gesagt der hmlan-cfg-usb ist für mich ne reine Trockenübung :)
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

Clyde

Port 1234

root@proxmox:~# service hmland stop
root@proxmox:~# /opt/hmcfgusb/hmland -r 0 -d -P -l 0.0.0.0 -p 1234 2>&1 | perl -ne '$|=1; print localtime . ": [hmland] $_"' >> /va
r/log/hmland.log &
[1] 16154
root@proxmox:~# ss -lntu
Netid       State        Recv-Q        Send-Q               Local Address:Port               Peer Address:Port       Process       
udp         UNCONN       0             0                          0.0.0.0:111                     0.0.0.0:*                       
udp         UNCONN       0             0                        127.0.0.1:323                     0.0.0.0:*                       
udp         UNCONN       0             0                             [::]:111                        [::]:*                       
udp         UNCONN       0             0                            [::1]:323                        [::]:*                       
tcp         LISTEN       0             1                          0.0.0.0:1234                    0.0.0.0:*                       
tcp         LISTEN       0             128                        0.0.0.0:22                      0.0.0.0:*                       
tcp         LISTEN       0             4096                       0.0.0.0:111                     0.0.0.0:*                       
tcp         LISTEN       0             4096                     127.0.0.1:85                      0.0.0.0:*                       
tcp         LISTEN       0             100                      127.0.0.1:25                      0.0.0.0:*                       
tcp         LISTEN       0             128                           [::]:22                         [::]:*                       
tcp         LISTEN       0             4096                          [::]:111                        [::]:*                       
tcp         LISTEN       0             100                          [::1]:25                         [::]:*                       
tcp         LISTEN       0             4096                             *:3128                          *:*                       
tcp         LISTEN       0             4096                             *:8006                          *:*                       
root@proxmox:~#
Proxmox auf MINIX-Z100, LXC: FHEM, FS20, FHT, HM, Tradfri, Alexa, Anker Solix Solarbank 2

Otto123

Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

Clyde

 :)

2025.01.19 15:44:39 1: HMLAN_Parse: hmusb new condition disconnected
2025.01.19 15:44:39 1: Including ./log/fhem.save
2025.01.19 15:44:39 3: Opening hmusb device 192.168.2.36:1234
2025.01.19 15:44:39 1: HMLAN_Parse: hmusb new condition init
2025.01.19 15:44:39 3: hmusb device opened
2025.01.19 15:44:39 1: usb create starting
Proxmox auf MINIX-Z100, LXC: FHEM, FS20, FHT, HM, Tradfri, Alexa, Anker Solix Solarbank 2

Clyde

#41
Hab den Stick jetzt ab und abgesteckt und eine neue Zuordnung bekommen:

root@proxmox:~# lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 1b1f:c00f eQ-3 Entwicklung GmbH HM-CFG-USB/HM-CFG-USB-2 [HomeMatic Configuration adapter]
Bus 003 Device 003: ID 8087:0026 Intel Corp. AX201 Bluetooth
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@proxmox:~# lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 004: ID 1b1f:c00f eQ-3 Entwicklung GmbH HM-CFG-USB/HM-CFG-USB-2 [HomeMatic Configuration adapter]
Bus 003 Device 003: ID 8087:0026 Intel Corp. AX201 Bluetooth
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 0

Dieser Wechsel am Host macht dem FHEM im Container kein Problem.
Das ist nun von daher die beste Lösung.

Proxmox auf MINIX-Z100, LXC: FHEM, FS20, FHT, HM, Tradfri, Alexa, Anker Solix Solarbank 2

Clyde

#42
Zusammenfassung der Lösung für das Durchreichen des HM-CFG-USB-2 vom Proxmox-Host in den FHEM-Container:

1) hmland auf dem Proxmox Host (hier <192.168.2.36>) installieren

https://forum.fhem.de/index.php/topic,13071.msg190887.html#msg190887

2) Port durchreichen mit

root@proxmox:~# /opt/hmcfgusb/hmland -r 0 -d -P -l 192.168.2.36 -p 1234 2>&1 | perl -ne '$|=1; print localtime . ": [hmland] $_"' >
> /var/log/hmland.log &
3) Im FHEM Container (hier <192.168.2.37>) in der FHEM Kommandozeile hmusb einrichen

define <name> HMLAN <ip-address>[:port]
define hmusb HMLAN  192.168.2.36:1234
4) ID vergeben attr hmusb hmId <hmId>

attr hmusb hmId 424242
Damit muss sich FHEM nicht um den Stick kümmern, das läuft über hmland auf dem Host.
Man braucht ferner keinen Symlink und keine Änderungen an der Containerkonfig diesbezüglich.

Vielen Dank für die Hilfe!
Proxmox auf MINIX-Z100, LXC: FHEM, FS20, FHT, HM, Tradfri, Alexa, Anker Solix Solarbank 2

Otto123

Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

Wernieman

Zitat von: Clyde am 19 Januar 2025, 15:11:01@Wernieman

Der Symlink wird auf dem Host eingerichtet mit (udev rule)

Anstatt eines Symlinks kann man auch einen festen Devicenamen vergeben .. nur selber habe ich es zwar mal gemacht, aber schon wider vergessen .....

Da es mittlerweile eine Lösung gibt, würde ich es jetzt nicht weiterverfolgen
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html