Give the device a unique identifier on initial start
gclugston opened this issue · 1 comments
Not an issue rather a suggestion. My design considers several ESP8266 starting at the same time so I needed a way to uniquely identify each of them on startup, i.e. they needed unique SSID's when entering the initial config mode. So using the simple_server example, I modified the first few lines in Void.setup () first get the ESP chip id and concatenate it along with a unique hostName.
void setup(){
int hostNameint = (ESP.getChipId());
hostNamestr=String(hostNameint)+ "_My_SSID";
IAS.preSetDeviceName(hostNamestr); // preset deviceName this is also your MDNS responder: http://virginsoil.local
IAS.addField(hostName, "Hostname", 16);
The result is the following which appears on your available SSID's as the chip id plus a name you selected. Each device will display a different SSID in config mode so if you start several devices at once then you can identify them separately.
C O N F I G U R A T I O N M O D E
AP mode. Connect to Wifi AP "8774339_My_SSID"
And open 192.168.4.1
Cheers
Sorry, just noticed I was using an old example and this suggestion was already implemented in recent examples like IAS_Loader.