mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-03 08:30:45 +00:00
mDNS server http://meshtastic.local
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "meshwifi/meshhttp.h"
|
||||
#include "target_specific.h"
|
||||
#include <DNSServer.h>
|
||||
#include <ESPmDNS.h>
|
||||
#include <WiFi.h>
|
||||
|
||||
static void WiFiEvent(WiFiEvent_t event);
|
||||
@@ -18,7 +19,7 @@ static WiFiServerPort *apiPort;
|
||||
uint8_t wifiDisconnectReason = 0;
|
||||
|
||||
// Stores our hostname
|
||||
static char ourHost[16];
|
||||
char ourHost[16];
|
||||
|
||||
bool isWifiAvailable()
|
||||
{
|
||||
@@ -63,7 +64,6 @@ void initWifi()
|
||||
|
||||
createSSLCert();
|
||||
|
||||
|
||||
if (radioConfig.has_preferences) {
|
||||
const char *wifiName = radioConfig.preferences.wifi_ssid;
|
||||
const char *wifiPsw = radioConfig.preferences.wifi_password;
|
||||
@@ -117,12 +117,23 @@ void initWifi()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!MDNS.begin( "Meshtastic" )) {
|
||||
DEBUG_MSG("Error setting up MDNS responder!\n");
|
||||
|
||||
while (1) {
|
||||
delay(1000);
|
||||
}
|
||||
}
|
||||
DEBUG_MSG("mDNS responder started\n");
|
||||
DEBUG_MSG("mDNS Host: Meshtastic.local\n");
|
||||
MDNS.addService("http", "tcp", 80);
|
||||
MDNS.addService("https", "tcp", 443);
|
||||
|
||||
} else
|
||||
DEBUG_MSG("Not using WIFI\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void initApiServer()
|
||||
{
|
||||
// Start API server on port 4403
|
||||
|
||||
Reference in New Issue
Block a user