zwave-js / zwave-js-ui

Full featured Z-Wave Control Panel UI and MQTT gateway. Built using Nodejs, and Vue/Vuetify
https://zwave-js.github.io/zwave-js-ui
MIT License
942 stars 202 forks source link

Cannot get RaZberry rev. 2 GPIO RazBerry hat working / zwave-js-ui dont detect serial port #3192

Closed AlfaBravoX closed 7 months ago

AlfaBravoX commented 1 year ago

Checklist

Deploy method

Snap

Z-Wave JS UI version

8.19.0.487524b

ZwaveJS version

11.0.0

Describe the bug

On raspberry pi 2 board version a01041 with 32 bit Rasbian Stretch I am trying to make RaZberry hat working with no success ending by this message:

Driver: Failed to open the serial port: Error: Operation not permitted, cannot open /dev/ttyAMA0 (ZW0100)
zwave-js-ui: 8.19.0.487524b
zwave-js: 11.0.0
zwave-js-ui.help
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
Missing plug: «serial-port»
zwave-js-ui - v8.19.0

IMPORTANT! The DAEMON/SERVICE is disabled by default after installation.
You have to manually 'daemonize' it with executing the command

$ zwave-js-ui.enable

Set your configuration as descrived below

Server configuration values: {
    "server": {
        "force-disable-ssl": false,
        "host": "0.0.0.0",
        "port": 8091,
        "ssl": false
    }
}

- server.ssl: Use secure communication
- server.host: IP address to bind to, e.g 127.0.0.1
- server.port: Port to reach the web interface

Session configuration values: {
    "session": {
        "cookie-secure": "",
        "secret": "83702340-2ca5-11ee-removed-83d0c18a2d51"
    }
}

- session.secret: Used as secret for session. If not provided a default one is used.
- session.cookie-secure: Set the cookie secure option. See: https://github.com/expressjs/session#cookiesecure

Session configuration values: {
    "mqtt": {
        "name": ""
    }
}

- mqtt.name: The name used as client name when connecting to the mqtt server.

Set options with:         $ snap set zwave-js-ui param=key
For example:              $ snap set zwave-js-ui server.host=0.0.0.0

Other settings can be set in the UI after start.

If you have turned OFF «log to file», follow the log(s) with
  $ sudo snap logs zwave-js-ui -f

