ncd-io / ncd-red-wireless

Provides access to all of the sensors available from the NCD Wireless Enterprise Line of products. (https://ncd.io/wireless-enterprise-line/)
https://ncd.io
1 stars 3 forks source link

Network ID Unset after unusual procedure #8

Open io-Jacob opened 4 years ago

io-Jacob commented 4 years ago

If the gateway node is put into configuration mode and a sensor is configured using Node-Red and then node-red is stopped entirely before going back into Listening/Run mode and then node-red is restarted and the gateway node is put back into Listening/Run mode then the network ID becomes 0.

Toggling the gateway node back to config and then back to Listening/Run mode sets the network ID correctly.

zaphod-42 commented 3 years ago

I don't have the hardware to test this with right now, but I believe this would be solved by abstracting the functionality of the express callback for the config button into its own function, and optionally calling it based on the current node status in a listener for the close event in the gateway node. Adding this note so I can fix it when I have time and hardware.