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 9e230ea commit b39746e
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 @@ -229,6 +229,7 @@ void setup()
{
// set the device name
MDNS.begin(_settings.data.deviceName);
MDNS.addService("http", "tcp", 80);

WiFi.hostname(_settings.data.deviceName);

Expand Down Expand Up @@ -429,15 +430,14 @@ void setup()
WebSerial.begin(&server);

server.begin();
MDNS.addService("http", "tcp", 80);
MDNS.update();
}
analogWrite(LED_PIN, 255);
resetCounter(false);
}

void loop()
{
MDNS.update();
if (Update.isRunning())
{
workerCanRun = false;
Expand All @@ -446,7 +446,7 @@ void loop()
if (WiFi.status() == WL_CONNECTED && workerCanRun)
{ // No use going to next step unless WIFI is up and running.
ws.cleanupClients(); // clean unused client connections
MDNS.update();

mqttclient.loop(); // Check if we have something to read from MQTT
epWorker(); // the loop worker

Expand Down

0 comments on commit b39746e

Please sign in to comment.