-
My ESP32 lags after an hour of sending sensor data every minute, it stops then randomly sends out like 40 requests in the space of 1 minute with -2147483547 as the sensor readings I also used one of the examples shared and tweaked some settings to make it work for me. It basically takes a reading of an ultrasonic sensor and then sends the data to Firebase. Everytime I turn it on, everything works fine for 1 hour, before eventually stopping and then suddenly sending out a bunch of corrupted sensor readings. I suspect its memory issues that are causing it, where after 1 hour it runs out of memory. My other theory is that since it's an Async task, it just keeps sending new requests even without getting a response. But overall I am quite stumped on this. I am quite stumped on this. Codeis below but the main bulk of it is in the loop. At the bottom I will also share what I received in the debug log right before the crash.
Here is the debug log for the re-authentication
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Remove the delay from the loop and anywhere in your code, even you use sync function. |
Beta Was this translation helpful? Give feedback.
-
Didn't you know delay will block everything? |
Beta Was this translation helpful? Give feedback.
-
This is the bad idea.
I never recommend and do not advice something like this in almost 6 years of Firebase libraries develelopment. |
Beta Was this translation helpful? Give feedback.
-
https://docs.arduino.cc/built-in-examples/digital/BlinkWithoutDelay/ |
Beta Was this translation helpful? Give feedback.
Remove the delay from the loop and anywhere in your code, even you use sync function.