Hallo zusammen,
ich habe schon seit längerem fhem auf einen Raspi laufen. Da die Speicherkarten nicht so viele Schreibvorgänge können, versuche ich auf einen Intel-NUC in einem Docker-Container um zu ziehen.
hein-NUC core # uname -a
Linux hein-NUC 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Hier bekomme ich den nanoCUL (433Mhz) nicht ans laufen.
CUL
CUL1 Initialized
nanoCUL disconnected
Der CUL1 (868Mhz) ist neu und zur Erweiterung des Systems gedacht.
hein-NUC hein # ls -la /dev/serial/by-id/
insgesamt 0
drwxr-xr-x 2 root root 80 Dez 8 16:25 .
drwxr-xr-x 4 root root 80 Dez 8 16:25 ..
lrwxrwxrwx 1 root root 13 Dez 8 16:25 usb-busware.de_CUL868-if00 -> ../../ttyACM0
lrwxrwxrwx 1 root root 13 Dez 8 16:25 usb-FTDI_FT232R_USB_UART_A9M9DV3R-if00-port0 -> ../../ttyUSB0
hein-NUC hein # ls -la /dev/serial/by-path/
insgesamt 0
drwxr-xr-x 2 root root 80 Dez 8 16:25 .
drwxr-xr-x 4 root root 80 Dez 8 16:25 ..
lrwxrwxrwx 1 root root 13 Dez 8 16:25 pci-0000:00:14.0-usb-0:3:1.0 -> ../../ttyACM0
lrwxrwxrwx 1 root root 13 Dez 8 16:25 pci-0000:00:14.0-usb-0:4:1.0-port0 -> ../../ttyUSB0
Raw definition zeigt:
defmod nanoCUL CUL /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A9M9DV3R-if00-port0@38400 0000
setstate nanoCUL disconnected
setstate nanoCUL 2018-12-08 16:00:00 raw No answer
setstate nanoCUL 2018-12-08 15:26:05 state disconnected
Das log zeigt:
2018.12.08 14:59:22.010 3: Opening CUL1 device /dev/ttyACM0,
2018.12.08 14:59:22.023 3: Setting CUL1 serial parameters to 9600,8,N,1,
2018.12.08 14:59:22.127 3: CUL1: Possible commands: BbCFiAZNkGMKUYRTVWXefmLltux,
2018.12.08 14:59:22.131 3: CUL1 device opened,
2018.12.08 14:59:22.131 3: Opening nanoCUL device /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A9M9DV3R-if00-port0,
2018.12.08 14:59:22.131 1: nanoCUL: Can't open /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A9M9DV3R-if00-port0: No such file or directory,
Internals zeigt:
CMDS
Clients :FS20:FHT.*:KS300:USF1000:BS:HMS:FS20V: :CUL_EM:CUL_WS:CUL_FHTTK:CUL_HOERMANN: :ESA2000:CUL_IR:CUL_TX:Revolt:IT:UNIRoll:SOMFY: :STACKABLE_CC:TSSTACKED:STACKABLE:CUL_RFR::CUL_TCM97001:CUL_REDIRECT:
DEF /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A9M9DV3R-if00-port0@38400 0000
DeviceName /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A9M9DV3R-if00-port0@38400
FHTID 0000
NAME nanoCUL
NR 87
PARTIAL
STATE disconnected
TYPE CUL
initString X21
Vielleicht habe ich ja etwas übersehen, aber habe ich im Forum leider nichts gefunden, was mir weiter helfen konnte.
Ich sag mal, einen riesigen Dank im voraus.
Zitathein-NUC core
Ist das der Docker-Container oder der Host (NUC)?
Wie ist Dein Aufruf des Docker-Containers?
Hast Du
--privileged gesetzt?
Was zeigt
lsusb bzw.
dmesg im Container
und im Host an?
Inhalt der Datei: /etc/group ? Ist der user "pi" (?) in der Gruppe "dialout"?
Beispiel (defmod (https://wiki.fhem.de/wiki/Trick_der_Woche#defmod)?):
define MapleCUL433 CUL /dev/serial/by-id/usb-STM32_MapleCUL_88bf416a-if00@38400 0102
Anmerkung: evtl. in die Topic-Überschrift noch "Docker" mit reinnehmen ;)
Grüße,
Jürgen
/edit:
Docker-Container im RASPI, ohne --privileged-Attribut
lsusb liefert meinne MapleCUL-Schnittstellen im Container:
oot@8e9c48084b11:/dev# ls -als
total 4
0 drwxr-xr-x 5 root root 320 Dec 24 11:59 .
4 drwxr-xr-x 1 root root 4096 Dec 24 11:59 ..
0 lrwxrwxrwx 1 root root 13 Dec 24 11:59 fd -> /proc/self/fd
0 crw-rw-rw- 1 root root 1, 7 Dec 24 11:59 full
0 drwxrwxrwt 2 root root 40 Dec 24 11:59 mqueue
0 crw-rw-rw- 1 root root 1, 3 Dec 24 11:59 null
0 lrwxrwxrwx 1 root root 8 Dec 24 11:59 ptmx -> pts/ptmx
0 drwxr-xr-x 2 root root 0 Dec 24 11:59 pts
0 crw-rw-rw- 1 root root 1, 8 Dec 24 11:59 random
0 drwxrwxrwt 2 root root 40 Dec 24 11:59 shm
0 lrwxrwxrwx 1 root root 15 Dec 24 11:59 stderr -> /proc/self/fd/2
0 lrwxrwxrwx 1 root root 15 Dec 24 11:59 stdin -> /proc/self/fd/0
0 lrwxrwxrwx 1 root root 15 Dec 24 11:59 stdout -> /proc/self/fd/1
0 crw-rw-rw- 1 root root 5, 0 Dec 24 11:59 tty
0 crw-rw-rw- 1 root root 1, 9 Dec 24 11:59 urandom
0 crw-rw-rw- 1 root root 1, 5 Dec 24 11:59 zero
root@8e9c48084b11:/dev# lsusb
Bus 001 Device 004: ID 0483:5743 STMicroelectronics
Bus 001 Device 005: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@8e9c48084b11:/dev# sudo ls -alsh
total 4.0K
0 drwxr-xr-x 5 root root 320 Dec 24 11:59 .
4.0K drwxr-xr-x 1 root root 4.0K Dec 24 11:59 ..
0 lrwxrwxrwx 1 root root 13 Dec 24 11:59 fd -> /proc/self/fd
0 crw-rw-rw- 1 root root 1, 7 Dec 24 11:59 full
0 drwxrwxrwt 2 root root 40 Dec 24 11:59 mqueue
0 crw-rw-rw- 1 root root 1, 3 Dec 24 11:59 null
0 lrwxrwxrwx 1 root root 8 Dec 24 11:59 ptmx -> pts/ptmx
0 drwxr-xr-x 2 root root 0 Dec 24 11:59 pts
0 crw-rw-rw- 1 root root 1, 8 Dec 24 11:59 random
0 drwxrwxrwt 2 root root 40 Dec 24 11:59 shm
0 lrwxrwxrwx 1 root root 15 Dec 24 11:59 stderr -> /proc/self/fd/2
0 lrwxrwxrwx 1 root root 15 Dec 24 11:59 stdin -> /proc/self/fd/0
0 lrwxrwxrwx 1 root root 15 Dec 24 11:59 stdout -> /proc/self/fd/1
0 crw-rw-rw- 1 root root 5, 0 Dec 24 11:59 tty
0 crw-rw-rw- 1 root root 1, 9 Dec 24 11:59 urandom
0 crw-rw-rw- 1 root root 1, 5 Dec 24 11:59 zero
root@8e9c48084b11:/dev#
Auch mit dem --privileged -Attribut wurde bei mir kein Dev-Pfad "serial" gemapped. :'(
https://github.com/moby/moby/issues/27807 (https://github.com/moby/moby/issues/27807)
ZitatI finally got my hands on a Linux/Ubuntu laptop as Docker host and I can confirm it works fine.
Hence, the issue is reproducible only on RPI (potentially all ARM) hosts.
Test details:
docker run -it --privileged -v /dev:/dev ubuntu
Zitatpi@raspberrypi:/dev/serial/by-id $ docker --version
Docker version 18.09.0, build 4d60db4
https://github.com/fhem/fhem-docker/ (https://github.com/fhem/fhem-docker/)
Zitat
Find out the USB device path/address from your Docker host machine first:
lsusb -v | grep -E '\<(Bus|iProduct|bDeviceClass|bDeviceProtocol)' 2>/dev/null
You may then derive the device path from it and add the following parameter to your container run command:
--device=/dev/bus/usb/001/002
lsusb -v | grep -E '\<(Bus|iProduct|bDeviceClass|bDeviceProtocol)' 2>/dev/null
Bus 001 Device 004: ID 0483:5743 STMicroelectronics
bDeviceClass 239 Miscellaneous Device
bDeviceProtocol 1 Interface Association
iProduct 2 MapleCUL
Bus 001 Device 005: ID 0424:7800 Standard Microsystems Corp.
bDeviceClass 255 Vendor Specific Class
bDeviceProtocol 255
iProduct 0
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
bDeviceClass 9 Hub
bDeviceProtocol 2 TT per port
iProduct 0
bDeviceClass 9 Hub
bDeviceProtocol 0 Full speed (or root) hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
bDeviceClass 9 Hub
bDeviceProtocol 2 TT per port
iProduct 0
bDeviceClass 9 Hub
bDeviceProtocol 0 Full speed (or root) hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
bDeviceClass 9 Hub
bDeviceProtocol 1 Single TT
iProduct 2 DWC OTG Controller
root@6e3f6ee2853e:/dev#