Skip to content

Commit 9f8bfb3

Browse files
committed
Potential fix for hostname not working, #19
1 parent 329261a commit 9f8bfb3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/net_manager.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,13 @@ startClient()
113113

114114
WiFi.begin(esid.c_str(), epass.c_str());
115115
#ifdef ESP32
116+
WiFi.enableSTA(true);
116117
WiFi.setHostname(esp_hostname.c_str());
118+
DBUGVAR(WiFi.getHostname());
117119
#else
118120
WiFi.hostname(esp_hostname.c_str());
119-
#endif // !ESP32
120121
WiFi.enableSTA(true);
122+
#endif // !ESP32
121123
}
122124

123125
static void net_wifi_start()
@@ -136,6 +138,8 @@ static void net_wifi_start()
136138

137139
static void display_state()
138140
{
141+
DBUGVAR(WiFi.getHostname());
142+
139143
lcd_display(F("Hostname:"), 0, 0, 0, LCD_CLEAR_LINE);
140144
lcd_display(esp_hostname.c_str(), 0, 1, 5000, LCD_CLEAR_LINE);
141145

0 commit comments

Comments
 (0)