Fix regression ESP8266 setting hostname

This commit is contained in:
Theo Arends 2021-07-05 17:11:03 +02:00
parent 512d912b77
commit 60fabf65a7
3 changed files with 5 additions and 3 deletions

View File

@ -14,10 +14,10 @@ All notable changes to this project will be documented in this file.
- ESP32 Ethernet Phy Type information to IDF v3+
- Allow buttons to work in AP normal mode (#12518)
- Enable Ping and rule features for any device compiled with more than 1M flash size (#12539)
- Setting hostname to fixing ArduinoESP32 core 2.0.0
### Fixed
- ESP32-C3 settings layout for configuration backup and restore
- ESP32 core v2.0.0 setting hostname
- Berry button handlers and error messages (#12521)
- Scripter and Display MQTT errors due to MQTT_DATA move to String (#12525)
- Scripter moving average and sml input validation (#12541)

View File

@ -109,13 +109,13 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo
- ESP32 Ethernet Phy Type information to IDF v3+
- Speed up initial GUI console refresh
- Enable UFILESYS, GUI_TRASH_FILE and GUI_EDIT_FILE for any device compiled with more than 1M flash size
- Setting hostname to fixing ArduinoESP32 core 2.0.0
- Simplified configuration for ir-full and removal of tasmota-ircustom [#12428](https://github.com/arendst/Tasmota/issues/12428)
- Refactor platformio [#12442](https://github.com/arendst/Tasmota/issues/12442)
- Allow buttons to work in AP normal mode [#12518](https://github.com/arendst/Tasmota/issues/12518)
- Enable Ping and rule features for any device compiled with more than 1M flash size [#12539](https://github.com/arendst/Tasmota/issues/12539)
### Fixed
- ESP32 core v2.0.0 setting hostname
- ESP32-C3 settings layout for configuration backup and restore
- DDS238-2 wrong reactive power value [#12283](https://github.com/arendst/Tasmota/issues/12283)
- ESP32 Webcam add boundary marker before sending mjpeg image [#12376](https://github.com/arendst/Tasmota/issues/12376)

View File

@ -116,7 +116,7 @@ void WifiSetMode(WiFiMode_t wifi_mode) {
if (WiFi.getMode() == wifi_mode) { return; }
if (wifi_mode != WIFI_OFF) {
WiFi.hostname(TasmotaGlobal.hostname); // Set hostname before WiFi.mode as needed for ESP32 core 2.0.0
WiFi.hostname(TasmotaGlobal.hostname); // ESP32 needs this here (before WiFi.mode) for core 2.0.0
// See: https://github.com/esp8266/Arduino/issues/6172#issuecomment-500457407
WiFi.forceSleepWake(); // Make sure WiFi is really active.
@ -187,6 +187,7 @@ void WifiBegin(uint8_t flag, uint8_t channel)
WiFi.persistent(false); // Solve possible wifi init errors (re-add at 6.2.1.16 #4044, #4083)
WiFi.disconnect(true); // Delete SDK wifi config
delay(200);
WifiSetMode(WIFI_STA); // Disable AP mode
WiFiSetSleepMode();
// if (WiFi.getPhyMode() != WIFI_PHY_MODE_11N) { WiFi.setPhyMode(WIFI_PHY_MODE_11N); } // B/G/N
@ -207,6 +208,7 @@ void WifiBegin(uint8_t flag, uint8_t channel)
if (Settings->ipv4_address[0]) {
WiFi.config(Settings->ipv4_address[0], Settings->ipv4_address[1], Settings->ipv4_address[2], Settings->ipv4_address[3]); // Set static IP
}
WiFi.hostname(TasmotaGlobal.hostname); // ESP8266 needs this here (after WiFi.mode)
char stemp[40] = { 0 };
if (channel) {