Skip to content

Commit

Permalink
unique deviceName only for esp8266
Browse files Browse the repository at this point in the history
  • Loading branch information
Onno-Dirkzwager committed Sep 15, 2018
1 parent 0224004 commit 4f2a4bc
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions examples/Wemos/Wemos-Shield-DHT/Wemos-Shield-DHT.ino
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ IOTAppStory IAS(COMPDATE, MODEBUTTON); // Initialize IotAppStor


// ================================================ VARS =================================================
String deviceName = "tempsensor-";
String chipId = "";
String deviceName = "tempsensor";

int tempEntry;
float h, t, f, hic, hif;
Expand Down Expand Up @@ -90,9 +89,11 @@ void setup() {
display.display();


chipId = String(ESP.getChipId()); // creat a unique deviceName for classroom situations (deviceName-123)
chipId = chipId.substring(chipId.length()-3);
deviceName += chipId;
#if defined ESP8266
String chipId = String(ESP.getChipId()); // creat a unique deviceName for classroom situations (deviceName-123)
chipId = "-"+chipId.substring(chipId.length()-3);
deviceName += chipId;
#endif

IAS.preSetDeviceName(deviceName); // preset Boardname this is also your MDNS responder: http://deviceName.local

Expand Down

0 comments on commit 4f2a4bc

Please sign in to comment.