Skip to content

Commit d7113ff

Browse files
committed
Fixed DNS not being setup correctly
1 parent af1be1a commit d7113ff

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

platformio.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ version = -DBUILD_TAG=3.0.0
3434
monitor_speed = 115200
3535
lib_deps =
3636
37-
37+
3838
extra_scripts = scripts/extra_script.py
3939
debug_flags =
4040
-DENABLE_DEBUG
@@ -57,7 +57,7 @@ build_flags =
5757
-DMG_SSL_IF_MBEDTLS_MAX_FRAG_LEN=2048
5858
#-DARDUINO_MONGOOSE_DEFAULT_STREAM_BUFFER=2048
5959
#-DARDUINO_MONGOOSE_SEND_BUFFER_SIZE=2048
60-
#-DENABLE_DEBUG
60+
-DENABLE_DEBUG
6161
build_flags_esp8266 =
6262
-DMG_ESP8266
6363
-DCS_PLATFORM=CS_P_ESP8266

src/emoncms.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ void emoncms_publish(String data)
3333
url += "&apikey=";
3434
url += emoncms_apikey;
3535

36-
DBUGLN(url);
36+
DBUGVAR(url);
3737
packets_sent++;
3838

3939
client.get(url, [](MongooseHttpClientResponse *response)
4040
{
4141
MongooseString result = response->body();
42+
DBUGF("result = %.*s", result.length(), result.c_str());
43+
4244
StaticJsonDocument<32> doc;
4345
if(DeserializationError::Code::Ok == deserializeJson(doc, result.c_str(), result.length()))
4446
{

src/net_manager.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
#error Platform not supported
1515
#endif
1616

17+
#include <MongooseCore.h>
18+
1719
#include <DNSServer.h> // Required for captive portal
1820

1921
#ifdef ENABLE_WIRED_ETHERNET
@@ -146,6 +148,8 @@ static void net_connected(IPAddress myAddress)
146148
DEBUG.println(tmpStr);
147149
lcd_display(F("IP Address"), 0, 0, 0, LCD_CLEAR_LINE);
148150
lcd_display(tmpStr, 0, 1, 5000, LCD_CLEAR_LINE);
151+
152+
Mongoose.ipConfigChanged();
149153
}
150154

151155
static void net_wifi_onStationModeConnected(const WiFiEventStationModeConnected &event) {

0 commit comments

Comments
 (0)