Have to re-open this discussion as sadly I ran into the exact same issue again today. I have 40 Particle Electrons next to me, and they were all tagged for a firmware update. I had to leave for a little while, and when I came back I noticed about three-quarter of them still turned on and I had been billed for $60 in the meantime for data usage. When I investigated, I saw that all of these Electrons were re-downloading the same firmware over and over, but for some reason they remained tagged with an old firmware version in my Product.
They publish their data each time they come online, and I can tell they certainly did download the updated firmware correctly as they're publishing my newest variables. The issue really seems to lie with them being tagged with the wrong firmware in the Console so they continue to download repeatedly?
I think this is potentially a major issue for me, as using the the Console Product is the only way of queue'ing firmware updates, but so far it doesn't appear to be reliable at all.
My firmware for updating looks like this:
case PUBLISH: {
if (Particle.connected()) {
CellularSignal sig = Cellular.RSSI();
int cellsig = sig.rssi;
int rssi = map(cellsig, -131, -51, 0, 5);
delay(50);
char data[256];
float volt = batteryMonitor.getVCell();
float soc = batteryMonitor.getSoC();
snprintf(data, sizeof(data), "{ \"vlt\": \"%.03f\", \"soc\": \"%.02f\", \"stt\": \"%i\", \"rss\": \"%i\" }", volt, soc, status, rssi);
Serial.println(data);
Particle.publish(eventTest, data, PRIVATE);
ubidots.add("Voltage", volt);
ubidots.add("Charge", soc);
ubidots.add("Status", status);
ubidots.add("RSSI", rssi);
ubidots.setMethod(TYPE_TCP);
if(ubidots.sendAll()){
Serial.println("Ubidots values sent");
}
delay(5000);
stateTime = millis();
state = FIRMWARECHECK;
break;
}
else {
if (!Particle.connected()) {
Particle.connect();
delay(8000);
}
if(millis() - stateTime >= 45000) {
state = FIRMWARECHECK;
break;
}
}
}
break;
case FIRMWARECHECK: {
if (Time.weekday() < 8) {
Serial.println("checking for firmware update");
delay(90000);
state = CONFIG;
}
else {
state = CONFIG;
break;
}
}
EDIT: Re-plugged the battery and now they seem to download and maintain the new firmware just fine in most cases. Seems like a power reset may be necessary to avoid this issue?