When I call System.enterSafeMode(); from firmware, the P2 does reboot to safe mode, but if I query with the Cloud API, it's status field still says "normal" where I believe it should say "safe_mode". Similarly, if I go to the devices page in Particle console, everything looks healthy except that there are no functions/variables available (correctly).
Is this expected? Do I need to re-trigger a handshake or something for the safe mode to be acknowledged in the Cloud API?
It probably should not work that way, but I can see how it possibly could happen. What version of Device OS are you using?
It appears that the status field in the device info never switches to safe_mode. It also does not change if you use the buttons to switch to safe mode, and I tested it with both an Argon and Photon 2, so I don't believe it's specific to the device or programmatic switching.
This is testing programatic switching on the Photon 2 and the events above the red line are the correct events to be sent when in safe mode, so it just appears to be the status field that does not change.
Ok, thanks for testing that. For my purposes I can also use the fact that the variables/functions lists are empty as indicator for safe mode.
Or I can subscribe to device/last_reset stream and keep that as a flag.
Appreciate the help!