From fccbd75ac336d8b2736af8fa389ba37bba0d0a31 Mon Sep 17 00:00:00 2001 From: Owen Date: Thu, 10 Mar 2022 14:44:26 +0100 Subject: [PATCH] mdns name and tooltips --- app_httpd.cpp | 3 ++- esp32-cam-webserver.ino | 18 +++++++++++------- index_other.h | 2 +- index_ov2640.h | 35 ++++++++++++++++++----------------- index_ov3660.h | 35 ++++++++++++++++++----------------- myconfig.sample.h | 22 +++++++++------------- storage.cpp | 15 +++++++++------ 7 files changed, 68 insertions(+), 62 deletions(-) diff --git a/app_httpd.cpp b/app_httpd.cpp index ee6851e..aeb50c1 100644 --- a/app_httpd.cpp +++ b/app_httpd.cpp @@ -606,7 +606,8 @@ static esp_err_t dump_handler(httpd_req_t *req){ // Footer d+= sprintf(d,"
\n"); d+= sprintf(d,"\n"); - d+= sprintf(d,"\n"); + d+= sprintf(d,"\n"); d+= sprintf(d,"\n"); d+= sprintf(d,"
\n\n"); // A javascript timer to refresh the page every minute. diff --git a/esp32-cam-webserver.ino b/esp32-cam-webserver.ino index 8ad88b5..03b1896 100644 --- a/esp32-cam-webserver.ino +++ b/esp32-cam-webserver.ino @@ -75,13 +75,19 @@ IPAddress gw; extern void startCameraServer(int hPort, int sPort); extern void serialDump(); -// A Name for the Camera. (set in myconfig.h) +// Names for the Camera. (set these in myconfig.h) #if defined(CAM_NAME) char myName[] = CAM_NAME; #else char myName[] = "ESP32 camera server"; #endif +#if defined(MDNS_NAME) + char mdnsName[] = MDNS_NAME; +#else + char mdnsName[] = "esp32-cam"; +#endif + // Ports for http and stream (override in myconfig.h) #if defined(HTTP_PORT) int httpPort = HTTP_PORT; @@ -138,7 +144,7 @@ char myVer[] PROGMEM = __DATE__ " @ " __TIME__; // Originally: config.xclk_freq_mhz = 20000000, but this lead to visual artifacts on many modules. // See https://github.com/espressif/esp32-camera/issues/150#issuecomment-726473652 et al. #if !defined (XCLK_FREQ_MHZ) - unsigned long xclk = 16; + unsigned long xclk = 8; #else unsigned long xclk = XCLK_FREQ_MHZ; #endif @@ -399,9 +405,7 @@ void WifiSetup() { #endif } - #if defined(HOSTNAME) - WiFi.setHostname(HOSTNAME); - #endif + WiFi.setHostname(mdnsName); // Initiate network connection request (3rd argument, channel = 0 is 'auto') WiFi.begin(bestSSID, stationList[bestStation].password, 0, bestBSSID); @@ -686,7 +690,7 @@ void setup() { // Port defaults to 3232 // ArduinoOTA.setPort(3232); // Hostname defaults to esp3232-[MAC] - ArduinoOTA.setHostname(myName); + ArduinoOTA.setHostname(mdnsName); // No authentication by default if (strlen(otaPassword) != 0) { ArduinoOTA.setPassword(otaPassword); @@ -722,7 +726,7 @@ void setup() { } else { Serial.println("OTA is disabled"); - if (!MDNS.begin(myName)) { + if (!MDNS.begin(mdnsName)) { Serial.println("Error setting up MDNS responder!"); } Serial.println("mDNS responder started"); diff --git a/index_other.h b/index_other.h index 6e8a284..1eda91e 100644 --- a/index_other.h +++ b/index_other.h @@ -36,7 +36,7 @@ const uint8_t index_simple_html[] = R"=====(