Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/esptool.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ You should see something like this:
Leaving...
Hard resetting via RTS pin...

Now pull the ESP-01's GPIO_0 pin high and reset it. If the new firmware was flashed successfully, it will start broadcasting an SSID called "PSLab".
Now pull the ESP-01's GPIO_0 pin high and reset it. If the new firmware was flashed successfully, it will start broadcasting an SSID starting with "PSLab_" followed by the last three octets of the MAC address of the ESP-01 (e.g. "PSLab_0DCE2F").
17 changes: 15 additions & 2 deletions src/ESP01Firmware/ESP01Firmware.ino
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void setup() {

WiFi.setSleepMode(WIFI_NONE_SLEEP);

WiFi.softAP(ssid, password);
WiFi.softAP(ssid + get_suffix(), password);

server.begin();
}
Expand All @@ -35,4 +35,17 @@ void loop() {
}
client.stop();
}
}
}

/**
* @brief Return a suffix based on the NIC specific part of the MAC address
*
* @return The final three octets of the MAC address, prefixed with underscore
*/
String get_suffix() {
// Remove vendor ID
String mac = WiFi.macAddress().substring(9, 17);
// Remove colons
mac.replace(":", "");
return "_" + mac;
}