Boron - Seemingly random device reset - How to best capture the reason

I’ve had several events in the last few days and occasionally get a “burst of even 5-10 events” from the same device every few minutes but eventually it recovers on its own. In almost all of these cases the devices all three reasons (System reset, ab1805, and out of memory) all report a value of “0”. So it’s unclear what is actually causing the reset or pseudo reset that causes the setup function to be called again. I am in manual mode so it shouldn’t run setup even on a cloud disconnect.

However, after seeing this Application note:https://support.particle.io/hc/en-us/articles/360044776653-AN005-Threading-Explainer I have a feeling this might be due to having threading enabled since the issue seems to be related to handling of cloud events right after a publish event. After reading this AN I clearly have more to learn about threading before I should use it and sounds like I’m best to not use threading enabled.

@ScruffR - you referenced this application note in a different Discussion . Do you think it could pertain to the issue I am seeing as well? Or maybe it could be accomplished with threading enabled but my code isn’t “clean” enough to do it correctly? This is what really caught my attention “ Finally, it’s really a pain to debug unsafe thread code. It’s unpredictable and timing-sensitive. When you look for the bug it can stop happening.”

In any case, I think I’ll not use threading enabled make sure I have particle.process() where appropriate and then deploy it to the 8 devices and see what happens. I’ll report back in a few days after testing.

1 Like