mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-29 07:32:18 +03:00
progress
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -7,5 +7,6 @@ void SerialPrint(String errorLevel, String module, String msg) {
|
|||||||
String tosend = prettyMillis(millis()) + " [" + errorLevel + "] [" + module + "] " + msg;
|
String tosend = prettyMillis(millis()) + " [" + errorLevel + "] [" + module + "] " + msg;
|
||||||
|
|
||||||
Serial.println(tosend);
|
Serial.println(tosend);
|
||||||
ws.textAll(tosend);
|
// mqttRootDevice +
|
||||||
|
ws.textAll("/core/" + tosend);
|
||||||
}
|
}
|
||||||
@@ -122,10 +122,11 @@ void onWsEvent(AsyncWebSocket *server, AsyncWebSocketClient *client, AwsEventTyp
|
|||||||
// choose_log_date_and_send(); // функцию выгрузки архива с графиком я не сделал. Забираю при выгрузке по MQTT
|
// choose_log_date_and_send(); // функцию выгрузки архива с графиком я не сделал. Забираю при выгрузке по MQTT
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info->opcode == WS_TEXT)
|
if (info->opcode == WS_TEXT) {
|
||||||
client->text("{}");
|
// client->text("{}");
|
||||||
else
|
} else {
|
||||||
client->binary("{}");
|
// client->binary("{}");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// message is comprised of multiple frames or the frame is split into multiple packets
|
// message is comprised of multiple frames or the frame is split into multiple packets
|
||||||
if (info->index == 0) {
|
if (info->index == 0) {
|
||||||
@@ -206,7 +207,7 @@ void initWS() {
|
|||||||
ws.onEvent(onWsEvent);
|
ws.onEvent(onWsEvent);
|
||||||
server.addHandler(&ws);
|
server.addHandler(&ws);
|
||||||
events.onConnect([](AsyncEventSourceClient *client) {
|
events.onConnect([](AsyncEventSourceClient *client) {
|
||||||
client->send("", NULL, millis(), 1000);
|
// client->send("", NULL, millis(), 1000);
|
||||||
});
|
});
|
||||||
server.addHandler(&events);
|
server.addHandler(&events);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user