Reset Photon over Cloud

Hello,

I have very basic need of resetting photon on field if there some corruption in code. Can I reset it by connecting it to laptop over cloud?

Please advice.

Thanks.!
Kind Regards,
Iqram

Sure, you can do that as long as the Photon is connected to the cloud, and it’s not stuck in a loop that won’t let it respond to a function call or a published event. So, you can either call a function, or publish an event that the Photon subscribes to. Set a flag in the function handler or subscribe handler that you check in loop,

bool shouldReset = false;

void loop() {
    
    if (shouldReset == true) {
        shouldReset = false;
        System.reset();
    }
    // other loop stuff
}


int resetPhoton(String cmd) { // function handler
    shouldReset = true;
    return 1;
}
1 Like

@Iqram, another way to reset your Photon when corruption occurs is to use the application watchdog :wink:

2 Likes