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

[1.1.0+] WiFi.on() after connected WiFi.off() causes unexpected cloud reconnect (in SEMI_AUTOMATIC mode) #1845

Open
ScruffR opened this issue Jul 8, 2019 · 0 comments
Assignees

Comments

@ScruffR
Copy link
Contributor

@ScruffR ScruffR commented Jul 8, 2019

Bug Report

Expected Behavior

In previous device OS versions calling WiFi.on() after a WiFi.off() call (while the device was cloud connected) did only turn on the WiFi module (breathing blue) but nothing more.

Observed Behavior

Since some time before 1.1.0 the same scenario causes a full reconnect (all the way to breathing cyan) - which is not expected with only calling WiFi.on()
However, preceding WiFi.off() with Particle.disconnect() ensures WiFi.on() to end up breathing blue.

As a side note, if that behaviour were intentional (which I hope isn't) then Particle.disconnect() without WiFi.disconnect() should be end up breathing green (one step down on the connection "ladder").
(that's how I deduced it's more likely a bug than intended behaviour)

Steps to Reproduce

Tested on Photon 1.1.0 and 1.3.0-rc.1

Test App

#include <Particle.h>

SYSTEM_THREAD(ENABLED)
SYSTEM_MODE(SEMI_AUTOMATIC)

void setup() {
  WiFi.on();
  Particle.connect();
}

void loop() {
  static uint32_t ms = 0;
  static bool connected = true;
  if (millis() - ms < 20000) return;
  ms = millis();
  
  
  if (connected) {
    if (millis() > 120000)    // after 2 minutes disconnect from cloud first
      Particle.disconnect();
    WiFi.off();
    connected = false;
  }
  else {
    WiFi.on();
    connected = true;
  }
}

References

https://community.particle.io/t/wifi-on-or-wifi-connect/50735

@ScruffR ScruffR changed the title [1.1.0+] WiFi.on() after conneted WiFi.off() causes unexpected cloud reconnoect in SEMI_AUTOMATIC mode [1.1.0+] WiFi.on() after connected WiFi.off() causes unexpected cloud reconnect (in SEMI_AUTOMATIC mode) Jul 8, 2019
@m-mcgowan m-mcgowan self-assigned this Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.