[GH-ISSUE #603] Including max6675 library invalidates settings #502

Open
opened 2026-02-28 01:25:36 +03:00 by kerem · 13 comments
Owner

Originally created by @PiteousHonking on GitHub (Apr 30, 2018).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/603

----------------------------- Remove above -----------------------------

Basic Infos

Adding the max6675 library to a sketch causes settings invalidated error

Hardware

WiFimanager Branch/Release: Development

Hardware: Esp8266 WemosD1
https://github.com/adafruit/MAX6675-library 1.0 installed
Arduino 1.8.5 IDE

Description

The attached code works as expected, creates an AP, stores wifi settings and Blynk auth token and connects to Blynk server sucessfully

If I include the max6675.h library ait will run through the same process but fail to connect to the Blynk server with the error:

*WM: settings invalidated
*WM: THIS MAY CAUSE AP NOT TO START UP PROPERLY. YOU NEED TO COMMENT IT OUT AFTER ERASING THE DATA.
(⸮)⸮R(⸮⸮⸮

Comment out the max665.h library and it works again. Also posted on the blynk forum but it seems to be a wifimanager/max6675 issue.

Settings in IDE

Module: Wemos D1

Additional libraries: https://github.com/adafruit/MAX6675-library

Sketch


char blynk_token[33];
#include <ESP8266WiFi.h>          //https://github.com/esp8266/Arduino

//needed for library
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>         //https://github.com/tzapu/WiFiManager
#include <BlynkSimpleEsp8266.h>

// Needed for  the Thermocouple
#include <max6675.h>
int thermoDO = D5;
int thermoCS = D6;
int thermoCLK = D7;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
int vccPin = 3;
int gndPin = 2;

void setup() {
    Serial.begin(115200);  
    //pinMode(vccPin, OUTPUT); digitalWrite(vccPin, HIGH); //Thermo
    //pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW);  //Thermo
    WiFiManagerParameter custom_blynk_token("Blynk", "blynk token", blynk_token, 33);
    WiFiManager wifi;
    wifi.addParameter(&custom_blynk_token);
    wifi.autoConnect("Blynk");
    Blynk.config(custom_blynk_token.getValue());
}
void loop()
 {
  Blynk.run();
}

Debug Messages

mounting FS...
mounted file system
reading config file
opened config file
{"blynk_token":"REMOVED"}
parsed json
*WM: Adding parameter
*WM: blynk
*WM: 
*WM: AutoConnect
*WM: Connecting as wifi client...
*WM: Using last saved values, should be faster
*WM: Connection result: 
*WM: 3
*WM: IP Address:
*WM: 192.168.1.53
connected...yeey :)
[9633] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.5.2 on Arduino

[9745] Connecting to blynk-cloud.com:80
BLYNK Connection Fail
*WM: settings invalidated
*WM: THIS MAY CAUSE AP NOT TO START UP PROPERLY. YOU NEED TO COMMENT IT OUT AFTER ERASING THE DATA.

Originally created by @PiteousHonking on GitHub (Apr 30, 2018). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/603 ----------------------------- Remove above ----------------------------- ### Basic Infos Adding the max6675 library to a sketch causes settings invalidated error #### Hardware WiFimanager Branch/Release: Development Hardware: Esp8266 WemosD1 https://github.com/adafruit/MAX6675-library 1.0 installed Arduino 1.8.5 IDE ### Description The attached code works as expected, creates an AP, stores wifi settings and Blynk auth token and connects to Blynk server sucessfully If I include the max6675.h library ait will run through the same process but fail to connect to the Blynk server with the error: *WM: settings invalidated *WM: THIS MAY CAUSE AP NOT TO START UP PROPERLY. YOU NEED TO COMMENT IT OUT AFTER ERASING THE DATA. (⸮)⸮R(⸮⸮⸮ Comment out the max665.h library and it works again. Also posted on the blynk forum but it seems to be a wifimanager/max6675 issue. ### Settings in IDE Module: Wemos D1 Additional libraries: https://github.com/adafruit/MAX6675-library ### Sketch ```cpp char blynk_token[33]; #include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino //needed for library #include <DNSServer.h> #include <ESP8266WebServer.h> #include <WiFiManager.h> //https://github.com/tzapu/WiFiManager #include <BlynkSimpleEsp8266.h> // Needed for the Thermocouple #include <max6675.h> int thermoDO = D5; int thermoCS = D6; int thermoCLK = D7; MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO); int vccPin = 3; int gndPin = 2; void setup() { Serial.begin(115200); //pinMode(vccPin, OUTPUT); digitalWrite(vccPin, HIGH); //Thermo //pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW); //Thermo WiFiManagerParameter custom_blynk_token("Blynk", "blynk token", blynk_token, 33); WiFiManager wifi; wifi.addParameter(&custom_blynk_token); wifi.autoConnect("Blynk"); Blynk.config(custom_blynk_token.getValue()); } void loop() { Blynk.run(); } ``` ### Debug Messages ``` mounting FS... mounted file system reading config file opened config file {"blynk_token":"REMOVED"} parsed json *WM: Adding parameter *WM: blynk *WM: *WM: AutoConnect *WM: Connecting as wifi client... *WM: Using last saved values, should be faster *WM: Connection result: *WM: 3 *WM: IP Address: *WM: 192.168.1.53 connected...yeey :) [9633] ___ __ __ / _ )/ /_ _____ / /__ / _ / / // / _ \/ '_/ /____/_/\_, /_//_/_/\_\ /___/ v0.5.2 on Arduino [9745] Connecting to blynk-cloud.com:80 BLYNK Connection Fail *WM: settings invalidated *WM: THIS MAY CAUSE AP NOT TO START UP PROPERLY. YOU NEED TO COMMENT IT OUT AFTER ERASING THE DATA. ```
Author
Owner

@felipepereira92 commented on GitHub (Jun 17, 2018):

I'm also with this problem. We need help!!!

<!-- gh-comment-id:397847594 --> @felipepereira92 commented on GitHub (Jun 17, 2018): I'm also with this problem. We need help!!!
Author
Owner

@tablatronix commented on GitHub (Jun 17, 2018):

settings invalidated means something called resetSettings() explicitly. And that makes no sense, check your code.

<!-- gh-comment-id:397886150 --> @tablatronix commented on GitHub (Jun 17, 2018): settings invalidated means something called resetSettings() explicitly. And that makes no sense, check your code.
Author
Owner

@PiteousHonking commented on GitHub (Jun 17, 2018):

Can you expand on what you mean, is there a way of determining what it is that's calling resetSettings?

<!-- gh-comment-id:397888735 --> @PiteousHonking commented on GitHub (Jun 17, 2018): Can you expand on what you mean, is there a way of determining what it is that's calling resetSettings?
Author
Owner

@tablatronix commented on GitHub (Jun 17, 2018):

That sketch is surely not your entire code

<!-- gh-comment-id:397894764 --> @tablatronix commented on GitHub (Jun 17, 2018): That sketch is surely not your entire code
Author
Owner

@tablatronix commented on GitHub (Jun 17, 2018):

I cant even get blynk to connect, it just sits in blynk.connect loop.
hmm

<!-- gh-comment-id:397896672 --> @tablatronix commented on GitHub (Jun 17, 2018): I cant even get blynk to connect, it just sits in blynk.connect loop. hmm
Author
Owner

@tablatronix commented on GitHub (Jun 17, 2018):

ahh I forgot #define BLYNK_PRINT Serial

<!-- gh-comment-id:397898534 --> @tablatronix commented on GitHub (Jun 17, 2018): ahh I forgot #define BLYNK_PRINT Serial
Author
Owner

@tablatronix commented on GitHub (Jun 17, 2018):

I cannot reproduce so this must be in your code. Not sure what else to test here.

<!-- gh-comment-id:397898637 --> @tablatronix commented on GitHub (Jun 17, 2018): I cannot reproduce so this must be in your code. Not sure what else to test here.
Author
Owner

@felipepereira92 commented on GitHub (Jun 17, 2018):

I got, i include the send sensor, BlynkTimer and i cheked the pins (D4, D5 and D6) because i had chnged.

//#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>         //https://github.com/tzapu/WiFiManager
#include <EEPROM.h>
#include <max6675.h>

BlynkTimer timer;

int thermoDO = D4;
int thermoCS = D5;
int thermoCLK = D6;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);

