I have 6 electrons.
I have released a certain firmware version for my product.
All 6 electrons are a device in this product.
So by this setting, every time the electron comes online, it should be either already updated, or flashed this firmware and then be updated.
When I bring an Electron online, sometimes the firmware works on the flash, and sometimes it doesn’t. Why is there this variability? I haven’t done anything fancy with the firmware… but even if I did, why does it work on one electron and not the other?
I am testing these Electrons out-of-the-box.
What I have found… is after about 5 minutes of leaving it alone and letting it continuously do this blinking magenta, static magenta, reset, etc. it eventually is working.
Am I doing something wrong? Code below(product_id hidden)
PRODUCT_ID(my_secret);
PRODUCT_VERSION(1);
int led1 = D6; // LED is connected to D6
int led2 = A0; // LED is connected to A0
int led3 = A5; // LED is connected to A5
int led4 = D0; // LED is connected to D0
int pushButton = D5; // Push button is connected to D5
// This routine runs only once upon reset
void setup()
{
pinMode(led1, OUTPUT); // Initialize D6 pin as output
pinMode(led2, OUTPUT); // Initialize A0 pin as output
pinMode(led3, OUTPUT); // Initialize A5 pin as output
pinMode(led4, OUTPUT); // Initialize D0 pin as output
pinMode(pushButton, INPUT_PULLUP);
// Initialize D2 pin as input with an internal pull-up resistor
}
// This routine loops forever
void loop()
{
int pushButtonState;
pushButtonState = digitalRead(pushButton);
if(pushButtonState == LOW){ //If we push down on the push button
digitalWrite(led1, HIGH); // Turn ON the LED
digitalWrite(led2, HIGH); // Turn ON the LED
digitalWrite(led3, HIGH); // Turn ON the LED
digitalWrite(led4, HIGH); // Turn ON the LED
Particle.publish("my-webhook", PRIVATE);
// Add a delay to prevent getting tons of emails from IFTTT
delay(10000);
}
else
{
digitalWrite(led1, LOW); // Turn OFF the LED
digitalWrite(led2, LOW); // Turn OFF the LED
digitalWrite(led3, LOW); // Turn OFF the LED
digitalWrite(led4, LOW); // Turn OFF the LED
}
}