Skip to content

Commit

Permalink
fix mdns crash
Browse files Browse the repository at this point in the history
  • Loading branch information
softwarecrash committed Apr 11, 2024
1 parent c47d1e9 commit 9697716
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,9 @@ void setup()
{ request->send(418, "text/plain", "418 I'm a teapot"); });

// set the device name

MDNS.begin(settings.data.deviceName);
MDNS.addService("http", "tcp", 80);
if (MDNS.begin(settings.data.deviceName))
ws.onEvent(onEvent);
server.addHandler(&ws);
WebSerial.begin(&server);
Expand All @@ -418,6 +419,7 @@ void setup()

void loop()
{
MDNS.update();
if (Update.isRunning())
{
workerCanRun = false; // lockout, atfer true need reboot
Expand All @@ -434,8 +436,6 @@ void loop()
mqtttimer = 0;
}
ws.cleanupClients(); // clean unused client connections
MDNS.update();
// getJsonData();
mppClient.loop(); // Call the PI Serial Library loop
mqttclient.loop();
if ((haDiscTrigger || settings.data.haDiscovery) && measureJson(Json) > jsonSize)
Expand Down

0 comments on commit 9697716

Please sign in to comment.