void sendSensor();
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "TOKEN";

void setup()
{
  EEPROM.begin(512);
  Serial.begin(115200);
  WiFiManager wifiManager;
  //wifiManager.resetSettings();    //Uncomment this to wipe WiFi settings from EEPROM on boot.  Comment out and recompile/upload after 1 boot cycle.
  wifiManager.autoConnect("NodeMCU");
  //if you get here you have connected to the WiFi
  Serial.println("connected...yeey :)");
  //pinMode(BUILTIN_LED, OUTPUT);     // Initialize the BUILTIN_LED pin as an output, I like blinkies.
  Blynk.begin(auth, WiFi.SSID().c_str(), WiFi.psk().c_str());
  timer.setInterval(1000L, sendSensor);
}

void loop()
{
  timer.run();
  Blynk.run();  // Commented out for a short time.
}

void sendSensor(){
 Blynk.virtualWrite(V5, thermocouple.readCelsius());
}
<!-- gh-comment-id:397903472 --> @felipepereira92 commented on GitHub (Jun 17, 2018): I got, i include the send sensor, BlynkTimer and i cheked the pins (D4, D5 and D6) because i had chnged. ```CPP //#define BLYNK_PRINT Serial // Comment this out to disable prints and save space #include <ESP8266WiFi.h> #include <BlynkSimpleEsp8266.h> #include <DNSServer.h> #include <ESP8266WebServer.h> #include <WiFiManager.h> //https://github.com/tzapu/WiFiManager #include <EEPROM.h> #include <max6675.h> BlynkTimer timer; int thermoDO = D4; int thermoCS = D5; int thermoCLK = D6; MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO); void sendSensor(); // You should get Auth Token in the Blynk App. // Go to the Project Settings (nut icon). char auth[] = "TOKEN"; void setup() { EEPROM.begin(512); Serial.begin(115200); WiFiManager wifiManager; //wifiManager.resetSettings(); //Uncomment this to wipe WiFi settings from EEPROM on boot. Comment out and recompile/upload after 1 boot cycle. wifiManager.autoConnect("NodeMCU"); //if you get here you have connected to the WiFi Serial.println("connected...yeey :)"); //pinMode(BUILTIN_LED, OUTPUT); // Initialize the BUILTIN_LED pin as an output, I like blinkies. Blynk.begin(auth, WiFi.SSID().c_str(), WiFi.psk().c_str()); timer.setInterval(1000L, sendSensor); } void loop() { timer.run(); Blynk.run(); // Commented out for a short time. } void sendSensor(){ Blynk.virtualWrite(V5, thermocouple.readCelsius()); } ```
Author
Owner

