mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-22 02:32:10 +10:00
updated examples
This commit is contained in:
@@ -48,7 +48,7 @@ void setup() {
|
|||||||
std::unique_ptr<char[]> buf(new char[size]);
|
std::unique_ptr<char[]> buf(new char[size]);
|
||||||
|
|
||||||
configFile.readBytes(buf.get(), size);
|
configFile.readBytes(buf.get(), size);
|
||||||
StaticJsonBuffer<200> jsonBuffer;
|
DynamicJsonBuffer jsonBuffer;
|
||||||
JsonObject& json = jsonBuffer.parseObject(buf.get());
|
JsonObject& json = jsonBuffer.parseObject(buf.get());
|
||||||
json.printTo(Serial);
|
json.printTo(Serial);
|
||||||
if (json.success()) {
|
if (json.success()) {
|
||||||
@@ -97,7 +97,7 @@ void setup() {
|
|||||||
|
|
||||||
//set minimu quality of signal so it ignores AP's under that quality
|
//set minimu quality of signal so it ignores AP's under that quality
|
||||||
//defaults to 8%
|
//defaults to 8%
|
||||||
wifiManager.setMinimumSignalQuality();
|
//wifiManager.setMinimumSignalQuality();
|
||||||
|
|
||||||
//sets timeout until configuration portal gets turned off
|
//sets timeout until configuration portal gets turned off
|
||||||
//useful to make it all retry or go to sleep
|
//useful to make it all retry or go to sleep
|
||||||
@@ -127,7 +127,7 @@ void setup() {
|
|||||||
//save the custom parameters to FS
|
//save the custom parameters to FS
|
||||||
if (shouldSaveConfig) {
|
if (shouldSaveConfig) {
|
||||||
Serial.println("saving config");
|
Serial.println("saving config");
|
||||||
StaticJsonBuffer<200> jsonBuffer;
|
DynamicJsonBuffer jsonBuffer;
|
||||||
JsonObject& json = jsonBuffer.createObject();
|
JsonObject& json = jsonBuffer.createObject();
|
||||||
json["mqtt_server"] = mqtt_server;
|
json["mqtt_server"] = mqtt_server;
|
||||||
json["mqtt_port"] = mqtt_port;
|
json["mqtt_port"] = mqtt_port;
|
||||||
|
|||||||
+2
-2
@@ -52,7 +52,7 @@ void setup() {
|
|||||||
std::unique_ptr<char[]> buf(new char[size]);
|
std::unique_ptr<char[]> buf(new char[size]);
|
||||||
|
|
||||||
configFile.readBytes(buf.get(), size);
|
configFile.readBytes(buf.get(), size);
|
||||||
StaticJsonBuffer<200> jsonBuffer;
|
DynamicJsonBuffer jsonBuffer;
|
||||||
JsonObject& json = jsonBuffer.parseObject(buf.get());
|
JsonObject& json = jsonBuffer.parseObject(buf.get());
|
||||||
json.printTo(Serial);
|
json.printTo(Serial);
|
||||||
if (json.success()) {
|
if (json.success()) {
|
||||||
@@ -154,7 +154,7 @@ void setup() {
|
|||||||
//save the custom parameters to FS
|
//save the custom parameters to FS
|
||||||
if (shouldSaveConfig) {
|
if (shouldSaveConfig) {
|
||||||
Serial.println("saving config");
|
Serial.println("saving config");
|
||||||
StaticJsonBuffer<200> jsonBuffer;
|
DynamicJsonBuffer jsonBuffer;
|
||||||
JsonObject& json = jsonBuffer.createObject();
|
JsonObject& json = jsonBuffer.createObject();
|
||||||
json["mqtt_server"] = mqtt_server;
|
json["mqtt_server"] = mqtt_server;
|
||||||
json["mqtt_port"] = mqtt_port;
|
json["mqtt_port"] = mqtt_port;
|
||||||
|
|||||||
Reference in New Issue
Block a user