Microwave hardening

Some, but not all, of my photons (all running the exact same code) fall into a fast cyan blink state when I run the microwave 40 feet away, and they stay in this state seemingly forever until reset, then they are fine again. So, while I know the microwave is the trigger, some of the photons seem more immune and don’t exhibit this behavior. Perhaps even though running the same code they were in a slightly different state at the time of the microwave blast. At any rate, I’m very interested in any coding tips to avoid this and if there are ways to build into my code detection and recovery from this state.
My phone and computers don’t show any similar symptoms, BTW.


A lot of these issues tend to come down to power supplies and poor decoupling.

How are you powering the Photon’s?

1 Like

Computer’s USB port and 1 or 2A wallwarts

I wonder if there is an issue with your microwave’s shielding? It may just be blasting away any available spectrum. I would be curious to see if the RSSI for your computer drops while the microwave is running. If you wanted to get really really fancy something like this would help you see if the microwave is causing issues ( http://www.amazon.com/Wi-Spy-2-4x-USB-Spectrum-Analyzer/dp/B001E032KU ). So the cheaper option would be a wi-fi scan from your computer, etc. :slight_smile:

It might be a different channel is less impacted by the microwave? If you opened up your router settings, you might be able to have it run a site-profile / channel selection while your microwave is running, which could help?


Thanks for the tips @Dave . I have an app called WiFi Analyzer on my Android phone that displays relative RSSI channel levels. I was on 6, rated the “best”, but what was displayed as best varied while running the microwave. So I tried channels 1 and 11 in turn. Even though channel 11 wasn’t rated the best and the photons still fast flashed cyan during microwave use, they did seem to recover, and they weren’t recovering on channel 6 before. So I’ll see what happens over time.
Interestingly, my Spark core never fast flashed cyan (with the same app code - all on latest).
I’m still interested if there’s any general code suggestions to “ruggedize” against such interference or aid recovery.
BTW, following several websites suggestions on testing for microwave leakage, I recently variously put my phone, raspberry pi, and Spark cores in the microwave (no, not while it was on!) and they all lost connection with the door shut, *suggesting" there isn’t a lot of leakage from within the chamber, but maybe it’s coming from outside the chamber? If this isn’t a common problem, then probably I should get a new microwave!
Thanks again

1 Like

So the problem in the photons (loss of cloud connection, rapid cyan blink, but generally not on the spark core) keeps intermittently occurring w/ the damn microwave, sometimes for another unknown reason. I came up with this code that seems to get the photons back in action:

#include "application.h"
const uint32_t SOFTDELAY10s   = 10000UL;
uint32_t lastTime;
volatile int lostconnectionTimeUnix = 0;

void setup(){
//Your normal setup code here
void loop() {
    if (!Spark.connected()) {  //record when photon lost connection
        if(Time.now() > (lostconnectionTimeUnix + 6000)) { //try reconnect if disconnected > 6 secs
           while(!Spark.connected()) {
            if(lostconnectionTimeUnix == 0) {lostconnectionTimeUnix = Time.now();}
            lastTime = millis();
            while(millis() - lastTime < SOFTDELAY10s) {Spark.process();}
            }//if(Time.now() > (firstlostconnectionTimeUnix + 60000))
    }//if (!Spark.connected())
    if (Spark.connected()){

//Your normal loop code here

        lostconnectionTimeUnix = 0;
    }//if (Spark.connected())       

I’d like to know if this helps you or if anyone has come up w/ something better!
Edit : changed a line because maybe reconnect after 6 secs is better

@Dave I may have found my solution:

1 Like