Closed David91919 closed 4 years ago
HM_mode seems all empty: sudo docker exec CCU cat /var/hm_mode
HM_HMIP_DEV='' HM_HMIP_DEVNODE='' HM_HMRF_DEV='' HM_HMRF_DEVNODE='' HM_HOST='Unknown' HM_HOST_GPIO_RESET='' HM_HOST_GPIO_UART='' HM_LED_GREEN='' HM_LED_GREEN_MODE1='none' HM_LED_GREEN_MODE2='none' HM_LED_RED='' HM_LED_RED_MODE1='none' HM_LED_RED_MODE2='none' HM_LED_YELLOW='' HM_LED_YELLOW_MODE1='none' HM_LED_YELLOW_MODE2='none' HM_MODE='NORMAL' HM_RTC=''
Did you try running the commands mentioned by the log?
modprobe cp210x
echo 1b1f c020 >/sys/bus/usb-serial/drivers/cp210x/new_id
Another thing that would be useful is that you post the output from deploy.sh
. This script takes care of preparing the host to run the container.
Yes I ran the modprobe and echo commands which make the ttyUSB0 available in the first place. Without these commands the ttyUSB0 doesnt show up at all in /dev/
I watched the dmesg output and it sees the HMIP-USB being connected/disconnected.
How do I find the output of deploy.sh?
I noticed how the ttyUSB0 in the container is part of Group "20" and not "Dialout". Not sure why but could this be a problem? I made sure to run the docker command with a user that is part of the dialout group.
I could find the container inspection:
{ "AppArmorProfile": "", "Args": [], "Config": { "AttachStderr": false, "AttachStdin": false, "AttachStdout": false, "Cmd": [ "/entrypoint.sh" ], "Domainname": "", "Entrypoint": null, "Env": [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ], "ExposedPorts": { "2001/tcp": {}, "22/tcp": {}, "80/tcp": {}, "8181/tcp": {} }, "Hostname": "35d08af519be", "Image": "angelnu/ccu:latest", "Labels": {}, "OnBuild": null, "OpenStdin": false, "StdinOnce": false, "Tty": false, "User": "", "Volumes": { "/usr/local": {} }, "WorkingDir": "" }, "Created": "2020-08-29T19:32:23.221485484Z", "Driver": "overlay2", "ExecIDs": [ "efb9c2e2e0010ab4284185b2ea682af5684ce2f645f406f252a4fdecdf40a2ff" ], "GraphDriver": { "Data": { "LowerDir": "/var/lib/docker/overlay2/32905d85f111b9c61262b6a44185ba001fff8d0f0a971410d5803175755c5149-init/diff:/var/lib/docker/overlay2/cfee9866d1518b3ffb970c98898ed9c2fc7d998d552db1e7cfa4b91e5ac1c9c0/diff:/var/lib/docker/overlay2/0af05178644a68e6d6ad6bea01a152a446e95864854dab422146d1309cfe3f7b/diff", "MergedDir": "/var/lib/docker/overlay2/32905d85f111b9c61262b6a44185ba001fff8d0f0a971410d5803175755c5149/merged", "UpperDir": "/var/lib/docker/overlay2/32905d85f111b9c61262b6a44185ba001fff8d0f0a971410d5803175755c5149/diff", "WorkDir": "/var/lib/docker/overlay2/32905d85f111b9c61262b6a44185ba001fff8d0f0a971410d5803175755c5149/work" }, "Name": "overlay2" }, "HostConfig": { "AutoRemove": false, "Binds": [], "BlkioDeviceReadBps": null, "BlkioDeviceReadIOps": null, "BlkioDeviceWriteBps": null, "BlkioDeviceWriteIOps": null, "BlkioWeight": 0, "BlkioWeightDevice": null, "CapAdd": [ "AUDIT_WRITE", "CHOWN", "DAC_OVERRIDE", "FOWNER", "FSETID", "KILL", "MKNOD", "NET_BIND_SERVICE", "NET_RAW", "SETFCAP", "SETGID", "SETPCAP", "SETUID", "SYS_CHROOT" ], "CapDrop": [ "AUDIT_CONTROL", "BLOCK_SUSPEND", "DAC_READ_SEARCH", "IPC_LOCK", "IPC_OWNER", "LEASE", "LINUX_IMMUTABLE", "MAC_ADMIN", "MAC_OVERRIDE", "NET_ADMIN", "NET_BROADCAST", "SYSLOG", "SYS_ADMIN", "SYS_BOOT", "SYS_MODULE", "SYS_NICE", "SYS_PACCT", "SYS_PTRACE", "SYS_RAWIO", "SYS_RESOURCE", "SYS_TIME", "SYS_TTY_CONFIG", "WAKE_ALARM" ], "Capabilities": null, "Cgroup": "", "CgroupParent": "", "ConsoleSize": [ 0, 0 ], "ContainerIDFile": "", "CpuCount": 0, "CpuPercent": 0, "CpuPeriod": 0, "CpuQuota": 0, "CpuRealtimePeriod": 0, "CpuRealtimeRuntime": 0, "CpuShares": 0, "CpusetCpus": "", "CpusetMems": "", "DeviceCgroupRules": null, "DeviceRequests": null, "Devices": [ { "CgroupPermissions": "rwm", "PathInContainer": "/dev/ttyUSB0", "PathOnHost": "/dev/ttyUSB0" } ], "Dns": [], "DnsOptions": null, "DnsSearch": null, "ExtraHosts": [], "GroupAdd": null, "IOMaximumBandwidth": 0, "IOMaximumIOps": 0, "Init": false, "IpcMode": "private", "Isolation": "", "KernelMemory": 0, "KernelMemoryTCP": 0, "Links": null, "LogConfig": { "Config": {}, "Type": "json-file" }, "MaskedPaths": null, "Memory": 0, "MemoryReservation": 0, "MemorySwap": 0, "MemorySwappiness": null, "NanoCpus": 0, "NetworkMode": "bridge", "OomKillDisable": null, "OomScoreAdj": 0, "PidMode": "", "PidsLimit": null, "PortBindings": {}, "Privileged": true, "PublishAllPorts": true, "ReadonlyPaths": null, "ReadonlyRootfs": false, "RestartPolicy": { "MaximumRetryCount": 0, "Name": "no" }, "Runtime": "runc", "SecurityOpt": [ "label=disable" ], "ShmSize": 67108864, "UTSMode": "", "Ulimits": null, "UsernsMode": "", "VolumeDriver": "", "VolumesFrom": null }, "HostnamePath": "/var/lib/docker/containers/35d08af519be9d646037c5a9e80364c5e8273d7ddf1da999ee3888caafc758a2/hostname", "HostsPath": "/var/lib/docker/containers/35d08af519be9d646037c5a9e80364c5e8273d7ddf1da999ee3888caafc758a2/hosts", "Id": "35d08af519be9d646037c5a9e80364c5e8273d7ddf1da999ee3888caafc758a2", "Image": "sha256:c6db9288b43f89a37398caaa23abb309b109cd715ec672e15a8cac6527829724", "LogPath": "/var/lib/docker/containers/35d08af519be9d646037c5a9e80364c5e8273d7ddf1da999ee3888caafc758a2/35d08af519be9d646037c5a9e80364c5e8273d7ddf1da999ee3888caafc758a2-json.log", "MountLabel": "", "Mounts": [ { "Destination": "/usr/local", "Driver": "local", "Mode": "", "Name": "01c0a2d351ddd22e1bab956f6db96ab31058942cc3af41ffc2ae2923cf6f4b15", "Propagation": "", "RW": true, "Source": "/var/lib/docker/volumes/01c0a2d351ddd22e1bab956f6db96ab31058942cc3af41ffc2ae2923cf6f4b15/_data", "Type": "volume" } ], "Name": "/CCU", "NetworkSettings": { "Bridge": "", "EndpointID": "22041c401e95b9f9f5374ae3b88c5a11c88e7477fd902701763c8c229a0be9c0", "Gateway": "172.17.0.1", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "HairpinMode": false, "IPAddress": "172.17.0.3", "IPPrefixLen": 16, "IPv6Gateway": "", "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "MacAddress": "02:42:ac:11:00:03", "Networks": { "bridge": { "Aliases": null, "DriverOpts": null, "EndpointID": "22041c401e95b9f9f5374ae3b88c5a11c88e7477fd902701763c8c229a0be9c0", "Gateway": "172.17.0.1", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "IPAMConfig": {}, "IPAddress": "172.17.0.3", "IPPrefixLen": 16, "IPv6Gateway": "", "Links": null, "MacAddress": "02:42:ac:11:00:03", "NetworkID": "9d04939007466f190b61e7cc1e7aa0565b4976540ef9334ed80ac007463618e1" } }, "Ports": { "2001/tcp": [ { "HostIp": "0.0.0.0", "HostPort": "32773" } ], "22/tcp": [ { "HostIp": "0.0.0.0", "HostPort": "32775" } ], "80/tcp": [ { "HostIp": "0.0.0.0", "HostPort": "32774" } ], "8181/tcp": [ { "HostIp": "0.0.0.0", "HostPort": "32772" } ] }, "SandboxID": "131d06bb031c4aac0f1bd8bf0a5a3a51c1cb7f2aff502c424f22fdc75bda0038", "SandboxKey": "/var/run/docker/netns/131d06bb031c", "SecondaryIPAddresses": null, "SecondaryIPv6Addresses": null }, "Path": "/entrypoint.sh", "Platform": "linux", "Portainer": { "ResourceControl": { "Id": 13, "ResourceId": "35d08af519be9d646037c5a9e80364c5e8273d7ddf1da999ee3888caafc758a2", "SubResourceIds": [], "Type": 1, "UserAccesses": [], "TeamAccesses": [], "Public": false, "AdministratorsOnly": true, "System": false } }, "ProcessLabel": "", "ResolvConfPath": "/var/lib/docker/containers/35d08af519be9d646037c5a9e80364c5e8273d7ddf1da999ee3888caafc758a2/resolv.conf", "RestartCount": 0, "State": { "Dead": false, "Error": "", "ExitCode": 0, "FinishedAt": "0001-01-01T00:00:00Z", "OOMKilled": false, "Paused": false, "Pid": 11218, "Restarting": false, "Running": true, "StartedAt": "2020-08-29T19:32:24.47103835Z", "Status": "running" } }
I found the issue!
The HMIP-RFUSB doesn´t like any sort of USB extension, not even a quality USB hub with 10 cm cable. Whats strange is that it finds the module using lsusb etc. but it won´t be registered by the CCU software, probably since only that software tries to talk to the daughter board inside the stick. I guess the power supply to the RF board might be at its limit on my unit.
BidCos-RF: none, HmIP: HMIP-RFUSB, OK Starting /etc/init.d/S12UpdateRFHardware Updating Homematic RF-Hardware: HMIP-RFUSB: 2.8.6, OK
Just a shame my USB ports are normally blocked for SSDs/HDDs and the chunky HMIp-RFUSB doesn´t fit but thats another issue...
I had missed your comment that you were using an own serial2usb adapter x-) Glad you got it working.
Exactly: homematic uses a custom serial device driver - this is what limits so much the HW. In the meanwhile the author of pivccu wrote its own device driver for several adapters so I use his in deploy.sh. So in other words: this docker container supports the HW supported by pivccu.
Any reason why you do not connect the PCB to the Raspberry GPIOs directly?
I am using the official HMIP-RFUSB module. I might look at other USB adapters, good to know there´s more supported through pivccu.
The flexibility of USB is what I prefer, there´s only one GPIO connector but plenty of USB (if adapters work with the devices XD). Still planning to use the GPIO for something else (current monitor).
In any case thanks for your work on making this docker!
Hello,
I am trying desperately to make this work on a RPI4 system with OMV5 on it.
So far I managed to get the TTYUSB0 device attached to the docker like this: Host dev:
crw-rw---- 1 root dialout 188, 0 Aug 29 20:47 ttyUSB0
Container dev:
crw-rw---- 1 root 20 188, 0 Aug 29 21:32 ttyUSB0
However the startup log file always tells me no RF device has been found:
What could be the issue? Anything I tried from other similar reported errors doesn´t help. I tried starting the container from the portainer ui as well as from by direct docker command:
docker run --device /dev/ttyUSB0 --name CCU angelnu/ccu:latest
Log: