I having the following error in the zigbee2mqtt repeatedly:
Zigbee2MQTT:info 2020-09-07 15:43:34: Logging to console and directory: '/share/zigbee2mqtt/log/2020-09-07.15-43-33' filename: log.txt
Zigbee2MQTT:info 2020-09-07 15:43:46: Starting Zigbee2MQTT version 1.14.4 (commit #unknown)
Zigbee2MQTT:info 2020-09-07 15:43:46: Starting zigbee-herdsman...
Zigbee2MQTT:error 2020-09-07 15:43:49: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2020-09-07 15:43:49: Failed to start zigbee
Zigbee2MQTT:error 2020-09-07 15:43:49: Exiting...
Zigbee2MQTT:error 2020-09-07 15:43:49: Error: Error while opening serialport 'Error: Error Resource temporarily unavailable Cannot lock port'
at Znp.<anonymous> (/zigbee2mqtt-1.14.4/node_modules/zigbee-herdsman/dist/adapter/z-stack/znp/znp.js:136:32)
at Generator.next (<anonymous>)
at /zigbee2mqtt-1.14.4/node_modules/zigbee-herdsman/dist/adapter/z-stack/znp/znp.js:27:71
at new Promise (<anonymous>)
at __awaiter (/zigbee2mqtt-1.14.4/node_modules/zigbee-herdsman/dist/adapter/z-stack/znp/znp.js:23:12)
at SerialPort.<anonymous> (/zigbee2mqtt-1.14.4/node_modules/zigbee-herdsman/dist/adapter/z-stack/znp/znp.js:134:49)
at SerialPort._error (/zigbee2mqtt-1.14.4/node_modules/zigbee-herdsman/node_modules/@serialport/stream/lib/index.js:198:14)
at /zigbee2mqtt-1.14.4/node_modules/zigbee-herdsman/node_modules/@serialport/stream/lib/index.js:242:12
npm
ERR! code ELIFECYCLE
npm ERR!
errno 1
npm
ERR!
[email protected] start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR!
This is probably not a problem with npm. There is likely additional logging output above.
npm
ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-09-07T12_43_49_644Z-debug.log
2020-09-07T15:43:51: PM2 log: App [npm:0] exited with code [1] via signal [SIGINT]
2020-09-07T15:43:51: PM2 log: App [npm:0] starting in -fork mode-
2020-09-07T15:43:52: PM2 log: App [npm:0] online
> [email protected] start /zigbee2mqtt-1.14.4
> node index.js
I get this sometimes when I reboot, never worked out why, but to fix it (presuming your problem is the same as mine) stop the addon, unplug the USB, count to 10, plug it back in, restart the addon.
If that doesn’t work I’m out of suggestions, but always works for me here.
Change in your Zigbee2MQTT configuration the way you adress your Zigbee USB Stick from “/dev/ttyxxxx” to " /dev/serial/ by-id /xxxx" if it’s not already done.
Im having same issue as OP. Always get the ‘cannot lock port’ error.
I bought a Sonoff adapter since its recommended to be used with Zigbee2MQTT and still same thing. Im unplugged all other sticks just to rule them out as a conflict…
What is tour setup? A Rpi4 with HAOS or?
The sonoff, have you firmware upgraded it?
Have you checked that nothing else is using the dongle, like ZHA being installed as it detects the sonoff?
Do you use a USB cable extender?
Did not do any upgrades to Sonoff. Straight outta the box.
I dont know how to check if anything else is using it. I do/did have ZHA installed that I currently use with my Nortek stick. But I went into my Integrations and i disabled ZHA, then restarted host.
Have a look in this thread for firmware upgrade of the dongle, as a try. Im not sure this is the problem as it indicates ZHA is using the port, however with ZHA disabled this should not happen
Something similar happens to me. Only solution is reboot the entire virtualbox machine. I guess the usb stops working for some reason. Very annoying really
I get this but much more frequently. It basically makes zigbee2mqtt unusable. Does anyone have any idea how to solve it?
I get this log message:
2024-01-27T15:19:29.076Z zigbee-herdsman:adapter:ezsp:erro Connection attempt 3 error: Error: Error while opening serialport ‘Error: Error Resource temporarily unavailable Cannot lock port’
I do not have ZHA installed (as far as I know!)