Skip to content

Commit

Permalink
Resolve all host names towards the ESP32 ip address using DNS, to mak…
Browse files Browse the repository at this point in the history
…e it point to the FW update page.
  • Loading branch information
bertrik committed Dec 23, 2021
1 parent 9fb486b commit c047903
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions LoraWanPmSensor.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@

// OTA
#include <WiFi.h>
#include <ESPmDNS.h>
#include <WiFiUdp.h>
#include <DNSServer.h>

#include "sds011.h"
#include "sps30.h"
Expand Down Expand Up @@ -134,6 +133,7 @@ static const int interval_table[] = {
16 // SF12
};

static DNSServer dnsServer;
static char board_name[32];
static fsm_state_t main_state;
static WebServer webServer(80);
Expand Down Expand Up @@ -718,6 +718,7 @@ void setup(void)
});
ElegantOTA.begin(&webServer);
webServer.begin();
dnsServer.start(53, "*", WiFi.softAPIP());
}

void loop(void)
Expand Down Expand Up @@ -796,5 +797,6 @@ void loop(void)

// run the OTA process
webServer.handleClient();
dnsServer.processNextRequest();
}

0 comments on commit c047903

Please sign in to comment.