Skip to content

Commit

Permalink
Set hostname on ESP32 also when using WiFi; allow URL-command /W also…
Browse files Browse the repository at this point in the history
… when not using webserver functionality
  • Loading branch information
fredlcore committed Jan 6, 2025
1 parent 2d56e8e commit 07043c5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion BSB_LAN/BSB_LAN.ino
Original file line number Diff line number Diff line change
Expand Up @@ -4899,7 +4899,7 @@ void loop() {
}

//Send HTML pages without header and footer (For external interface)
if (webserver && p[1]=='W') {
if (p[1]=='W') {
p++;
httpflags |= HTTP_FRAG;
}
Expand Down Expand Up @@ -7759,6 +7759,7 @@ active_cmdtbl_size = sizeof(cmdtbl)/sizeof(cmdtbl[0]);
// Workaround for problems connecting to wireless network on some ESP32, see here: https://github.com/espressif/arduino-esp32/issues/2501#issuecomment-731618196
esp_wifi_disconnect(); //disconnect form wifi to set new wifi connection
WiFi.mode(WIFI_STA); //init wifi mode
if (mDNS_hostname[0]) WiFi.setHostname(mDNS_hostname);
esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW_HT20); // W.Bra. 23.03.23 HT20 - reduce bandwidth from 40 to 20 MHz. In 2.4MHz networks, this will increase speed and stability most of the time, or will at worst result in a roughly 10% decrease in transmission speed.

printToDebug("Setting up WiFi interface");
Expand Down

0 comments on commit 07043c5

Please sign in to comment.