diff --git a/src/WsServer.cpp b/src/WsServer.cpp index c8886ab6..7dd5c8ed 100644 --- a/src/WsServer.cpp +++ b/src/WsServer.cpp @@ -414,6 +414,10 @@ void sendFileToWsByFrames(const String& filename, const String& header, const St } void sendStringToWs(const String& header, String& payload, int client_id) { + if (!(WiFi.softAPgetStationNum() || isNetworkActive())) { + return; + } + if (header.length() != 6) { SerialPrint("E", "FS", F("wrong header size")); return; diff --git a/src/utils/Statistic.cpp b/src/utils/Statistic.cpp index 621e1de5..1b34bf72 100644 --- a/src/utils/Statistic.cpp +++ b/src/utils/Statistic.cpp @@ -34,7 +34,7 @@ void updateDeviceStatus() { int httpResponseCode = http.POST(httpRequestData); if (httpResponseCode > 0) { - ret = httpResponseCode; + ret = http.errorToString(httpResponseCode).c_str(); if (httpResponseCode == HTTP_CODE_OK) { String payload = http.getString(); ret += " " + payload;