Electron occasionally flashs red - SOS

Is there away to capture that this has happened? I have an electron on the asset tracker v2 board which is sending its data over TCP to my server. Its not communicating to the particle cloud at all.

It is not always accessible and would like to know if it has restarted due to a fault.

Is there away of capturing why the SOS was triggered - other than trying to reproduce it…

I have looked at the logging : https://docs.particle.io/reference/device-os/firmware/electron/#logging but i don’t believe this will capture the error.


This may help

thanks - that’s great.

In my normal coding of .Net - there’s try / catch to try to wrap around code to allow me log the error while developing. Is there anything similar i can use on the particle devices.

Ideally i want to remove the occasional error - but i would also like to be able to capture as much detail as possible when i enable logging on a device.

In the early days structured exception handling was considered, but the benefit did just not justify the memory impact it would have caused.

If you had that on these devices, the tiny programs you’d be able to write wouldn’t need it anyway :wink:

thanks - just curious…

The knowing it has restarted is fantastic - at least i can see if its doing it too many times and then work backwards to identify why.

I have a SPI memory chip on it so i can log messages to that as i go through my code i can record what step it got to.and if it has restarted due to an error i can submit that to my server :slight_smile:

You can also use Backup RAM to keep track as long the device is not depowered.
This way you can update checkpoints and “stack traces” very rapidly without having to care about rewrite cycles or performance impact.