Port /dev/ttyACM0 does not exist

Hi!
I have the same problem, running docker 2.2.0-amd64-debian
The problem started after a reboot last week (before that all was ok and worked), I updated some packages on my host, and the openhab docker image.

I can solve the problem by setting
"sudo chmod 777 /dev/ttyACM0"
But it should not be nessessary.

I think something has changed in the docker image, maybe something(inside docker) is using the port that is not changed to user set by “-e USER_ID”.
There is mentioning about the docker setting "–user " in the documentation, but with that setting the docker image does not start. This should be fixed or mentioning of “–user …” should be removed from documentation.
I have my user in dialout and tty groups and run docker like:

/dev/ttyUSBZwave has a symbilic link to /dev/ttyACM0 from an udev rule:

SUBSYSTEM=="tty", ATTRS{idVendor}=="0658", ATTRS{idProduct}=="0200", SYMLINK+="ttyUSBZwave"
docker run \
        -dit \
	--name openhab \
	--net=host \
	--device=/dev/ttyUSBZwave:rwx \
	-v /etc/localtime:/etc/localtime:ro \
	-v /etc/timezone:/etc/timezone:ro \
	-v ${BASE}/conf:/openhab/conf \
	-v ${BASE}/userdata:/openhab/userdata \
	-v ${BASE}/addons:/openhab/addons \
	-v ${BASE}/.java:/openhab/.java \
	-e USER_ID=$(id -u) \
	-e GROUP_ID=$(id -g) \
	-e OPENHAB_HTTP_PORT=9070 \
	-e OPENHAB_HTTPS_PORT=9071 \
	-e EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSBZwave" \
	--restart=always \
	openhab/openhab:2.2.0-amd64-debian

I have recently updated my server and when it came back up the Z-wave and EnOcean dongles no longer worked.
After a lot of investigation, I can conclude that the problem lies with a bug in docker.
A recent version has a bug that will not respect the owner and group of devices that were pulled into the container with the --device= element. https://github.com/moby/moby/issues/36628
When you run the container with the openhab user ( as you should) Then you will not be able to access the devices.
The fix is already implemented and will be available soon, apparently.
A workaround for now would be to copy your container and run openhab as root (not great) or set the accessibility to rw for all users on your devices.

1 Like

I ran into the same issues that after restarting OpenHAB, OpenHAB does’t see /dev/ttyACM0.
Followed all intructions without success.
But when I deleted the ‘MySensors Serial Gateway’ thing (Remove + OpenHAB restart), OpenHAB sees /dev/ttyACM0.
Then manual added the ‘MySensors Serial Gateway’ thing and everythings seems to be working till next OpenHAB restart.
Workaround for now is remove MySensors restart OpenHAB2 service and add it again… not the most preferable way but for now it works…
So both bindings do have a conflict togeher, unfortunately I have no knowledge to solve these kind of issues.

Sounds like I have a similar issue as well. Openhabian with zwave gen5 usb and mysensors serial(usb). On reboot zwave ACM0 is not found.

If I set (in PaperUI) the port configuration of mysensors to ACM0, then I can set the zwave usb to ACM0, then change the mysensors back to ACM1, it then all works…

Pain having to do it after every reboot. WAF will not rate this at all.

Considering building an ethernet mysensors gateway as a workaround, but if I add any more usb devices am I going to have the same issue…

Any suggestions?


hc_258
and restart Raspi

Thanks for the suggestion. Already set 1 and 3 in there, 2 won’t set for some reason (rebooted as well). No difference.

I can get it working by changing the mysensors gateway to acm1, then it gives me the option of changing the zstick to acm1. Next step is to change mysensors gateway to acm0, then I get the option of changing the zstick to acm0, and finally the gateway back to acm1 with everything working again until next reboot.

Permissions have been set, dialup and tty groups.

Rank novice at linux but having to learn quickly.

I sorted my issue out.

Running openhab 2.3 and had to install the jar of mysensors 2.3, and update the mysensors serial gateway with the mysensors 2.3 library. There was a few other things I had to do, but faffed if I can remember them now.

Symlinks made and working for the usb items, so hopefully it stays working.

Hi

In my case, adding open hap to the dialout group definitively solved the issue.
Openhab2 needed to be restarted after adding the user to the group.

Personnally, I edit the groups file directly. So now I have the following line in it:
dialout:x:20:pi,openhab

To find out about it, I enabled the logging as indicated in the documentation and it said that the port /dev/ttyACM0 did not exist even if the device was present, after removing and adding it, etc.

In my case, fixing the permissions did not work, but installing openhab-transport-serial did.

feature:install openhab-transport-serial

Hope this helps somebody else.

I’m getting this same error "Serial Error: Port /dev/ttyACM0 does not exist " after updating, using docker on qnap container.

This is the container file, where can i add option for EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ACM0"
?

{"environment": [], "resource": {"device": [["allow", "ACM_USB_modems_(166)", "rwm"], ["allow", "Input_(13)", "rwm"], ["allow", "TTY_(4)", "rwm"]], "gpu": [], "limit": {}}, "network": {"bridge": {"interface": {"bridge": "br0", "name": "eth0", "ip": "192.168.0.11", "gateway": "192.168.0.2", "netmask": "255.255.255.0", "display": "Adapter 1 (Virtual Switch 4)"}, "ip": [192, 168, 0, 20], "netmask": [255, 255, 255, 0], "mode": "static", "gateway": [192, 168, 0, 2]}, "hostname": "openhab3", "port": [], "mode": "bridge"}, "links": {}, "arch": "amd64", "image": "openhab/openhab", "volume": {"new": [], "host": {"/share/Container/openHab/userdata": {"bind": "openhab/userdata", "ro": false}, "/share/Container/openHab/conf": {"bind": "openhab/conf", "ro": false}, "/share/Container/openHab/addons": {"bind": "openhab/addons", "ro": false}}, "container": []}, "working_dir": "", "version": "3.0.0-snapshot", "command": "", "user": "", "autostart": true, "gpu": false, "entrypoint": "", "type": "docker", "privileged": true, "name": "openhab3snap"}

Found a docker conf file where I added “-Dgnu.io.rxtx.SerialPorts=/dev/ACM0” to and looks like it runs it. But I still get the same error.