Skip to content

Commit 3241d90

Browse files
committed
Merge pull request #831 from pgollor/SPIFFS-OTA
Sorry i added maginal changes after your merge from #802
2 parents ef26c5f + fd2f7b4 commit 3241d90

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

hardware/esp8266com/esp8266/libraries/ESP8266mDNS/examples/OTA-mDNS-SPIFFS/OTA-mDNS-SPIFFS.ino

+7-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* @brief mDNS and OTA Constants
1818
* @{
1919
*/
20-
#define HOSTNAME "ESP8266-ota" ///< Hostename
20+
#define HOSTNAME "ESP8266-OTA-" ///< Hostename. The setup function adds the Chip ID at the end.
2121
#define APORT 8266 ///< Port for OTA update
2222
/// @}
2323

@@ -207,7 +207,11 @@ void setup()
207207
Serial.println(ESP.getChipId(), HEX);
208208

209209
// Set Hostname.
210-
WiFi.hostname(HOSTNAME);
210+
String hostname(HOSTNAME);
211+
hostname += String(ESP.getChipId(), HEX);
212+
WiFi.hostname(hostname);
213+
214+
// Print hostname.
211215
Serial.print("hostname: ");
212216
Serial.println(WiFi.hostname());
213217

@@ -296,7 +300,7 @@ void setup()
296300
}
297301

298302
// Initialize mDNS service.
299-
MDNS.begin(HOSTNAME);
303+
MDNS.begin(hostname.c_str());
300304

301305
// ... Add OTA service.
302306
MDNS.addService("arduino", "tcp", APORT);

hardware/esp8266com/esp8266/tools/espota.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def parser():
123123
group.add_option("-p", "--port",
124124
dest = "esp_port",
125125
type = "int",
126-
help = "ESP8266 ota Port.",
126+
help = "ESP8266 ota Port. Default 8266",
127127
default = 8266
128128
)
129129
parser.add_option_group(group)

0 commit comments

Comments
 (0)