Z-wave JS UI failed to open serial port Topic is solved

For Z-Wave related questions in Domoticz

Moderator: leecollings

remko2000
Posts: 165
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Z-wave JS UI failed to open serial port

Post by remko2000 »

Hai there. I followed:
https://www.domoticz.com/wiki/Zwave-JS-UI to pass form OZW to Zwave JS UI.
I am now ready to open JS UI' s user interface.
I do al the recommended settings but I get the error in Z-wave JS UI:
driver: failed to open the serial port: error : no such file or directory, cannot open /dev/serial/by-id/usb-0658_0200-if00:/dev/zwave (ZW0100)
Schermafbeelding 2024-01-04 om 15.28.52.png
Schermafbeelding 2024-01-04 om 15.28.52.png (305.12 KiB) Viewed 29981 times
In domoticz I get also an error in my log:
2024-01-03 18:47:26.148 Error: MQTT Auto Discovery Client Gateway with LAN interface: Failed to start, return code: 14/Connection refused (Check IP/Port)
Schermafbeelding 2024-01-04 om 15.01.12.png
Schermafbeelding 2024-01-04 om 15.01.12.png (304.72 KiB) Viewed 29987 times
My docker-compose.yml file in root@homebridge:~/mosquitto-docker-compose# looks like this:

Code: Select all

version: "3.7"
services:
  zwave-js-ui:
    container_name: zwave-js-ui
    image: zwavejs/zwave-js-ui:latest
    restart: unless-stopped
    tty: true
    stop_signal: SIGINT
    environment:
      - SESSION_SECRET=mySecretSession
      - TZ=Europe/Amsterdam
    devices:
      - /dev/serial/by-id/usb-0658_0200-if00-port0:/dev/zwave
    volumes:
      - ./store:/usr/src/app/store
    ports:
      - "8091:8091" # port for web interface
      - "3000:3000" # port for Z-Wave JS websocket server
My mosquitto.conf file is:

Code: Select all

listener 1883
persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log

## Authentication ##
# By default, Mosquitto >=2.0 allows only authenticated connections. Change to >
allow_anonymous true
# password_file /mosquitto/config/password.txt
The USB address is correct and from my z wave stick aeotec 5 (pluged in). What can be the problem? Do I need to reset de zwavestick?

If I check mosquitto by:

Code: Select all

netstat -na | grep 1883
I get nothing back.
remko2000
Posts: 165
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Re: Z-wave JS UI failed to open serial port

Post by remko2000 »

After many searching, I haven't gotten much further, anyone who can help me so that I can use my zwave devices again?
User avatar
boum
Posts: 130
Joined: Friday 18 January 2019 11:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: France
Contact:

Re: Z-wave JS UI failed to open serial port

Post by boum »

