Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue: Photon SOS hard fault on WiFi.connect() when no WiFi is available for 0.8.0-rc11 and 0.7.0 #1616

Closed
bloukingfisher opened this issue Dec 1, 2018 · 1 comment

Comments

@bloukingfisher
Copy link

@bloukingfisher bloukingfisher commented Dec 1, 2018

Bug Report

Expected Behavior

WiFi.connect() should attempt to connect to WiFi with stored credentials. With system thread enabled, and mode semi-automatic or manual, when the connection fails the device should NOT enter a hard fault. Instead user code should be processed, at minimum in manual mode.

Observed Behavior

When WiFi is dropped (only in semi-automatic mode), or the network is not available on restart (for both manual and semi-automatic), the device enters a red flash SOS hard fault, and keeps restarting and cycling through another hard fault.

Steps to Reproduce

Issue verified to occur on 0.8.0-rc11 and 0.7.0. Self and another user confirmed this issue does not occur on system firmware 0.6.3.

Video showing the code below and actual behavior (unit on right hard faults) is posted in the community: https://community.particle.io/t/wifi-connect-results-in-hard-fault-when-wifi-is-not-available-or-has-no-internet-connection/45789

Test App

SYSTEM_MODE(SEMI_AUTOMATIC); //same thing happens in MANUAL too
SYSTEM_THREAD(ENABLED);
                                            // INITIALIZE VARIABLES =================================

int LED = D7;                               // LED = onboard LED pin (D7).


                                            // SETUP ================================================

void setup() {
    pinMode (LED, OUTPUT);                  // Set LED pin to OUTPUT mode.

    WiFi.on();                              // Turn on WiFi
    
            digitalWrite(LED, HIGH);        // LED flashing is merely to help locate step whereafter SOS occurs  
            delay(6000);
            digitalWrite(LED, LOW);
            delay(1000);
            
    WiFi.connect();                         // Attempt to connect to available networks assuming 1 set of credentials

   
            digitalWrite(LED, HIGH);        
            delay(4000);
            digitalWrite(LED, LOW);
            delay(1000);
            
    if(waitFor(WiFi.ready, 15000)) { Particle.connect(); }   // If connected to the network, connect to the Particle Cloud
         
            digitalWrite(LED, HIGH);        
            delay(3000);
            digitalWrite(LED, LOW);
            delay(1000);

}


                                            // MAIN PROGRAM LOOP =====================================

void loop() {

digitalWrite(LED, HIGH);        // User code doing stuff
            delay(2000);
            digitalWrite(LED, LOW);
            delay(500);

Particle.process(); // tested with and without and when wifi is availble in both cases it remains connected
}

References

https://community.particle.io/t/wifi-connect-results-in-hard-fault-when-wifi-is-not-available-or-has-no-internet-connection/45789


@bloukingfisher

This comment has been minimized.

Copy link
Author

@bloukingfisher bloukingfisher commented Jan 15, 2019

My devices experienced the same hard fault after upgrading to 1.0.0.
However, after clearing the WiFi credentials the SOS went away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.