Skip to content

Commit

Permalink
Update BF-018A.ino
Browse files Browse the repository at this point in the history
Create WifiManager in global scope, not in the setup().
  • Loading branch information
uehara00 committed Jan 13, 2021
1 parent 5decfb0 commit a461322
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion BF-018A/BF-018A.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
#include <WiFi.h>
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager

// initialize Wifimanager
WiFiManager wm;

// for NTP and time
const long gmt_offset = 3600 * 9; // JST-9
const int daylight = 3600 * 0; // No daylight time
Expand Down Expand Up @@ -310,7 +313,6 @@ void setup()
ReportInit();

// connect Wifi
WiFiManager wm;
// wm.resetSettings(); // for testing
if (!wm.autoConnect()) {
Serial.println("Failed to connect");
Expand Down

0 comments on commit a461322

Please sign in to comment.