Why do existing publish events still send even after I have removed them?

Hello all, I have a perception and it may be incorrect, that when I flash new firmware to the Photon that is does not completely wipe the existing program that was on the device. Almost every time now, if I remove a Particle.Publish event or change the name or data signature, and flash to the device, it still shows the old/previous publish events. As a workaround, I have at times had to flash a blank program onto the device and then flash my firmware again to get the publish events to update and reflect my code base(though this method is not even 100% successful).

This is frustrating for two reasons:

  1. I am using publish events temporarily for logging and troubleshooting so when my changes don’t get updated, it delays my testing and troubleshooting.
  2. Our free accounts have a 250k event limit. However, if I think I removed a publish event but it is still reporting, that is costing me events that it should not be sending.

Am I missing something? Is there some procedure to wipe the device before new firmware updates each time?


Have you tried flashing the device while it’s in safe mode?

Really odd, I just tried your suggestion. Bottom line is it did not work. But, here is what I did.

  1. Put the unit in safe mode with the buttons (was breathing magenta).
  2. Did a flash. Flash was successful, device restarted.
  3. After restart, came back into safe mode automatically (maybe it is supposed to)?
  4. Hit the reset button to restart it again and now it is connected (breathing blue).

However, it is still publishing old events that I have long since removed from my code.

This would indicate you are trying to flash a new firmware meant for a higher system version than is on your device and hence the “Safe Mode Healer” tries to update the system to fit your needs, but your reset has stopped that auto-upgrade and hence the new code can’t be run and the old firmware will still live on.
This is by design - let the device do its auto-upgrade and see

Well, that is good to know but very odd. I am running 0.6.0. I know that you are at 0.6.2 now but I never tried to select to target higher than 0.6.0 from the drop down box in devices so I am not sure why it went to this mode.

I am on 0.6.0 still because the firmware manager windows application that flashes nice and simple has not been updated to anything newer than 0.6.0.

Also, am I to assume that IF I do select a new target version (ie 0.6.2) from the drop down box and flash my device, it will update the firmware version too? Unless this process takes a really long time, it is not working. I have been watching it for 5 minutes now. There is alot of random magenta led activity. By random, I mean it will flicker like a hard drive led for a bit, then the led will go out for a little bit. Then it will come back up solid magenta. Sometimes it will flash blue a couple of quick times in between. It seems to do this general pattern over and over again and has been for over 5 minutes now. Do I keep waiting?

Oh wait, just as I typed that last sentence it seems to have stopped with the random stuff and is just now breathing magenta, so now I am just in safe mode?

I don’t really know what is going on here…


If you had 0.6.0 (Default) selected, then this will be automatically pushed along to 0.6.1 (Default) and 0.6.2 (Default) as soon new releases become the new default.

The Safe Mode Healer update will take three to four OTA flash cycles due to the modular nature of the system firmware.
So you will see several phases of magenta blinking and resetting.
This can take a minute or two, but should not take as long as five, unless your WiFi is flaky too.

1 Like

@mjbedford, this thread is a month old, but I am curious what the names of your events are. I was seeing 2 events get fired from one particle.publish() command, and I think the naming of the events has something to do with it. It might have something to do with your problem as well.

I have two event integrations set up (let’s call them “abc” and “abc-prod”). “abc” is a simple development integration. “abc-prod” however, is a product integration. But they both attach to the same Azure IoT hub and send messages to that hub.

The strange behavior I was seeing was that calling particle.publish("abc-prod") from a device would actually fire BOTH integrations. For a while I was sending duplicate data to my Azure database, and I could not figure out why. But deleting the old development integration made the duplication stop.

I wonder if particle.publish() fires all events whose names merely contain the string in its argument?