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

Protect flash from wear out by Wifi.begin() #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions code/CO2_monitor.ino
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,13 @@ void setup(){
default, try to act as both, client and access-point, and could cause
network-issues with other WiFi-devices on your WiFi-network. */
WiFi.mode(WIFI_STA);
// Set Wifi persistent to false,
// otherwise on every WiFi.begin the
// ssid and password will be written to
// the same area in the flash which will
// destroy the device in the long run
// See: https://github.com/esp8266/Arduino/issues/1054
WiFi.persistent(false);
WiFi.begin(ssid, password); // connect to Wi-Fi
if (DEBUG == true)
Serial.println("Connecting to WiFi");
Expand Down