OR if you have turned ON «log to file», tail the logs with
  $ tail -f /var/snap/zwave-js-ui/198/*.log

Other commands
Disable the daemon:       $ zwave-js-ui.disable
Restart the daemon:       $ zwave-js-ui.restart

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 zwave-js-ui with:
  $ sudo snap connect zwave-js-ui:serial-port <slot name>

It looks snap in unable to see /dev/ttyAMA0 device as it is not listed

sudo snap interface serial-port 
name:    serial-port
summary: allows accessing a specific serial port
plugs:
  - zwave-js-ui

I also modified /boot/config.txt

force_turbo=1
enable_uart=1

My concern is if this is snap or zwave-js-ui issue.

Please advise

To Reproduce

install snap and zwave-js-ui on RPI 2 board, run zwave-js-ui on port 8091 and try to connect to RaZberry shield

Expected behavior

RPI will be able to access RaZberry shield on ttyAMA0 device

Additional context

No response

jmgiaever commented 1 year ago

You have to connect with the pi:bt-serial

AlfaBravoX commented 1 year ago

thanks

adding:

sudo snap connect zwave-js-ui:serial-port pi:bt-serial

results with:

error: snap "pi" is not installed

can you advise further?

jmgiaever commented 1 year ago

Can you check

sudo snap connections pi

and give me the output.

jmgiaever commented 1 year ago

You're running this on a raspberry pi, yes?

AlfaBravoX commented 1 year ago

You're running this on a raspberry pi, yes?

yes, on raspberry pi 2 board version a01041 & BCM2835 with 32 bit Rasbian Stretch, tried also Buster with same result. No BT on board. I tried 4 different RPI boards to exclude HW error.

AlfaBravoX commented 1 year ago

Can you check

sudo snap connections pi

and give me the output.

sudo snap connections
Interface         Plug                          Slot                   Notes
hardware-observe  zwave-js-ui:hardware-observe  :hardware-observe      -
network           zwave-js-ui:network           :network               -
network-bind      zwave-js-ui:network-bind      :network-bind          -
raw-usb           zwave-js-ui:raw-usb           :raw-usb               -
serial-port       zwave-js-ui:serial-port       :usb-serialcontroller  manual
sudo snap connections pi
error: snap "pi" not found
jmgiaever commented 1 year ago

Ah, I checked now. Seems like this gadget snap is only available for the Ubuntu Core installs. I guess you're running a classic system, such as Ubuntu Server, Raspbian etc?

I'll have to check if there are alternatives for the classic systems.

AlfaBravoX commented 1 year ago

Raspbian

Yes, I run standard Raspbian from official repositories

jmgiaever commented 1 year ago

Ok, it actually seems like I've been digging into this before: https://forum.snapcraft.io/t/acessing-serial-device-from-a-snap-package/29052

If you're just using this device for ZUI, you should consider installing Ubuntu Core to it. If it's available for RPi 2.

Yes there is: https://ubuntu.com/download/raspberry-pi (scroll down to Download Ubuntu Core).

AlfaBravoX commented 1 year ago

Thanks a lot for digging. I prefer to use existing machine and just extend it by ZUI, but as I was afraid it looks I need another board just dedicated as ZUI node which I wanted to avoid. I will try one more attempt with Docker install instructions from here https://zwave-js.github.io/zwave-js-ui/#/getting-started/docker and if it still fails, I will probably need to go with Ubuntu Core and dedicated ZUI RPI board.

kpine commented 1 year ago

Another approach would be to use ser2net on the Pi, and connect remotely with ZUI using a TCP serial port, if you have another host available that is capable of running ZUI natively or with docker.

Euton2020 commented 1 year ago

Hello, do you think that an evolution of zwave-js-ui is possible to make it compatible with a RazBerry card ? Cordially

AlfaBravoX commented 1 year ago

I would like to stay with raspbian, so unfortunately i had to give up zw js ui and stay with z-way me that works out of the box with raspbian.

On Sat, 5 Aug 2023, 11:39 Euton2020, @.***> wrote:

Hello, do you think that an evolution of zwave-js-ui is possible to make it compatible with a Razberry card ? Cordially

— Reply to this email directly, view it on GitHub https://github.com/zwave-js/zwave-js-ui/issues/3192#issuecomment-1666455247, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACVB2L54POFVKYRHSVP42TDXTYIDVANCNFSM6AAAAAA22UHIB4 . You are receiving this because you authored the thread.Message ID: @.***>

kpine commented 1 year ago

Hello, do you think that an evolution of zwave-js-ui is possible to make it compatible with a RazBerry card ? Cordially

Z-Wave JS UI works fine with Razberry controllers. It is the RPi 2 that is the issue here.

Euton2020 commented 1 year ago

hello Kpine, ah ! thank you for this precision, I did not know exactly where the problem came from. So I renew my request: do you think of making zwave-js-ui compatible with an Rpi 2? thank you in advance for your answers and your wonderful work

AlfaBravoX commented 1 year ago

Not exactly. I reported the issue like that:

Z-Wave JS UI does not work with Razberry(used v2) controllers with raspbian. I used RPI 3, RPI2 and Jessie, Buster, Bullseye and SNAP. Non of combination worked. Serial port was not detected by SNAP.

kpine commented 1 year ago

Not exactly. I reported the issue like that:

Z-Wave JS UI does not work with Razberry(used v2) controllers with raspbian. I used RPI 3, RPI2 and Jessie, Buster, Bullseye and SNAP. Non of combination worked. Serial port was not detected by SNAP.

If you are continuing to attempt to use Snap, wasn't that answer already provided? Sounds like you need to use Ubuntu Core to install the specific "gadget snap" required to access the serial device. This is not a fault with Z-Wave JS UI but with Snap.

Snap is not the only way to install ZUI, most common methods are Docker and the downloadable binary. Those should work with Razberry. Did you try those? I do not see in this issue where you have provided any details like that. Your issue description says "On raspberry pi 2 board version a01041 with 32 bit Rasbian Stretch" and you only talk about Snap. Can you provide details about which other software you tried, Docker or binary?

If you don't want to go the Ubuntu Core route, you should run an OS based on Debian Bullseye (11) or later, for best compatibility. The latest Raspberry PI OS is based on Bullseye (11). Stretch is just too old, and Buster has issues with Docker.

For RPi2 + Debian 11 you should be able to run the armv7 downloadable binary, it's a 32-bit armhf binary. The Docker images should work at least, as there are armv7 images. Have you tried these?

AlfaBravoX commented 1 year ago

I did not even say single word that solution was not provided. People above were re-asking what was the problem, so I just did recap. I am not going with Ubuntu core for my reasons. Maybe I will try later docker path.

From my end, issue can be closed.

Euton2020 commented 1 year ago

hello again, for my case, do you think it works with a Rpi 2 Debian 11( already installed and working) and a Razbarry v1 card under Docker? thanks in advance

kpine commented 1 year ago

I did not even say single word that solution was not provided.

Sorry, I misunderstood. I was mostly responding to the comment "Z-Wave JS UI does not work with Razberry(used v2) controllers with raspbian.", I guess you meant "with Snap". My mistake.

hello again, for my case, do you think it works with a Rpi 2 Debian 11( already installed and working) and a Razbarry v1 card under Docker? thanks in advance

I think it should, but I may be wrong. I would expect it to work with either Docker or the binary provided by zwave-js-ui-v8.22.0-linux-armv7.zip. Why don't you give it a try and let us know if there are any issues. 😉

AlfaBravoX commented 1 year ago

hello again, for my case, do you think it works with a Rpi 2 Debian 11( already installed and working) and a Razbarry v1 card under Docker? thanks in advance

I tried that with Rpi 2 Debian 11 and docker install, it does not work. Serial port not accesible. I Tried that the same on Rpi 3 and it works w/o any issues. I am giving up with Rpi2 and moving to Rpi 3. According to Razberry support, it should work, but it does not. I tried few Rpi 2 boards and Razberry did not work on any of them. Not sure where the problem is.

AlfaBravoX commented 1 year ago

Sorry, I misunderstood. I was mostly responding to the comment "Z-Wave JS UI does not work with Razberry(used v2) controllers with raspbian.", I guess you meant "with Snap". My mistake.

No worries at all :-) Yeap, just meant snap. No issues with docker with Rpi3 and Razberry hat.

Euton2020 commented 1 year ago

Hello,I just installed Docker and Docker-compose then Zwave-js-ui on Docker with my Rpi 2 and my Razberry. that doesn't work either. The result is the same as with SNAP. So could you make a modification to make it work? thanks in advance

kpine commented 1 year ago

Logs?

Euton2020 commented 1 year ago

sorry I didn't wait long enough. now i have nodes on the main page

robertsLando commented 1 year ago

Snap issue, seems everything is ok with other builds

github-actions[bot] commented 10 months ago

This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label

github-actions[bot] commented 7 months ago

This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label

robertsLando commented 7 months ago

@jmgiaever Do you know if this is still an issue?

jmgiaever commented 7 months ago

On classic systems, most likely yes. But that's nothing we do with it.