Skip to content

Commit

Permalink
WiFi buffer counts are no longer hardcoded in the WiFi library
Browse files Browse the repository at this point in the history
  • Loading branch information
MitchBradley committed Jun 30, 2023
1 parent 26f4bb1 commit d095a95
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions FluidNC/src/WebUI/WifiConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,18 @@ namespace WebUI {
if ((WiFi.getMode() == WIFI_AP) || (WiFi.getMode() == WIFI_AP_STA)) {
WiFi.softAPdisconnect();
}

WiFi.enableAP(false);

// Set the number of receive and transmit buffers that the
// WiFi stack can use. Making these numbers too large
// can eat up a lot of memory at 1.6K per buffer. It
// can be especially bad when there are many dynamic buffers,
// allowing external network traffic to use a lot of the heap.
// The bawin parameters are for AMPDU aggregation.
// rx: static dynamic bawin tx: static dynamic bawin cache
WiFi.setBuffers(4, 2, 0, 4, 0, 0, 4);

//SSID
const char* SSID = wifi_sta_ssid->get();
if (strlen(SSID) == 0) {
Expand Down
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ bt_deps =
BluetoothSerial
wifi_deps =
arduinoWebSockets=https://github.com/MitchBradley/arduinoWebSockets#canSend
WiFi=https://github.com/MitchBradley/WiFi#d412cd7
WiFi=https://github.com/MitchBradley/WiFi#52da841
; If we include the following explicit dependencies when we get the
; Arduino framework code from github, platformio picks up different
; and incompatible versions of these libraries from who knows where,
Expand Down

0 comments on commit d095a95

Please sign in to comment.