From c6d3b8b91f88aabfa3c4204e7e8cd4bcb3f7e468 Mon Sep 17 00:00:00 2001 From: Dmitry Borisenko <49808844+DmitryBorisenko33@users.noreply.github.com> Date: Sat, 9 Oct 2021 05:12:49 +0800 Subject: [PATCH] stable --- data_esp/config.json | 30 +++++++++++++++--------------- src/Utils/WiFiUtils.cpp | 3 ++- src/main.cpp | 6 ++++++ 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/data_esp/config.json b/data_esp/config.json index 9d038a2d..88b2d187 100644 --- a/data_esp/config.json +++ b/data_esp/config.json @@ -3,8 +3,8 @@ "chipID": "", "apssid": "IoTmanager", "appass": "", - "routerssid": "dlink", - "routerpass": "", + "routerssid": "XChangeWIFI", + "routerpass": "XCh@WIFI", "timezone": 1, "ntp": "pool.ntp.org", "mqttServer": "91.204.228.124", @@ -17,21 +17,21 @@ "mqttPrefix2": "/iotTest3", "mqttUser2": "rise", "mqttPass2": "hostel3333", - "scen": "1", + "scen": 1, "telegramApi": "1416711569:AAEI0j83GmXqwzb_gnK1B0Am0gDwZoJt5xo", - "telegonof": "0", - "teleginput": "0", - "autos": "1", + "telegonof": 0, + "teleginput": 0, + "autos": 1, "weblogin": "admin", "webpass": "admin", - "MqttIn": "0", - "MqttOut": "0", - "blink": "1", - "oneWirePin": "2", + "MqttIn": 0, + "MqttOut": 0, + "blink": 1, + "oneWirePin": 2, "serverip": "http://206.189.49.244", - "uart": "0", - "uartS": "9600", - "uartTX": "12", - "uartRX": "13", - "grafmax": "0" + "uart": 0, + "uartS": 9600, + "uartTX": 12, + "uartRX": 13, + "grafmax": 0 } \ No newline at end of file diff --git a/src/Utils/WiFiUtils.cpp b/src/Utils/WiFiUtils.cpp index 13503fa4..2a3c1acf 100644 --- a/src/Utils/WiFiUtils.cpp +++ b/src/Utils/WiFiUtils.cpp @@ -7,7 +7,7 @@ void routerConnect() { setLedStatus(LED_SLOW); WiFi.mode(WIFI_STA); - byte tries = 20; + byte tries = 40; String _ssid = jsonReadStr(configSetupJson, "routerssid"); String _password = jsonReadStr(configSetupJson, "routerpass"); @@ -22,6 +22,7 @@ void routerConnect() { WiFi.setOutputPower(20.5); #endif SerialPrint("I", "WIFI", "ssid: " + _ssid); + SerialPrint("I", "WIFI", "pass: " + _password); } while (--tries && WiFi.status() != WL_CONNECTED) { diff --git a/src/main.cpp b/src/main.cpp index cb04031f..9b9c8831 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -90,6 +90,12 @@ void setup() { ts.add( MYTEST, 10000, [&](void*) { Serial.println(configSetupJson.length()); + Serial.println(F("--------------------------------------")); + Serial.println(jsonReadStr(configSetupJson, "apssidx")); + Serial.println(jsonReadBool(configSetupJson, "telegonof")); + Serial.println(jsonReadInt(configSetupJson, "mqttPort")); + Serial.println(jsonReadInt(configSetupJson, "uartTX")); + Serial.println(F("--------------------------------------")); }, nullptr, true);