mDNS: Advertise pio_env (for OTA scripts)

This commit is contained in:
Austin Lane 2025-10-10 17:02:50 -04:00
parent fe2e2753aa
commit 018e9eb894

View File

@ -95,10 +95,12 @@ static void onNetworkConnected()
#ifdef ARCH_ESP32 #ifdef ARCH_ESP32
MDNS.addServiceTxt("meshtastic", "tcp", "shortname", String(owner.short_name)); MDNS.addServiceTxt("meshtastic", "tcp", "shortname", String(owner.short_name));
MDNS.addServiceTxt("meshtastic", "tcp", "id", String(nodeDB->getNodeId().c_str())); MDNS.addServiceTxt("meshtastic", "tcp", "id", String(nodeDB->getNodeId().c_str()));
MDNS.addServiceTxt("meshtastic", "tcp", "pio_env", optstr(APP_ENV));
// ESP32 prints obtained IP address in WiFiEvent // ESP32 prints obtained IP address in WiFiEvent
#elif defined(ARCH_RP2040) #elif defined(ARCH_RP2040)
MDNS.addServiceTxt("meshtastic", "shortname", owner.short_name); MDNS.addServiceTxt("meshtastic", "shortname", owner.short_name);
MDNS.addServiceTxt("meshtastic", "id", nodeDB->getNodeId().c_str()); MDNS.addServiceTxt("meshtastic", "id", nodeDB->getNodeId().c_str());
MDNS.addServiceTxt("meshtastic", "pio_env", optstr(APP_ENV));
LOG_INFO("Obtained IP address: %s", WiFi.localIP().toString().c_str()); LOG_INFO("Obtained IP address: %s", WiFi.localIP().toString().c_str());
#endif #endif
} }