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 -
Echo request is not set
Troubleshooting • 12 Aug 2024, 15:36 • kamilb85 3 Sept 2024, 08:58 -
Raspberry Pi 5: invalid GPIO 9
Troubleshooting • 27 Aug 2024, 13:20 • igo 27 Aug 2024, 13:20 -
Compiling Sensor code using BME280 and ESP8266
Troubleshooting • 26 Feb 2025, 00:32 • dpcons 26 Feb 2025, 06:22 -
Getting system time from the controller
Troubleshooting • 27 Feb 2025, 01:39 • dpcons 27 days ago -
Ghost Child
Troubleshooting • 14 days ago • FcNanoLed 11 days ago