First, I write this not as a question but as an experience and gained knowledge, I hope this can help others like me.
I am not an expert in Raspberry pi or linux, but I use Home Assistant Core and Zwave JS UI on my RPi 4. I used Docker to run Z Wave UI before and now decide to switch to the Snap installation.
I read as many guides as I can found and still met several problems during installation. Luckily I found all the methods to solve these bugs and finally got my Zwave JS UI running. But all of them are in difference websites / places, so I try to summarize all those issue I met together in one page. I hope this helps other people like me who is searching for solutions.
1. Install Snap package
To use Snap package to install Zwave, of courser we need to install Snap first. Below commands are valid for Debian:
sudo apt-get update
sudo apt-get install snapd
Hint1: later we will need to use command like
sudo zwave-js-ui.enable
, to make it possible for Raspberry Pi OS 32-bit system, we need to add the binary-folder to sudoer, otherwise you will get error e.g.:
sudo zwave-js-ui.enable: command not found
So run command: sudo visudo
Find out this secure_path
line, add :/snap/bin
to the end of the path but before "
. See below as an example:
Defaults secure_path="/usr/local/bin:/usr/bin:/bin:/snap/bin"
Save and quit the editor, and restart the system sudo reboot
.
2. Install the core
snap
Install core
snap is to get the latest snapd
according to the official guide on snapcraft.
sudo snap install --channel=stable core
Hint2: because installed snap will be upgraded automatically, I personally prefer to use the argument
--channel=stable
to only update the major release instead ofcandidate
oredge
release version.
After this step, Snap is successfully installed. We also need to enable the hotplug support, and then restart the snapd service.
sudo snap set system experimental.hotplug=true
sudo systemctl restart snapd
3. Install Zwave JS UI with Snap
Hint2.1: later added comment, before run the next command, please read this Hint and also the Hint5 in below. By the release of Home Assistant 2023.10, it turns out the Home Assistant requires a higher version Zwave-JS-UI than the latest available stable version on snapd store.
Maybe use--channel=candidate
is an option to prevent it.
Use this command to install zwave-js-ui
snap:
sudo snap install --channel=stable zwave-js-ui
To give the package access to use USB devices and observe hardware. The second one is needed for the program to list available devices in the UI.
sudo snap connect zwave-js-ui:raw-usb
sudo snap connect zwave-js-ui:hardware-observe
Hint3: here we also need to deal with a bug which seems only on Raspberry Pi OS 32-bit system. Remove the link to the unknow libarmmem-file. This solves the failure like this:
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
Log into the shell and edit the file /var/lib/snapd/hostfs/etc/ld.so.preload
.
sudo snap run --shell zwave-js-ui
vi /var/lib/snapd/hostfs/etc/ld.so.preload
I personally like nano
but cannot use it in the shell, so only possible to edit it with vi
. If one isnāt familiar with VI, it is very easy to get crazy. For those whoās not familiar with it, do exactly as following described and nothing else including moving cursor
Press i
after launched the editor, and now the cursor should be at 1st position of the row, enter #
to comment out the line /usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so
. Afterwards prese one time ESC
, and type :wq
then press ENTER
.
Now we should get out of the editor, then type exit
to exit the shell.
4. Start the Zwave JS UI server
To start the server is easy with this command:
sudo zwave-js-ui.enable
But you still may get errorsā¦
Hint4: before start the server we can run command
zwave-js-ui.help
to see some useful information as well as some commands we need to execute.
For example, we can see this information:
Server configuration values: {
"server": {
"host": "localhost",
"port": 8091,
"ssl": false
The default host address is localhost
, if you use ssh
to connect to the pi and want to access the UI page <your IP address>:8091
on your remote computer, you need to change the host to the IP address of your Pi. I met this problem myself, server was correctly enabled without error information, but I just cannot open the UI page until I realized this. Use below command:
sudo snap set zwave-js-ui server.host='<your IP address>'
Then we need to connect the serial-port to the plug zwave-js-ui
. First list available serial slots:
sudo snap interface serial-port
We may get below information:
name: serial-port
summary: allows accessing a specific serial port
plugs:
- zwave-js-ui
slots:
- core:<example-slot> (allows accessing a specific serial port)
Then use this command to connect the correct serial slot to zwave-js-ui:
sudo snap connect zwave-js-ui:serial-port <slot name>
The <slot name>
is the one you listed before, here it is core:<example-slot>
.
Hint5: The hint is later added to include the new issue which a lot of people met and metioned in the replies.
After a certern version of update, there might appear such an error message:
Driver: Failed to open the serial port: Error: Operation not permitted, cannot open /dev/ttyUSB0 (ZW0100)
To solve this error, the proved way is to install the zwave-js-ui indevmode
, use below command:
sudo snap refresh --devmode --channel=stable zwave-js-ui
Note: If your installed version was already the lastest version, the refresh will not work, you will get
snap āzwave-js-uiā has no updates available
. You will then need eitherrevert
the revision to an older version and run above command again; or switch tocandidate
release, becausecandidate
release is always higher thanstable
release.
By new installation, please consider to install directly in devmode:
sudo snap install --devmode --channel=stable zwave-js-ui
After all these steps about, now we can finally enable the zwave-js-ui.
sudo zwave-js-ui.enable
Then access it via webpage: <your IP address>:8091
. At least these are all the bugs I have met.
Again, I am not the expert to create these solutions, but I found them and collected them together. Thanks to all the awesome people!
If you have any questions with other bugs you have, donāt ask me, I am not able to answer probablyā¦ Use google, you will find the answer most of the cases.
Good Luck to all!