ZwaveJS2MQTT Stopped working - Missing plug serial-port

Hi, Looking for some hints or guidance to get me unblocked. So, first of all, I need to state that I am a little confused about the various versions and options around Zwave integrations (I migrated a while back to running a stand-alone zwavejs2mqtt server based on some recommendation that I read) … however, key takeaway is that I had a nice working system until a few weeks ago and now I can’t control my Zwave devices. This didn’t happen during an HA upgrade … although I do have unattended security upgrades on most of my containers.

The issue is that my zwavejs2mqtt service won’t start properly. It dies looping with this error:

May  7 01:43:03 zwavejs2mqtt zwavejs2mqtt.zwavejs2mqtt[16504]: #033[90m2022-05-07 01:43:03.042#033[39m #033[32mINFO#033[39m #033[1mMQTT#033[22m: Connecting to mqtt://mqtt.mydomain.com:2883
May  7 01:43:03 zwavejs2mqtt zwavejs2mqtt.zwavejs2mqtt[16504]: [Error: ENOENT: no such file or directory, mkdir 'null'] {
May  7 01:43:03 zwavejs2mqtt zwavejs2mqtt.zwavejs2mqtt[16504]:   errno: -2,
May  7 01:43:03 zwavejs2mqtt zwavejs2mqtt.zwavejs2mqtt[16504]:   code: 'ENOENT',
May  7 01:43:03 zwavejs2mqtt zwavejs2mqtt.zwavejs2mqtt[16504]:   syscall: 'mkdir',
May  7 01:43:03 zwavejs2mqtt zwavejs2mqtt.zwavejs2mqtt[16504]:   path: 'null'
May  7 01:43:03 zwavejs2mqtt zwavejs2mqtt.zwavejs2mqtt[16504]: }
May  7 01:43:03 zwavejs2mqtt systemd[1]: snap.zwavejs2mqtt.zwavejs2mqtt.service: Main process exited, code=exited, status=1/FAILURE
May  7 01:43:03 zwavejs2mqtt systemd[1]: snap.zwavejs2mqtt.zwavejs2mqtt.service: Failed with result 'exit-code'.
May  7 01:43:03 zwavejs2mqtt systemd[1]: snap.zwavejs2mqtt.zwavejs2mqtt.service: Scheduled restart job, restart counter is at 136.
May  7 01:43:03 zwavejs2mqtt systemd[1]: Stopped Service for snap application zwavejs2mqtt.zwavejs2mqtt.
May  7 01:43:03 zwavejs2mqtt systemd[1]: Started Service for snap application zwavejs2mqtt.zwavejs2mqtt.
May  7 01:43:03 zwavejs2mqtt zwavejs2mqtt.zwavejs2mqtt[16549]: Missing plug: «serial-port»

My setup is as follows:

HA runs in an LXC container managed by LXD ( I install and upgrade in a venv)
ZWaveJS2MQTT runs in a different LXC container on the same host - it is installed as a snap
My USB devices (Zwave and Zgbee dongles) are passed through to the HA container from the host
I have a “Zwave JS” integration in HA that points to the zwavejs2mqttcontainer ip on port 3000

This setup WAS working well for more than a year or two. It stopped a few weeks ago and I can’t pinpoint any change I made as a trigger. I’ve reviewed my bash_history to double check the various permission tweaks on the ttyACM* devices as well as any sysctl commands needed to be sure the containerization doesn’t get in the way (usually needed after host reboots).

While troubleshooting, I ran sudo zwavejs2mqtt.help and saw:

 Info on the serial-port plug:
 This plug requires the experimental hotplug feature in snapd.
 Enable it with
  $ sudo snap set system experimental.hotplug=true
  And restart snapd with:
  $ sudo systemctl restart snapd
  Now list available serial slots with:
  $ sudo snap iterface serial-port
  And connect it to zwavejs2mqtt with:
  $ sudo snap connect zwavejs2mqtt:serial-port slotname

I ran through that (fixing iterface for interface) … but I didn’t succeed with the last command … not sure what to use for the slotname. Although all that might be unrelated:

sudo snap interface serial-port
name:    serial-port
summary: allows accessing a specific serial port
plugs:
  - zwavejs2mqtt
  
uname@zwavejs2mqtt:~$  sudo snap connect zwavejs2mqtt:serial-port zwavejs2mqtt
error: snap "zwavejs2mqtt" has no "serial-port" interface slots

Anybody stumbled across anything similar? Any hints or ideas appreciated!

Thanks!

see if this post helps your procedure…

There was a change in Z2M that caused the snap package to break. You can find a workaround here (I have no clue what it means though).

You might also try switching to the latest/candidate channel. It was updated yesterday, so maybe it was fixed.

1 Like

Wow thanks! Wasn’t expecting such a fast reply … especially with an easy fix! Much appreciated!
For clarity if others run into this:

In /var/snap/zwavejs2mqtt/current/settings.json

edit the option deviceConfigPriorityDir so it looks like:

“deviceConfigPriorityDir”: “/var/snap/zwavejs2mqtt/current/config”

Thanks Again!

2 Likes

Hi,

This should be fixed in the current candidate channel. The change came with a recent change in Z2M, where its now checking that the deviceConfigPriorityDir in the settings.json file exists and is readable.

It seems to become a problem especially when a settings.json-file is moved from e.g a docker container to the snap environment, as both environment is restricted within certain RO/RW mounts.

So my issue has popped up again - I am assuming snap did its auto-update thing (zwavejs2mqtt - v7.2.0
?). Same error, I can’t start the service because I am “Missing plug: «serial-port»”. Interestingly, I have a Jan 4 snapshot (zwavejs2mqtt - v7.1.0) that I CAN start … but that still shows the same error.

It was working up until 4-5 days ago (my Jan 4 snapshot was after an upgrade to HA forced an upgrade to zwavejs2mqtt and iirc, I had to migrate to zwave-js-ui ). Any changes recently that might cause this? PS: the change to the json file didn’t help this time …

Missing plug: serial-port is not an error, and shouldn’t be the reason for an error.

What did you have to fix in the settings.json file?

Please check snap logs zwavejs2mqtt -f for other errors. Are you running edge channel?

Thank you so much for the hint! The issue was an error connecting to my mqtt server: I migrated to proxying mqtt off an nginx server to make managing certs easier (1 place to update) … and for some reason my zwjs2mqqt config was still set to use 2883 (insecure mqtt listener) but the domain resolved to the nginx server which was only listening on 8883. Odd thing is that this was done many months ago … so still no idea how the problem just surfaced in the last week?

Now I just have to figure out how to get a new enough version running again for HomeAssistant (I played with snap channels while troubleshooting) - should have taken notes the last time! HA complains about:

Invalid server version: Z-Wave JS Server version (1.22.1) is incompatible. Update the Z-Wave JS Server to a version that supports at least api schema 24

IIRC, last time, I needed to migrate to the new project zwave-js-ui … which I can also see installed and running … but when running alone, it doesn’t present the UI or API port. (Do both of those snaps need to be running?)

zwave-js-ui v8.8.1 56 latest/candidate giaever-online -
zwavejs2mqtt v7.2.0 504 latest/edge giaever-online -

Hi,

I’m working on the «easy switch» between Zwavejs2mqtt and Zwave-js-ui. zwave-js-ui is a seperate package, as the name have changed and is per definition a different software (snap doesn’t allow re-naming).

I will hopefully have a fully functional integration between them within a few days. It’s taken a lot more time than I expected, regards to high amount of work. This is just a spare-time-project.