How avoid endless loop when radio init fails?
-
I would like to build a actuator/sensor node with mySensors 2.0 which have an autonoumous feature. This means when the connection to the gateway fails during operation as well as on booting the node should go on working in a stand-alone mode until connection comes back. Currently I am trying to achive that the node boots without radio connection but it hangs somewehre in an endless loop trying to connect. What I would like to have is a quick connection trial at boot time and if this fails going quickly to he loop() function.
-
Hello,
It seems to me that this function is only in the developed branch with the parameter
MY_TRANSPORT_WAIT_READY_MS
More information at https://github.com/mysensors/MySensors/search?utf8=✓&q=MY_TRANSPORT_WAIT_READY_MS&type=Code
-
and in this thread https://forum.mysensors.org/topic/5094/option-non-blocking-registration-at-gateway/
-
@tonnerre33 @Heizelmann This is a fairly new feature in the development branch (upcoming 2.1.0 release). Essentially, you can set a timeout (in MS) after which the node will enter the main loop in case of unsuccessful transport initialisation. Set to 0 if the node should establish the GW uplink before entering loop().
For example, set
#define MY_TRANSPORT_WAIT_READY_MS 15000
for a 15s timeout.
-
@mfalkvidd Thanks for the link to this thread. I didn't found this before. It is exactly my problem, so we can close this thread and continue discussing in thisone.
@tekka Thank you for this outlook.
For me this feature is essential and I am wondering if it is not implemented from the beginning. So I hope that it will be published soon.
Anyway I like MySensors and the great developer community. Many thanks to all.
Suggested Topics
-
Day 1 - Status report
Announcements • 23 Mar 2014, 22:45 • hek 24 Mar 2014, 20:12 -
Compiling Sensor code using BME280 and ESP8266
Troubleshooting • 13 days ago • dpcons 13 days ago -
Raspberry Pi 5: invalid GPIO 9
Troubleshooting • 27 Aug 2024, 13:20 • igo 27 Aug 2024, 13:20 -
Can not compile MySensors on esp8266
Troubleshooting • 24 Aug 2024, 15:35 • TheoL 29 Aug 2024, 20:47 -
Arduino nano and Uno in same My sensors network with NRF24L01+
Troubleshooting • 26 Jul 2024, 10:30 • DIY89 27 Aug 2024, 09:59 -
Some sensors permanently fail after one/two years
Troubleshooting • 25 Jul 2024, 17:17 • Kokosnoot 25 Jul 2024, 17:17