dl9rdz / rdz_ttgo_sonde

270 stars 94 forks source link

dhcp hostname does not reflect configured device name #315

Closed mmadela closed 1 year ago

mmadela commented 2 years ago

when the code asks for IP address, it uses hardcoded hostname (from library) esp32-arduino not the configurable network mDNS name, this makes finding proper device more difficult, when multicast is not available. An easy fix (below) propagates the configurable name also to the DHCP server (and further down to DNS server).

--- a/RX_FSK/RX_FSK.ino
+++ b/RX_FSK/RX_FSK.ino
@@ -1902,6 +1902,8 @@ void setup()
   Serial.println("Reading initial configuration");
   setupConfigData();    // configuration must be read first due to OLED ports!!!

+  WiFi.setHostname(sonde.config.mdnsname);
+
   // NOT TTGO v1 (fingerprint 64) or Heltec v1/v2 board (fingerprint 4)
   // and NOT TTGO Lora32 v2.1_1.6 (fingerprint 31/63)
   if ( ( (sonde.fingerprint & (64 + 31)) != 31) && ((sonde.fingerprint & 16) == 16) ) {
dl9rdz commented 1 year ago

Ok, this enhancement made it in the latest devel (20220930), thanks for the suggestion.