feat: set WiFi hostname to CrossPoint-Reader-XXXXXXXXXXXX (#1107)

## Summary

Replace the default esp32-XXXXXXXXXXXX hostname with
CrossPoint-Reader-AABBCCDDEEFF (full MAC address) so the device is
easily identifiable on the router's client list.
This commit is contained in:
Dexif
2026-02-23 21:00:16 +02:00
committed by GitHub
parent ae94e97fb8
commit bfdf0a4f78

View File

@@ -219,6 +219,12 @@ void WifiSelectionActivity::attemptConnection() {
WiFi.mode(WIFI_STA); WiFi.mode(WIFI_STA);
// Set hostname so routers show "CrossPoint-Reader-AABBCCDDEEFF" instead of "esp32-XXXXXXXXXXXX"
String mac = WiFi.macAddress();
mac.replace(":", "");
String hostname = "CrossPoint-Reader-" + mac;
WiFi.setHostname(hostname.c_str());
if (selectedRequiresPassword && !enteredPassword.empty()) { if (selectedRequiresPassword && !enteredPassword.empty()) {
WiFi.begin(selectedSSID.c_str(), enteredPassword.c_str()); WiFi.begin(selectedSSID.c_str(), enteredPassword.c_str());
} else { } else {