Photon OTA firmware update failure

I’m having an issue where when I try to update my Photon firmware OTA using Particle Dev, the update does not work. What happens is the LED turns magenta and flashes for about 1 second, then the Photon restarts and is still running the old firmware. It’s as if the process encounters an error or something and restarts the Photon without finishing. No SOS code is flashed however.

Sometimes if I retry from Particle Dev several times, it will finally do the full update where it flashes magenta for 5-10 seconds, then restarts with the updated firmware.

As things currently stand, the only way I can update my firmware is to build in Particle Dev, put my Photon into DFU mode, and flash using USB.

Any tips much appreciated!

1 Like

Can you try to put your device into Safe Mode and see if OTA flashing works better then?

Your symptoms sound as if your running code interferes with the OTA flashing.
If you could show your code we might be able to see possible OTA stumblers.

I have had this problem in spades. The weak signals just seem to be too weak in some parts of my house. In fact I have two places I do development and in both places, it’s too weak.

So I sprung for a WIfi range extender. Now there’s no problem. Actually, one extender for both places. Kinda defeats the $20 price of a Photon when you have to spend 2x$40 for range extenders.

Also switch your antenna selection to the 6 inch one. Assuming you bought one or the kit it comes in! Choosing which antenna is software controllable.

But the first thing I did is something I still do. On the top of the source file page is this line:

int editVersion = 110;

Every time I do an edit I update the number. And the first thing I do in the code is print the number out. I verify that the code it prints is the correct code. It is maddening to work on a problem you thought you fixed only to find out the old code is still in the Photon.

If your code does a lot with wifi, you can add in code which prints out every access point it sees and the RSSI strength code for each. I predict you will quickly see why you cannot flash successfully.

There has to be a way for the web based download to check if the code that’s there is the correct code. In other words please don’t tell me the flash was successful if it wasn’t!

You can also look at https://dashboard.particle.io/user/logs to see if your device publishes a new app hash after an OTA.
If it does your new code should have stuck.

This feature was introduced a while after Build or Dev were put together, hence they don’t yet use this info to give you a more accurate feedback.