@consolacion commented on GitHub (Oct 6, 2018):

I don't think it is 'his code' I have the same problem with the unaltered example code "autoconnect with custom parameters"

<!-- gh-comment-id:427587748 --> @consolacion commented on GitHub (Oct 6, 2018): I don't think it is 'his code' I have the same problem with the unaltered example code "autoconnect with custom parameters"
Author
Owner

@tablatronix commented on GitHub (Oct 6, 2018):

Settings invalidated come from wm.resetSettings
There is no other reason for it occur unless you are calling it

<!-- gh-comment-id:427595123 --> @tablatronix commented on GitHub (Oct 6, 2018): Settings invalidated come from wm.resetSettings There is no other reason for it occur unless you are calling it
Author
Owner

@consolacion commented on GitHub (Oct 6, 2018):

Thanks, I see the example called that 'for testing'.
I understand now. Learning every day :-)

<!-- gh-comment-id:427597461 --> @consolacion commented on GitHub (Oct 6, 2018): Thanks, I see the example called that 'for testing'. I understand now. Learning every day :-)
Author
Owner

@tablatronix commented on GitHub (Oct 6, 2018):

I just commented it out in that one example in developement , it was not supposed to be active
oops sorry

<!-- gh-comment-id:427599153 --> @tablatronix commented on GitHub (Oct 6, 2018): I just commented it out in that one example in developement , it was not supposed to be active oops sorry
Author
Owner

@consolacion commented on GitHub (Oct 6, 2018):

That might be a good idea. I overlooked it as I thought that was what the
SPIFFS.format();
was for :-) But I start to understand the code better now. Tnx

<!-- gh-comment-id:427599381 --> @consolacion commented on GitHub (Oct 6, 2018): That might be a good idea. I overlooked it as I thought that was what the SPIFFS.format(); was for :-) But I start to understand the code better now. Tnx
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#502
No description provided.