I have a strange problem while sending data to a node (RF24 module + Arduino Nano) which is offline. When I try to send data to this node, Core gets disconnected from cloud.
I observed the following LED sequence when this is happening.
β> Flasing Cyan
β> Flashing RED
β> Breathing Cyan
β> Flashing Green
β> Flashing Cyan
β> Breathing Cyan
I am also using the Blynk interface to initiate the data transfer over RF24 module. I also tried by totally disconnecting the Core from Spark cloud, I still have problem of disconnection.
RF radio is initialized with radio (15, 15) --> 4 ms delay and 15 retries --> 60 ms run time.
Also some run time from Blynk interface.
So is the core resetting ? If so, is it because of some Watchdog timer ?
I request the community to support me solve this issue with your experience.
might pose a problem if m_rfNetwork.available() remains true or any of the functions inside the loop block for 10+sec.
Try adding Particle.process() inside the loop and add some Serial.print() statements to see where your code fails
e.g. before and after above loop to see if you get stuck in there, and in there to see where it is hanging.
@ScruffR Thank you. Definetly, I will add the Serial.Print statements to debug further.
Between, after thoroughly observing the RED led flash pattern, I am not really sure if it is SOS. I have uploaded the video temporarily in youtube (https://youtu.be/aHPqRP6Y7Rw). When you get time, can you please have a look at this video. For me it seems like one slow blink between two SOSs.
@ScruffR Thanks for confirming.
I had looked through other post regarding the reasons for Hard Fault. Most reasons are memory violation. I got a bit idea. I will debug through my code and see if I can find any thing. I will update my progress too β¦
Other than Memory violation, are there any other reasons that could cause this error ?
Iβve not really come across other reasons, but mem violations sometimes come in various disguises, so it might be one but you might not recognize it as such
I do not know the exact reason but somehow I solved the problem and I donβt see the issue any more.
When a particular node is offline, RFNetwork layer that I am using tries couple of times to send the message over RF network. Between every re-try there is a small delay. All these trails is done in a thread blocking call. So every send request to offline node took more than 1.5 sec (loop is blocking until this time). So there there are fast and repeated requests from Blynk, I guess this time is accumulation and some where the system is crashing.
I fixed the problem by modifying the network layer, reducing the delay time and number of re-tries. With the I reduced the blocking time from 1.5 sec to 300 ms and so far looks fine. This issue is not seen any more from past 3 months.