Skip to content

Commit

Permalink
ESP8266: Using full mac address as ID to prevent duplicate with a bat…
Browse files Browse the repository at this point in the history
…ch of chip.
  • Loading branch information
dzungpv committed Nov 26, 2023
1 parent 6ff07df commit a27f309
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ unsigned long requestWifiScanTime = 0;
#define WIFI_SCAN_PERIOD 120000
unsigned lastWifiScanMillis;

const PROGMEM char *m2mqtt_version = "2023.11.2";
const PROGMEM char *m2mqtt_version = "2023.11.3";

// Define global variables for files
#ifdef ESP32
Expand Down
5 changes: 3 additions & 2 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2615,9 +2615,10 @@ String getId()
snprintf(chipID, 23, "%llX", ESP.getEfuseMac());
return String(chipID);
#else
uint32_t chipID = ESP.getChipId();
String chipID = WiFi.macAddress();
chipID.replace(":", "");
return chipID;
#endif
return String(chipID, HEX);
}

// Check if header is present and correct
Expand Down

0 comments on commit a27f309

Please sign in to comment.