From 4d905297cd78c9206641b8f7a36860cc576decce Mon Sep 17 00:00:00 2001 From: arovak Date: Thu, 7 May 2020 14:27:11 +0200 Subject: [PATCH] minor fix stm32 mqttClientID/http IP address --- lib/lvgl | 2 +- src/hasp_http.cpp | 8 +++++--- src/hasp_mqtt.cpp | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/lvgl b/lib/lvgl index 9f67a125..5f739643 160000 --- a/lib/lvgl +++ b/lib/lvgl @@ -1 +1 @@ -Subproject commit 9f67a12548bf5e7a959b0e668a9f6f2c43f3e8e3 +Subproject commit 5f739643f4b22254f5742504fcda3b7de50fb88b diff --git a/src/hasp_http.cpp b/src/hasp_http.cpp index c99a3822..3cb7e0fc 100644 --- a/src/hasp_http.cpp +++ b/src/hasp_http.cpp @@ -1506,7 +1506,9 @@ void webStart() Log.notice(F("HTTP: Server started @ http://%s"), (WiFi.getMode() != WIFI_STA ? WiFi.softAPIP().toString().c_str() : WiFi.localIP().toString().c_str())); #else - Log.notice(F("HTTP: Server started @ http://%s"), String(Ethernet.localIP()).c_str()); + IPAddress ip; + ip = Ethernet.localIP(); + Log.notice(F("HTTP: Server started @ http://%d.%d.%d.%d"), ip[0], ip[1], ip[2], ip[3]); #endif } @@ -1691,8 +1693,8 @@ size_t httpClientWrite(const uint8_t * buf, size_t size) size_t bytes_sent = 0; while(bytes_sent < size) { if(!webServer.client()) return bytes_sent; - if(size - bytes_sent >= 4096) { - bytes_sent += webServer.client().write(buf + bytes_sent, 4096); + if(size - bytes_sent >= 2048) { + bytes_sent += webServer.client().write(buf + bytes_sent, 2048); } else { bytes_sent += webServer.client().write(buf + bytes_sent, size - bytes_sent); } diff --git a/src/hasp_mqtt.cpp b/src/hasp_mqtt.cpp index 735eda7b..4bb7ef38 100644 --- a/src/hasp_mqtt.cpp +++ b/src/hasp_mqtt.cpp @@ -354,7 +354,8 @@ void mqttReconnect() { String mac = halGetMacAddress(3, ""); mac.toLowerCase(); - snprintf_P(mqttNodeName, sizeof(mqttNodeName), PSTR("plate_%s"), mac.c_str()); + memset(mqttClientId, 0 ,sizeof(mqttClientId)); + snprintf_P(mqttClientId, sizeof(mqttClientId), PSTR("plate_%s"), mac.c_str()); Log.verbose(mqttClientId); }