I have a Xenon with firmware 1.3.0-rc.1. The firmware has a loop() function with a check of mesh connectivity evry 60 seconds, and a single sub (GetSensorReadings). This sub gets readings from a serial sensor and returns if the sensor does not detect the presence of something in front of it.
void loop()
{
..... code to check mesh is connected
GetSensorReadings();
delay(1);
}
For an unknown reason, the program is crashing every 5 minutes or so (sometimes longer) with what appears to be an “Assertion Error” - 10 flashes. I am not really sure about the exact number of flashes because they happen so fast!
I thought initially there was an processing error within that sub but upon watching the Xenon, the crash is occurring even though there is nothing in front of the sensor. When the sensor does not detect something, the sub returns.
I have looked at the code for hours and could not find anything that should cause a heap error.
I would appreciate the community’s insight as to how one would debug such an error?