Skip to content

Commit

Permalink
Fix to send IP to flasher tool
Browse files Browse the repository at this point in the history
  • Loading branch information
graham22 committed Feb 1, 2024
1 parent 0805108 commit d988dfd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions code/ESP32/ClassicMQTT/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ build_flags =
-D AP_TIMEOUT=30000

; log level
-D APP_LOG_LEVEL=ARDUHAL_LOG_LEVEL_WARN
; -D APP_LOG_LEVEL=ARDUHAL_LOG_LEVEL_WARN
-D IOTWEBCONF_DEBUG_DISABLED
; -D APP_LOG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
-D APP_LOG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
; -D IOTWEBCONF_DEBUG_PWD_TO_SERIAL
6 changes: 4 additions & 2 deletions code/ESP32/ClassicMQTT/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ using namespace std;
#define WAKE_PUBLISH_RATE 2000
#define SNOOZE_PUBLISH_RATE 300000
#define WAKE_COUNT 60
#define CONFIG_VERSION "V1.3.4" // major.minor.build (major or minor will invalidate the configuration)
#define CONFIG_VERSION "V1.3.5" // major.minor.build (major or minor will invalidate the configuration)
#define NUMBER_CONFIG_LEN 6
#define WATCHDOG_TIMER 600000 //time in ms to trigger the watchdog

Expand Down Expand Up @@ -551,11 +551,13 @@ void WiFiEvent(WiFiEvent_t event)
{
logd("[WiFi-event] event: %d", event);
String s;
String ip;
StaticJsonDocument<128> doc;
switch (event)
{
case SYSTEM_EVENT_STA_GOT_IP:
doc["IP"] = WiFi.localIP().toString().c_str();
ip = WiFi.localIP().toString();
doc["IP"] = ip.c_str();
doc["ApPassword"] = TAG;
serializeJson(doc, s);
s += '\n';
Expand Down

0 comments on commit d988dfd

Please sign in to comment.