in the field “Serial Port” of your zwave JS (the one on port 8091/#/settings), there you should only put ”/dev/zwave”
the docker compose file tells to map external (out of docker) usb device by ID to internal (where zwave js runs) /dev/zwave
User avatar
boum
Posts: 130
Joined: Friday 18 January 2019 11:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: France
Contact:

Re: Z-wave JS UI failed to open serial port

Post by boum »

also not sure about your MQTT server. It should have its docker compose file in its own directory (if you go that way like described in the wiki).
those are 2 different docker images
capitalT
Posts: 11
Joined: Thursday 30 May 2019 9:51
Target OS: Linux
Domoticz version:
Contact:

Re: Z-wave JS UI failed to open serial port

Post by capitalT »

Are you sure your device ID is correct and it is not: usb-0658_0200-if00 (without the port0 part)
My docker-compose.yml file in root@homebridge:~/mosquitto-docker-compose# looks like this:
Is this a typo? Or do you zwave-js and mosquitto in the same directory?
solarboy
Posts: 300
Joined: Thursday 01 November 2018 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.6
Location: Portugal
Contact:

Re: Z-wave JS UI failed to open serial port

Post by solarboy »

capitalT wrote: Thursday 04 January 2024 22:20 Are you sure your device ID is correct and it is not: usb-0658_0200-if00 (without the port0 part)
My docker-compose.yml file in root@homebridge:~/mosquitto-docker-compose# looks like this:
Is this a typo? Or do you zwave-js and mosquitto in the same directory?
This seems the right response as I have the same device and in my working zwave-js-ui it is

Code: Select all

/dev/serial/by-id/usb-0658_0200-if00
Intel NUC with Ubuntu Server VM (Proxmox),mosquitto(docker),RFXtrx433E,zwavejsUI (docker),Zigbee2mqtt(docker),SMA Hub (docker),Harmony Hub plugin, Kodi plugin,Homebridge(docker)+Google Home,APC UPS,SMA Modbus,Mitsubishi MQTT, Broadlink,Dombus
remko2000
Posts: 165
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Re: Z-wave JS UI failed to open serial port

Post by remko2000 »

solarboy wrote: Thursday 04 January 2024 22:32
capitalT wrote: Thursday 04 January 2024 22:20 Are you sure your device ID is correct and it is not: usb-0658_0200-if00 (without the port0 part)
My docker-compose.yml file in root@homebridge:~/mosquitto-docker-compose# looks like this:
Is this a typo? Or do you zwave-js and mosquitto in the same directory?
This seems the right response as I have the same device and in my working zwave-js-ui it is

Code: Select all

/dev/serial/by-id/usb-0658_0200-if00
Tried it and fill ' /dev/serial/by-id/usb-0658_0200-if00' in in the zwave js ui. Still the same error.............
User avatar
boum
Posts: 130
Joined: Friday 18 January 2019 11:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: France
Contact:

Re: Z-wave JS UI failed to open serial port

Post by boum »

remko2000 wrote: Friday 05 January 2024 11:13 Tried it and fill ' /dev/serial/by-id/usb-0658_0200-if00' in in the zwave js ui. Still the same error.............

/dev/serial/by-id/usb-0658_0200-if00:/dev/zwave
should be in your docker compose file in the ports section
/dev/zwave should be in you zwave js ui
remko2000
Posts: 165
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Re: Z-wave JS UI failed to open serial port

Post by remko2000 »

I' confused:
In my zwave js ui I set '/dev/zwave' :
Image

I also checked my docker-compose.yaml file. The strange thing is that I have two of these docker-compose.yaml files.
One in
map ‘mosquitto-docker-compose’ (root@homebridge:~# mosquitto-docker-compose)

the other in
map ‘zwavejs-ui’ (root@homebridge:/opt/zwavejs-ui#)


They now both contain the same content:

Code: Select all

version: "3.7"
services:
  zwave-js-ui:
    container_name: zwave-js-ui
    image: zwavejs/zwave-js-ui:latest
    restart: unless-stopped
    tty: true
    stop_signal: SIGINT
    environment:
      - SESSION_SECRET=mySecretSession
      - TZ=Europe/Amsterdam
    devices:
      - '/dev/serial/by-id/usb-0658_0200-if00:/dev/zwave'
    volumes:
      - ./store:/usr/src/app/store
    ports:
      - "8091:8091" # port for web interface
      - "3000:3000" # port for Z-Wave JS websocket server
However, I still get the same error (even after a reboot). Is it normal I have two of these files or did I make a mistake with the installation? I'm not very proficient in Linux.
Attachments
Schermafbeelding 2024-01-05 om 13.55.36.png
Schermafbeelding 2024-01-05 om 13.55.36.png (261.32 KiB) Viewed 29880 times
Last edited by remko2000 on Friday 05 January 2024 15:29, edited 1 time in total.
remko2000
Posts: 165
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Re: Z-wave JS UI failed to open serial port

Post by remko2000 »

boum wrote: Thursday 04 January 2024 16:44 also not sure about your MQTT server. It should have its docker compose file in its own directory (if you go that way like described in the wiki).
those are 2 different docker images
My mosquitto file is in:
root@homebridge:~/mosquitto-docker-compose/config#
remko2000
Posts: 165
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Re: Z-wave JS UI failed to open serial port

Post by remko2000 »

capitalT wrote: Thursday 04 January 2024 22:20 Are you sure your device ID is correct and it is not: usb-0658_0200-if00 (without the port0 part)
My docker-compose.yml file in root@homebridge:~/mosquitto-docker-compose# looks like this:
Is this a typo? Or do you zwave-js and mosquitto in the same directory?
the path to mosquitto is:
root@homebridge:~# mosquitto-docker-compose

(in this map: bin docker-compose.override.yml.dist Dockerfile log README.md
config docker-compose.yaml LICENSE Makefile)

the path to zwave js ui is:
root@homebridge:/opt/zwavejs-ui#

(in this map: bin docker-compose.yaml Makefile
config Dockerfile README.md
docker-compose.override.yml LICENSE
docker-compose.override.yml.dist log)
tjabas
Posts: 564
Joined: Sunday 11 December 2016 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Z-wave JS UI failed to open serial port

Post by tjabas »

borrow this topic, where do i put the security key from the open zwave configuration?
remko2000
Posts: 165
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Re: Z-wave JS UI failed to open serial port

Post by remko2000 »

after many trial and error I tried again:
' docker compose up -d'
after recomposing zwave js ui, I see zwave devices in my control panel:
Image

I think this is ok.
However, the mqt error in domoticz remains:
Error: MQTT: Failed to start, return code: 14/Connection refused (Check IP/Port)

what could I have done wrong when installing mqqt and how could I fix it?
Attachments
Schermafbeelding 2024-01-05 om 15.43.47.png
Schermafbeelding 2024-01-05 om 15.43.47.png (324.51 KiB) Viewed 29845 times
User avatar
boum
Posts: 130
Joined: Friday 18 January 2019 11:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: France
Contact:

Re: Z-wave JS UI failed to open serial port

Post by boum »

In your mosquitto directory, the docker compose file should be completely different and should look like
https://github.com/vvatelot/mosquitto-d ... mpose.yaml
remko2000
Posts: 165
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Re: Z-wave JS UI failed to open serial port

Post by remko2000 »

The MQTT behavior I experience:
when I enter in my terminal:
cd /opt/mosquitto
make setup project
docker compose up -d

and then:
netstat -na | group 1883

then I get back:
tcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN
tcp 0 0 172.18.0.1:48468 172.18.0.2:1883 ESTABLISHED
tcp6 0 0 :::1883 :::* LISTEN
tcp6 0 0 ::1:1883 ::1:36644 ESTABLISHED
tcp6 0 0 ::1:36644 ::1:1883 ESTABLISHED

and the error disappears in my domoticz log (however, I don't see any zwave device appearing under devices yet).

After restarting my raspberry, the mqqt communication disappears and I have to repeat the above. I don't think that's the intention. I don't read anything about this in the wiki. Did I do something wrong?
User avatar
gizmocuz
Posts: 2352
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Z-wave JS UI failed to open serial port

Post by gizmocuz »

No that's not correct. Please follow the (updated) domoticz wiki about migrating to zwavejs.
There the steps are explained correctly how to install mosquitto
After you install it, test with MQTT Explorer to see if you can connect to it
You should enter the IP address of the machine, not localhost !!!
also not 127.0.0.1, but the IP address the of machine (like 192.168.30.40) or the IP address of the mosquitto docker (each docker gets a unique IP address), but you should use the machine's IP address
Quality outlives Quantity!
remko2000
Posts: 165
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Re: Z-wave JS UI failed to open serial port

Post by remko2000 »

thx.

step by step........
In domoticz I do use localhost with the mqqt auto discovery hardware.

In zwave-JS UI I have now set the IP of my machine instead of localhost. I am now indeed receiving zwave hardware devices.

But again this only works if I follow these steps from the domoticz wiki:
cd /opt/mosquitto
make setup project
docker compose up -d

After a restart my raspberry I get the same error again:
error: MQTT: Failed to start, return code: 14/Connection refused (Check IP/Port)

After a restart the system loses my mqqt install settings and and my mqtt communication seems to be dropping.

I don't understand any of this. How is this possible?
Lebo2d9
Posts: 139
Joined: Tuesday 06 September 2016 20:39
Target OS: Raspberry Pi / ODroid
Domoticz version: L stab
Location: Belgium
Contact:

Re: Z-wave JS UI failed to open serial port

Post by Lebo2d9 »

Hi,

A friend of me had the same problem. 1st I found that the USB port of the dongle wasn't correctly mapped in the yaml.

After the correction all the Zwave devices where visible in the Z-Wave JS UI controll panel.
But I had still the connection error on the MQTT.
I removed the MQTT docker and installed Mosquito without docker but had still the same problem.
MQTT was working (tested with mosquitto_sub en mosquitto_pub)

I saw that mosquito was listening on 127.0.0.1:1883
I adapted the mosquitto.conf (added listener 1883 and allow_anonymous true)
After the restart of mosquito, mosquito was listening on *:1883 and I didn't had any connecetion errors any more
Spoiler: show
2024-01-05 23:29:53.623 Error: Zwave: Failed to start, return code: 14/Connection refused (Check IP/Port)
2024-01-05 23:30:23.647 Status: Zwave: Connecting to 192.168.20.99:1883
2024-01-05 23:30:23.647 Error: Zwave: Failed to start, return code: 14/Connection refused (Check IP/Port)
2024-01-05 23:30:53.674 Status: Zwave: Connecting to 192.168.20.99:1883
2024-01-05 23:30:53.675 Error: Zwave: Failed to start, return code: 14/Connection refused (Check IP/Port)
2024-01-05 23:31:23.702 Status: Zwave: Connecting to 192.168.20.99:1883
2024-01-05 23:31:23.702 Error: Zwave: Failed to start, return code: 14/Connection refused (Check IP/Port)
2024-01-05 23:31:53.728 Status: Zwave: Connecting to 192.168.20.99:1883
2024-01-05 23:31:53.729 Error: Zwave: Failed to start, return code: 14/Connection refused (Check IP/Port)
2024-01-05 23:32:23.755 Status: Zwave: Connecting to 192.168.20.99:1883
2024-01-05 23:32:23.756 Error: Zwave: Failed to start, return code: 14/Connection refused (Check IP/Port)
2024-01-05 23:32:53.781 Status: Zwave: Connecting to 192.168.20.99:1883
2024-01-05 23:32:53.982 Status: Zwave: connected to: 192.168.20.99:1883
2024-01-05 23:33:46.267 Status: [web:8080] Incoming connection from: 192.168.20.182
2024-01-05 23:35:49.012 Active notification Subsystems: browser (1/13)
2024-01-05 23:36:13.067 Status: Zwave: Worker stopped...
2024-01-05 23:36:19.123 Status: Zwave: Connecting to 192.168.20.99:1883
2024-01-05 23:36:19.324 Status: Zwave: connected to: 192.168.20.99:1883
2024-01-05 23:46:36.034 Status: Zwave: Worker stopped...
2024-01-05 23:46:37.046 Status: Zwave: Connecting to 192.168.20.99:1883
2024-01-05 23:46:37.246 Status: Zwave: connected to: 192.168.20.99:1883
2024-01-05 23:48:36.422 Status: Zwave: Worker stopped...
2024-01-05 23:48:42.076 Status: Zwave: Connecting to 192.168.20.99:1883
2024-01-05 23:48:42.277 Status: Zwave: connected to: 192.168.20.99:1883
2024-01-06 00:00:00.564 Sunrise: 08:46:00 SunSet: 16:53:00
2024-01-06 00:00:00.564 Day length: 08:06:00 Sun at south: 12:50:00
2024-01-06 00:00:00.564 Civil twilight start: 08:08:00 Civil twilight end: 17:32:00
2024-01-06 00:00:00.564 Nautical twilight start: 07:25:00 Nautical twilight end: 18:14:00
2024-01-06 00:00:00.564 Astronomical twilight start: 06:45:00 Astronomical twilight end: 18:54:00
2024-01-06 00:00:00.564 Status: EventSystem: reset all events...
2024-01-06 00:00:00.750 Status: Starting automatic database backup procedure...
2024-01-06 00:00:11.814 Status: Ending automatic database backup procedure...
2024-01-06 00:03:24.894 Status: [web:8080] Incoming connection from: 192.168.20.182
I still need to test if all devices are working but this is something for tommorrow

Kind Regards
Koen
Domoicz on RPI3 (wifi) directly connected 3x ds18b20 for CV temp, Evohome (9 zone), 1 remote 220V switch based on ESP-12. RFXtrx433E, 16x AMST-606, 5 Somfy RTS motors
Domoticz on RPI3(wifi) as slave for terraruim control
More to come
Xrim
Posts: 5
Joined: Wednesday 19 September 2018 22:27
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Z-wave JS UI failed to open serial port

Post by Xrim »

Had the same trouble with Failed to start, return code: 14/Connection refused (Check IP/Port)

I redid everything several times with no luck,BUT!!!

After running

sudo su -
git clone https://github. com/vvatelot/mosquitto-docker-compose /opt/mosquitto
cd /opt/mosquitto
make setup-project
docker compose up -d

I wrote exit and pressed enter, suddenly the installation text appeared and I no longer get the node error in Domoticz.
But I get no new info in the setup and if I reboot my raspberry the problem is back.
User avatar
gizmocuz
Posts: 2352
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Z-wave JS UI failed to open serial port

Post by gizmocuz »

You have to type each command line-by-line, do not copy the whole text block
go to the folder where you tried to install mosquitto (/opt/mosquitto) and issue

docker compose down

next remove this folder

next start again to enter all commands step by step

After you issued the 'docker compose up -d' command your mosquitto MQTT broker should be up and running.

First thing to do, test this with 'MQTT Explorer', you should be able to connect to your IP Address on port 1883 (IP address is not localhost or 127.0.0.1 but the IP address of the machine you run this docker on)
When this is working and you can connect, continue to the next step

@Lebo2d9

Sure the docker is listening to 127.0.0.1 as well on the machine you installed it, it also listens on 0.0.0.0:1883
Remember that each docker has it's own private IP address, it does not have the IP address of the machine or has a IP address in the range of your local subnet.
In the yaml file you specify which ports you want to make available on the host system (for example 1883)
So you can now imagine that if you want to connect from one docker to a port from another docker, that you cannot use 127.0.0.1, and you have to use the IP address of the machine
Quality outlives Quantity!
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest