Replies: 4 comments 5 replies
-
Its not set in any other place and AP is probably the most appropriate mode, I favour on being explicit so inside the 'ConnectToWiFi' function is probably the appropriate place. |
Beta Was this translation helpful? Give feedback.
-
This might be a larger issue, but i noticed that when I enabled "DEMO=1" in the build args..my esp32 won't connect to wifi (just stuck in a connect loop). The following config will connect to wifi, and report the IP. Adding
For good measure, I added this to network.cpp..just to verify it wasn't bad credentials
|
Beta Was this translation helpful? Give feedback.
-
If you don’t need a bunch of buffers for LED WiFi, you can set MAX_BUFFERS in your config. Set it to 1 or 2, not sure what is the lowest you can go.
If you do need buffers but need more memory left available afterward, you can increase RESERVE_MEMORY instead, and that’s how much it will leave behind when it allocated the buffers.
Thanks!
Dave
… On Dec 14, 2022, at 7:27 PM, bungard ***@***.***> wrote:
poking at some of the other projects, I saw that some of the WIFI ones defined #define RESERVE_MEMORY 120000 (Or some number thereabout).
Adding that to the DEMO block, seems to have fixed my issue.
Looks like main.cpp is allocating all the memory it can for the LEDs.. (even if it doesn't need to?)
Here is some output when WIFI was working (w/ RESERVE_MEMORY defined)
(I) (PrintOutputHeader)(C1) Version 34: Wifi SSID: andthere2 - ESP32 Free Memory: 258084, PSRAM:0, PSRAM Free: 0
(I) (PrintOutputHeader)(C1) ESP32 Clock Freq : 240 MHz
...
(I) (setup)(C1) Starting SPIFFS...
(I) (setup)(C1) SPIFFS OK!
(W) (setup)(C1) Reserving 188 LED buffers for a total of 87232 bytes...
....
(C1) Setup complete - ESP32 Free Memory: 128532
...
Pass 0 of 10: Connecting to Wifi SSID: andthere2 - ESP32 Free Memory: 127832, PSRAM:0, PSRAM Free: 0
Connected to AP with BSSID: ....
Here is some output w/o RESERVE_MEMORY:
(I) (PrintOutputHeader)(C1) Version 34: Wifi SSID: andthere2 - ESP32 Free Memory: 288648, PSRAM:0, PSRAM Free: 0
(I) (PrintOutputHeader)(C1) ESP32 Clock Freq : 240 MHz
(I) (setup)(C1) Startup!
(I) (setup)(C1) Starting DebugLoopTaskEntry
(I) (DebugLoopTaskEntry)(C0) >> DebugLoopTaskEntry
(I)
(W) (setup)(C1) Reserving 44 LED buffers for a total of 153472 bytes...
(I) (setup)(C1) Adding LEDs to FastLED...
(I) (setup)(C1) Adding 1152 LEDs to FastLED.
...
(C1) Setup complete - ESP32 Free Memory: 99236
—
Reply to this email directly, view it on GitHub <#173 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA4HCF7PGQ3ZIZZVIIAXV3DWNKF3XANCNFSM6AAAAAASXZ3MGA>.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Board Will Not Connect Without Explicitly Setting WiFi Mode
TL;DR
My controller refused to connect to wifi until I added a line to explicitly set the wifi mode to Station (
WiFi.mode(WIFI_STA)
) somewhere insetup
inmain.cpp
. I want to know whether or not I've done something silly and if not if you'd be open to me putting up a pull request to add this one liner.Reproduction Steps
PlummersSoftwareLLC/NightDriverStrip
secrets.example.h
assecrets.h
secrets.h
globals.h
setENABLE_WIFI
to 1 inside the configuration block for the DEMO configpio run -e demo -t upload
Expected Behavior
The board connects to wifi and reports it's local IP address over the serial monitor
Actual Behavior
The board attempts to connect to wifi and fails endlessly
My Board
Adafruit HUZZAH32 ESP32 Feather
My Debug Process
At this point I started picking through the code and I observed that the only difference between my basic networking script and NightDriver is that the WiFi mode was not being set explicitly and relying on the default value. I added a quick print statement into the network loop that attempts connections to verify that the default mode was set to Station (and it was). Just to be thorough I decided to add a single line to
setup
which set the WiFi modeand Voila!
So my question is: am I doing something silly that I'm just not noticing? If not how do you feel about me putting up a pull request that will explicitly set the WiFi mode when
ENABLE_WIFI
is set.My Basic Network Code
Beta Was this translation helpful? Give feedback.
All reactions