minor fix stm32 mqttClientID/http IP address

This commit is contained in:
arovak 2020-05-07 14:27:11 +02:00
parent a425d6400a
commit 4d905297cd
3 changed files with 8 additions and 5 deletions

@ -1 +1 @@
Subproject commit 9f67a12548bf5e7a959b0e668a9f6f2c43f3e8e3
Subproject commit 5f739643f4b22254f5742504fcda3b7de50fb88b

View File

@ -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);
}

View File

@ -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);
}