Skip to content

Sorry i added maginal changes after your merge from https://github.com/esp8266/Arduino/pull/802 #831

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 29, 2015
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* @brief mDNS and OTA Constants
* @{
*/
#define HOSTNAME "ESP8266-ota" ///< Hostename
#define HOSTNAME "ESP8266-OTA-" ///< Hostename. The setup function adds the Chip ID at the end.
#define APORT 8266 ///< Port for OTA update
/// @}

Expand Down Expand Up @@ -207,7 +207,11 @@ void setup()
Serial.println(ESP.getChipId(), HEX);

// Set Hostname.
WiFi.hostname(HOSTNAME);
String hostname(HOSTNAME);
hostname += String(ESP.getChipId(), HEX);
WiFi.hostname(hostname);

// Print hostname.
Serial.print("hostname: ");
Serial.println(WiFi.hostname());

Expand Down Expand Up @@ -296,7 +300,7 @@ void setup()
}

// Initialize mDNS service.
MDNS.begin(HOSTNAME);
MDNS.begin(hostname.c_str());

// ... Add OTA service.
MDNS.addService("arduino", "tcp", APORT);
Expand Down
2 changes: 1 addition & 1 deletion hardware/esp8266com/esp8266/tools/espota.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def parser():
group.add_option("-p", "--port",
dest = "esp_port",
type = "int",
help = "ESP8266 ota Port.",
help = "ESP8266 ota Port. Default 8266",
default = 8266
)
parser.add_option_group(group)
Expand Down