Electron enters safe mode after dfu but not with ota


#1

Summary: using a problem free example blink-an-led1.ino for test, I have the following problem. WEB IDE it works great if I use OTA. But flashing the same binary file --serial , the cyan led blinks rapidly as it should then goes to safe mode w/o ever breathing (that I can see) The same thing happens if I use the DFU batch file in DEV. I powered everything on and off including my WIN10 system. The extensive handshaking in the DFU process would seem to rule out driver, power, cable problems. The electron has it LiPo battery connected and I checked voltages to rule out low power flakiness. Up till this sudden roadblock I was flashing --serial 10x a day w/o a hitch. I just start using the DFU batch file but did it at least 10x w/o problems. The device manager shows electron COM3 so everything looks good there. Yes, I have the electron blinking yellow for the batch file DFU For the moment, take my word that the DFU batch file says success several time ending with “file downloaded successfully” (if someone can tell me how to put a screenshot ( .png) here I’ll update this post with cmnd screen DFU text)


UPDATE (4/23 1021)*****************************************************************************
Firmware.bin from the bat file compile is 4,520 bytes - results in safe mode from blinking yellow start
Firmware.bin from cloud icon in web ide is 3,992 bytes - runs fine breathing cyan from listen mode start
As a stab in the dark I tried --serial flash with the batch file generated firmware.bin with no improvement.


#2

It sounds like it’s re-connecting to the Cloud, then does it Breathe Magenta? Breathing Magenta is Safe Mode. The IDE may also have a purple dot next to the device name indicating it connected in Safe Mode.

This usually happens if you have flashed a higher firmware version User Application to your Electron, than the system firmware version. I.e., User app 0.5.0 when your system version is 0.4.8-rc.6

Please download the Device Updater for Windows or Mac OSX and update your system firmware to 0.5.0 and see if that clears up your Safe Mode issue. You should then be able to OTA or flash via --serial or --usb locally 0.5.0 apps without having any Safe Mode issues.


#3

#4

Thanks for help. I can see I was ambiguous “w/o ever breathing”. I meant the cyan. I agree on version problem. Why else would same sketch run or not run depending on compile path (WEB or DEV using – listen mode in WEB and DFU mode for the batch file). I need some clarification on hazy areas. I assumed the DFU path meant complete firmware flash, that I,. my sketch and the OS? Whereas the --serial flash was my sketch only. I also assume that the batch file (now added to my original post) would ensure all versions were in sync. if not please steer me straight.
I updated (4/23 1021) the original post with some additional clues.


#5

Done. Thanks. The output is from the batch file you helped me with. BDub suspects a version incompatibility causing the immediate safemode after DFU. Am I misusing the batch file somehow? Did I miss some step to ensure version compatibility? It worked w/o no problem about 10x then hit a brickwall. I believe that there has been talk about a version update (isn’t there always?). It’s not my software because it fails with trivial example blink-an-led1.ino.


#6

I’d agree with @BDub.
Try

npm update -g particle-cli
particle update

And then try to flash it again.

Since 0.5.0 has gone public CLI will build against that and if you haven’t updated your device before flashing via CLI the incompatibility between the higher version app firmware in respect to the older system firmware will cause Safe Mode.


#7

Thanks. Got a couple of warnings shown below. Is that a problem. How was I supposed to know to update? Just when bad things start happening? Do it everyday? Did I miss a notification?


#8

Hi @BDub1. I too had problems arise during yesterday (23 April) similar to @Erhughes1944 when code that previously compiled (via Dev Build) flashed to my electron via

particle flash --serial electron_firmware_123456789ABCD.bin

brought the electron to safe mode (breathing magenta). I couldnt get past the problem. Now this morning on reading your reply to @Erhughes1944 I ran the Device Updater. Immediately the electron (still breathing magenta) came to life and breathed cyan and code started executing. All good.

The only reason for explaining all this, is it seems like a strange way for this (update) to be announced. Ie devices to end up in safe mode because of some code incompatibility. What is the official channel for updates to be announced?


#9

Glad your up and running. I’m 72; without your post I’d think I was senile.


#10

Yes, obviously :wink:

This very forum and that post contains all the info
Particle Device OS Updates Thread

Another way to know if there is a new system firmware is to look in the target drawer in Particle Build (aka Web IDE)

If you select as specific target version (rather than Default (x.y.z)) then you will see if there is a discrepancy between your current version and the most recent (Default (x.y.z))


#11

@ScruffR Thanks for the advice. Based on your advice I’ve set a “Watch” status on that forum thread (Particle Firmware Update Thread). Hopefully wont miss update advice in future.