Openzwave and USB stick (un)plugged in real time

Is there any way to make openzwave (node-red-contrib-openzwave) go back to life when you unplug the USB stick and plug it again without having to restart nodered?

I don't know if it has to do with me having multiple Z-Wave nodes at the same time using the same controller, but even though I know it's moved from /dev/ttyACM0 to /dev/ttyACM1 (probably because the openzwave library kept the port in use) and I reconfigure the node to use the new device, it still doesn't work.

I've also tried to go a bit further after that by unplugging it and plugging it again to see if the library had already released /dev/ttyACM0 but it hadn't and I keep getting /dev/ttyACM1 again. No need to say that it doesn't work this way.

Regards

Why do you need to unplug/plug the USB stick?

Let's say I have a client without enough experience on using the command line (ssh and this stuff) and I want him to identify the set of nodeids of the devices from a network. Considering I can't go there (covid..), the idea is to prepare an image with a web server that shows the contents of /dev and /home/pi/.node-red (in addition to the Node-Red interface, of course), allowing him to do something like this:

  • Start from scratch will the list of paired nodes empty (brand new stick).
  • Identify the serial port assigned to the stick (normally /dev/ttyACM0).
  • Configure the Z-Wave IN node in Node-Red.
  • One by one, unplug the stick, pair a device, plug the stick again and force a writeConfig operation in order to identify which nodeid has been assigned to this device (look at the xml cache file that has just been updated).

With this I will send him a flow that will load a json config file with the filter of which set of [nodeid,cmdclass,instance,cmdidx] will be sent to the platform, among other things.

If I have to, I'll send him a small guide on how connecting with putty and stop/start the Node-Red service, but I'd like to avoid that.

Regards

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.