[SOLVED]Photon keeps going into safe mode after odd behavior with web IDE

I tried flashing my code from Particle Build, and now my device keeps booting into safe mode, breathing magenta, sometimes it randomly starts flashing (as opposed to breathing) magenta, either if I leave it on without interaction for about 5 minutes, or after I flash it from particle build.

Depending on if you’ve flashed recently or not, it might be doing an automated update, which can take several minutes. During that time, you’d best leave it alone. Should you wish to expedite the process, then you could hook it up to the CLI in DFU mode and issue particle update.

I tried that, it updated successfully. It went back into safe mode. Then I tried full factory reset, and it went into safe mode after I got it connected to wifi. It goes into safe mode after rapid cyan blinking on each boot, by the way.

Try doing particle flash --usb tinker in DFU mode, that might help.

The command doesn’t succeed:

$ sudo particle flash --usb tinker
Found DFU device 2b04:d006
checking file  /usr/lib/node_modules/particle-cli/binaries/photon_tinker.bin
spawning dfu-util -d 2b04:d006 -a 0 -i 0 -s 0x080A0000:leave -D /usr/lib/node_modules/particle-cli/binaries/photon_tinker.bin
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Deducing device DFU version from functional descriptor length
Opening DFU capable USB device...
ID 2b04:d006
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x080a0000, size = 3952
Download	[=========================] 100%         3952 bytes
Download done.
File downloaded successfully
dfu-util: Error during download get_status

Error writing firmware...dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!

dfu-util: Error during download get_status



Though the device does go into breathing cyan instead of breathing magenta, but after I try flashing it again, after it restarts and connects to wifi, and goes back into breathing magenta.

The command succeeded, that error is a known issue with DFU-util. Have you tried doing particle update with the CLI when in DFU mode, before running this command?

Yes I did, it goes into safemode again as usual after flashing from the web IDE, after particle update succeeds.

Could you try flashing a simple app, like the “blink an LED” to make sure it’s not your app causing issues? Considering you’ve done the update, and Tinker works, I’m inclined to suspect something in your app is causing it to go into safe mode.

This is the app I’ve been trying to flash:

void setup() {
    RGB.control(true);
}

void loop() {
    RGB.control(true);
    RGB.brightness(255);
    RGB.color(255, 0, 0);
    delay(100);
    RGB.color(0, 255, 0);
    delay(100);
    RGB.color(0, 0, 255);
    delay(100);
}

And it still goes into safemode.

Oh wow, it must work now. I just left it idling doing it’s thing where it kept blinking and rebooting, and now my app works.

Guess that worked then. That also means that you hadn't applied the update correctly using the CLI or it wouldn't have tried to update it with the IDE.
Regardless, glad you've got it working again!