Zigbee2mqtt - /dev/ttyACM0 problem after HASSIO update

My Homeassistent setup with zigbee2mqtt on RbPi has been runninng wo. issues for some time, and I have 20 or so zigbee devices successfully paired and reporting through a CC2531. Then I decided to update Hassio …

New Hassio core version: 2021.2.1
New OS Version Home Assistant OS 5.10
Old versions I do not remember, but they were > 6 months old.

After the update no zigbee devices report status. Looking at the zigbee2mqtt log it is clear that it does not have access to /dev/ttyACM0:

zigbee2mqtt:error 2021-02-06T09:06:24: Error: Error while opening serialport 'Error: Error: No such file or directory, cannot open /dev/ttyACM0'

Opening a ssh terminal on hassio shows no access to /dev/ttyACM0 and /dev/serial/by-id:

core-ssh:~# ls -l /dev/ttyACM0
ls: /dev/ttyACM0: No such file or directory
core-ssh:~# ls -l /dev/serial/by-id
ls: /dev/serial/by-id: No such file or directory

Still hassio hardware info reports that the CC2531 is found and tied to /dev/ttyACM0:

core-ssh:~# hassio hardware info
{
    "result": "ok",
    "data": {
        "serial": [
            "/dev/ttyAMA0",
            "/dev/ttyACM0",
            "/dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B001936A0BE-if00"
        ],

If I unplug the CC2531, hassio hardware info only reports the /dev/ttyAMA0.

I am not sure if this is a permissions issue or there is something else going on - any help is highly appreciated!
There are some other older posts with similar problems, but none provide a solution which works for this issue.

Thanks for your help

A bit more info from the zigbee2mqtt log:

zigbee2mqtt:info  2021-02-08T13:41:08: Logging to directory: '/share/zigbee2mqtt/log/2021-02-08.14-41-06'
zigbee2mqtt:info  2021-02-08T13:41:08: Starting zigbee2mqtt version 1.7.1 (commit #unknown)
zigbee2mqtt:info  2021-02-08T13:41:08: Starting zigbee-herdsman...
zigbee2mqtt:error 2021-02-08T13:41:08: Error while starting zigbee-herdsman
zigbee2mqtt:error 2021-02-08T13:41:08: Failed to start zigbee
zigbee2mqtt:error 2021-02-08T13:41:08: Exiting...
zigbee2mqtt:error 2021-02-08T13:41:08: Error: Error while opening serialport 'Error: Error: Operation not permitted, cannot open /dev/ttyACM0'
    at Znp.<anonymous> (/zigbee2mqtt-1.7.1/node_modules/zigbee-herdsman/dist/adapter/z-stack/znp/znp.js:109:32)
    at Generator.next (<anonymous>)
    at /zigbee2mqtt-1.7.1/node_modules/zigbee-herdsman/dist/adapter/z-stack/znp/znp.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/zigbee2mqtt-1.7.1/node_modules/zigbee-herdsman/dist/adapter/z-stack/znp/znp.js:4:12)
    at SerialPort.serialPort.open (/zigbee2mqtt-1.7.1/node_modules/zigbee-herdsman/dist/adapter/z-stack/znp/znp.js:107:49)
    at SerialPort._error (/zigbee2mqtt-1.7.1/node_modules/zigbee-herdsman/node_modules/@serialport/stream/stream.js:197:14)
    at binding.open.then.err (/zigbee2mqtt-1.7.1/node_modules/zigbee-herdsman/node_modules/@serialport/stream/stream.js:241:12)

Please let me know what to try out or if you need more info to assist debug
Thanks

Found a solution…

Uninstalled zigbee2mqtt and reinstalled it based on the description from Daniel Welch description.

After reinstall and configuration of mqtt server, ti now runs as before. It even kept all zigbee devices.
You may want to backup /share/zigbee2mqtt files before you do this…

Sorry I can’t find the description that you refer to. Could you send the link to it please? I’m stuck with exactly the same problem that you describe. Thanks.

They depreciated the repository and moved the readme file.
There is some documentation in the regular zigbee2mqtt docs.

Mine started giving these errors:

Zigbee2MQTT:error 2021-09-15 19:44:18: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2021-09-15 19:44:18: Failed to start zigbee
Zigbee2MQTT:error 2021-09-15 19:44:18: Check https://www.zigbee2mqtt.io/information/FAQ.html#help-zigbee2mqtt-fails-to-start for possible solutions
Zigbee2MQTT:error 2021-09-15 19:44:18: Exiting...
Zigbee2MQTT:error 2021-09-15 19:44:18: Error: Error while opening serialport 'Error: Error: No such file or directory, cannot open /dev/ttyACM0'
    at SerialPort.<anonymous> (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/znp/znp.ts:146:28)
    at SerialPort._error (/app/node_modules/zigbee-herdsman/node_modules/@serialport/stream/lib/index.js:198:14)
    at /app/node_modules/zigbee-herdsman/node_modules/@serialport/stream/lib/index.js:242:12

It doesn’t start anymore…

Sometimes after a restart they switch ports. It is better to use the /dev/serial/by-id syntax.

1 Like

Do i need to replace by-id with an actual id or is it a built-in var?

something like :

/dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B001936A0BE-if00

but with the id off your own stick.

2 Likes

Btw is it easy to find the id? Is there a command line? I typed ha hardware info in my commnad line but I get a massive list of items…

ls /dev/serial/by-id

1 Like

OK that was pretty straight forward code :slight_smile:
Anyhow it still gives an error after updating the configuration info, I’ll try a fulll docker restart.

Zigbee2MQTT:error 2021-09-16 08:34:15: Error: Error while opening serialport 'Error: Error Resource temporarily unavailable Cannot lock port'
    at SerialPort.<anonymous> (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/znp/znp.ts:146:28)
    at SerialPort._error (/app/node_modules/zigbee-herdsman/node_modules/@serialport/stream/lib/index.js:198:14)
    at /app/node_modules/zigbee-herdsman/node_modules/@serialport/stream/lib/index.js:242:12
[08:34:15] INFO: Handing over control to Zigbee2mqtt Core ...
> [email protected] start
> node index.js

OK reboot and change of USB port worked…

Actually it doesn’t work…

I set in the configuration options:

serial:
  port: >-
    /dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B0018E2111C-if00

But I get:

Zigbee2MQTT:error 2021-09-16 08:47:22: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2021-09-16 08:47:22: Failed to start zigbee
Zigbee2MQTT:error 2021-09-16 08:47:22: Check https://www.zigbee2mqtt.io/information/FAQ.html#help-zigbee2mqtt-fails-to-start for possible solutions
Zigbee2MQTT:error 2021-09-16 08:47:22: Exiting...
Zigbee2MQTT:error 2021-09-16 08:47:22: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
    at ZStackAdapter.start (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:102:27)
    at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:123:29)
    at Zigbee.start (/app/lib/zigbee.js:66:27)
    at Controller.start (/app/lib/controller.js:110:27)
    at start (/app/index.js:95:5)

Error: SRSP - SYS - ping after 6000ms #

2 common reasons of this error:

  1. The port of your serial adapter changed. Check this to find out the port of your adapter.
  2. If you are using a CC2530 or CC2531; it is a common issue for this adapter to crash (due to its outdated hardware). Reflashing the firmware should fix the problem.

Yeah it’s prob #2, the USB adapter keeps disconnecting…

Is CC2531_DEFAULT_20201127.zip the latest version?

Firmware update seem to work, will see if it keeps dropping…

So it keeps dying, maybe it’s time to get a better dongle…

The CC2531 is a cheap dongle to get started, but there are better dongles available.

Found one called ConBee II but its $$$