Skip to content

Commit b39746e

Browse files
committed
fix mdns crash
1 parent 9e230ea commit b39746e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ void setup()
229229
{
230230
// set the device name
231231
MDNS.begin(_settings.data.deviceName);
232+
MDNS.addService("http", "tcp", 80);
232233

233234
WiFi.hostname(_settings.data.deviceName);
234235

@@ -429,15 +430,14 @@ void setup()
429430
WebSerial.begin(&server);
430431

431432
server.begin();
432-
MDNS.addService("http", "tcp", 80);
433-
MDNS.update();
434433
}
435434
analogWrite(LED_PIN, 255);
436435
resetCounter(false);
437436
}
438437

439438
void loop()
440439
{
440+
MDNS.update();
441441
if (Update.isRunning())
442442
{
443443
workerCanRun = false;
@@ -446,7 +446,7 @@ void loop()
446446
if (WiFi.status() == WL_CONNECTED && workerCanRun)
447447
{ // No use going to next step unless WIFI is up and running.
448448
ws.cleanupClients(); // clean unused client connections
449-
MDNS.update();
449+
450450
mqttclient.loop(); // Check if we have something to read from MQTT
451451
epWorker(); // the loop worker
452452

0 commit comments

Comments
 (0)