Replies: 16 comments 9 replies
-
The “failed to start task” is pretty serious - can you get any further context or info about what is failing or why? That’s not our code, either, it’s in the AsyncTCP class, so perhaps it’s a low memory situaton?
The ESP32 framework gets a little more memory hungry with each release. I used to have 43 buffers, now it’s more like 23. And if you push RAM too low, WiFi gets sporadic or crashes.
Can you check up earlier in the log to ensure that spiffs starts up correctly?
- Dave
… On Dec 1, 2022, at 1:02 PM, Sean Coates ***@***.***> wrote:
Hi.
I think I've read through the other web server discussion threads and my problem seems to be unique.
I've got the demo environment project running on my LOLIN32 ESP32 board. The lights are fading through their rainbows nicely, but I can't seem to get the web server to respond. Upon boot, I see this in the serial log:
…
(W) (ConnectToWiFi)(C0) Received IP: 192.168.146.225
(I) (ConnectToWiFi)(C0) Starting/restarting Socket Server...
(I) (ConnectToWiFi)(C0) Socket server started.
(I) (ConnectToWiFi)(C0) Setting Clock...
[ 5166][E][WiFiUdp.cpp:219] parsePacket(): could not receive data: 9
(I) (ConnectToWiFi)(C0) Starting Web Server...
(I) (begin)(C0) Connecting Web Endpoints
[ 5479][E][AsyncTCP.cpp:1251] begin(): failed to start task
(I) (begin)(C0) HTTP server started
(I) (ConnectToWiFi)(C0) Web Server begin called!
…
And when I try to connect (curl 192.168.146.225): I get a TCP connection refused.
curl: (7) Failed to connect to 192.168.146.225 port 80 after 218 ms: Connection refused
I do have the buildfs and uploadfs files uploaded (after having to tweak the partitions as I found in another thread:
nvs, data, nvs, 0x009000, 0x005000,
otadata, data, ota, 0x00e000, 0x002000,
app0, app, ota_0, 0x010000, 0x150000,
app1, app, ota_1, 0x160000, 0x150000,
storage, data, spiffs, 0x2B0000, 0x150000
I do get ping replies from the IP, and it is the correct IP address.
Any ideas of where to look next? Thanks!
—
Reply to this email directly, view it on GitHub <#168>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA4HCF6WESSAMTPAR3KUZ3DWLEG5PANCNFSM6AAAAAASRGY72U>.
You are receiving this because you are subscribed to this thread.
|
Beta Was this translation helpful? Give feedback.
-
Hi. Thanks for the reply. Since you're replying by email, maybe the edits weren't sent (GitHub handles email like that, I believe). Here's a log excerpt though (I unplugged and replugged the USB cable while doing a
If it's helpful for me to do a DEBUG build, I can try that, too, but I didn't want to exhaust RAM any more than necessary. |
Beta Was this translation helpful? Give feedback.
-
I’m on a mental debugging roll this week, so maybe I’ll ge lucky again. Is it possible that you have enabled the web server but not WAIT_FOR_WIFI (or whatever it’s called)? If the setup() code doesn’t block and wait for WiFi, the web server won’t be able to start.
The sock that receives color data over WiFi can start up later, but the inits for the web server and so on are only called up front when the task is created, so if there’s no network, maybe it bails?
- Dave
… On Dec 1, 2022, at 1:55 PM, Sean Coates ***@***.***> wrote:
Hi. Thanks for the reply. Since you're replying by email, maybe the edits weren't sent (GitHub handles email like that, I believe).
Here's a log excerpt though (I unplugged and replugged the USB cable while doing a pio device monitor -e demo):
(I) (loop)(C1) IP: 192.168.146.225, Mem: 47200 LargestBlk: 44020 PSRAM Free: 0/0 Buffer: 0/500 LED FPS: 58, LED Watt: 4, LED Brite: 100%, CPU: 01%, 00%, FreeDraw: 0.005085
Disconnected (read failed: [Errno 6] Device not configured)
Reconnecting to /dev/cu.usbserial-2420 ....
Please build project in debug configuration to get more details about an exception.
See https://docs.platformio.org/page/projectconf/build_configurations.html
Connected!
(I) (setup)(C1) SPIFFS OK!
(I) (setup)(C1) Could allocate 713 buffers but limiting it to 500
(I)
(W) (setup)(C1) Reserving 500 LED buffers for a total of 91000 bytes...
(I) (setup)(C1) Adding LEDs to FastLED...
(I) (setup)(C1) Adding 50 LEDs to FastLED.
(I) (setup)(C1) Initializing effects manager...
(I) (setup)(C1) Launching Drawing:
(E) (setup)(C1) Heap before launch: PASS
(I) (DrawLoopTaskEntry)(C1) >> DrawLoopTaskEntry
(I)
(I) (setup)(C1) Calling ConnectToWifi()
(I)
(I) (ConnectToWiFi)(C1) Setting host name to treestrip...
Pass 0 of 99: Connecting to Wifi SSID: Dementors - ESP32 Free Memory: 124016, PSRAM:0, PSRAM Free: 0
(W) (ConnectToWiFi)(C1) Received IP: 192.168.146.225
(I) (ConnectToWiFi)(C1) Starting/restarting Socket Server...
(I) (ConnectToWiFi)(C1) Socket server started.
(I) (ConnectToWiFi)(C1) Setting Clock...
[ 6449][E][WiFiUdp.cpp:219] parsePacket(): could not receive data: 9
(I) (ConnectToWiFi)(C1) Starting Web Server...
(I) (begin)(C1) Connecting Web Endpoints
(I) (begin)(C1) HTTP server started
(I) (ConnectToWiFi)(C1) Web Server begin called!
(I) (NetworkHandlingLoopEntry)(C0) >> NetworkHandlingLoopEntry
(I)
etupI) (setup)(C1) Setup complete - ESP32 Free Memory: 48012
(I)
(I) (loop)(C1) IP: 192.168.146.225, Mem: 47980 LargestBlk: 44020 PSRAM Free: 0/0 Buffer: 0/500 LED FPS: 58, LED Watt: 3, LED Brite: 100%, CPU: 02%, 00%, FreeDraw: 0.005083
If it's helpful for me to do a DEBUG build, I can try that, too, but I didn't want to exhaust RAM any more than necessary.
—
Reply to this email directly, view it on GitHub <#168 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA4HCFY4GB2STXXCJ3H4MMLWLENEDANCNFSM6AAAAAASRGY72U>.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
-
Ah, yes, I did initially have it disabled, but enabled it. I edited my question above. I'll post the whole thing (the edits) here: …
Edit more info: I do have #if DEMO
// This is a simple demo configuration. To build, simply connect the data lead from a WS2812B
// strip to pin 5. This does not use the OLED, LCD, or anything fancy, it simply drives the
// LEDs with a simple rainbow effect as specified in effects.cpp for DEMO.
//
// Please ensure you supply sufficent power to your strip, as even the DEMO of 144 LEDs, if set
// to white, would overload a USB port.
#define MATRIX_WIDTH 50
#define MATRIX_HEIGHT 1
#define NUM_LEDS (MATRIX_WIDTH*MATRIX_HEIGHT)
#define NUM_CHANNELS 1
#define NUM_RINGS 5
#define RING_SIZE_0 24
#define ENABLE_AUDIO 0
#define POWER_LIMIT_MW 5000 // 12 * 10 * 1000 // 10 amp supply at 5 volts assumed
// Once you have a working project, selectively enable various additional features by setting
// them to 1 in the list below. This DEMO config assumes no audio (mic), or screen, etc.
#define ENABLE_WIFI 1 // Connect to WiFi
#define INCOMING_WIFI_ENABLED 1 // Accepting incoming color data and commands
#define TIME_BEFORE_LOCAL 10 // How many seconds before the lamp times out and shows local content
#define ENABLE_NTP 1 // Set the clock from the web
#define ENABLE_OTA 0 // Accept over the air flash updates
#if M5STICKC || M5STICKCPLUS
#define LED_PIN0 32
#else
#define LED_PIN0 25
#endif
// The webserver serves files from its SPIFFS filesystem, such as index.html, and those files must be
// uploaded to SPIFFS with the "Upload Filesystem Image" command before it can work. When running
// you should be able to see/select the list of effects by visiting the chip's IP in a browser. You can
// get the chip's IP by watching the serial output or checking your router for the DHCP given to 'LEDWifi'
#define ENABLE_WEBSERVER 1 // Turn on the internal webserver …and I do have the board set up correctly in [env:demo]
board = lolin32
monitor_speed = 115200
upload_speed = 115200
upload_port = /dev/tty.usbserial-2420 ; This will vary by machine and may not be needed if you have a single ESP attached
build_flags = -DDEMO=1
-std=gnu++17
-Dregister= ; Sinister: redefine 'register' so FastLED can use that keyword under C++17
-Ofast Edit more: I tried setting
Curl doesn't get connection refused now, but it just times out:
|
Beta Was this translation helpful? Give feedback.
-
I dug in a little deeper and changed my board ID to I get rainbow-fading lights, but I still can't get HTTP on
Here's the full log from build + monitor:
|
Beta Was this translation helpful? Give feedback.
-
I ran into the same problem on 'esp32doit-devkit-v1', It has nothing to do with the Spiffs. For me it fails after Wifi enable and starting any of the WebServer or NTP or OTA services. I've tried 2 other DOIT ESP32 boards and same issue.. still trying to debug it. An aside-note on this, I experience Wifi disconnects after a few minutes of use, To be fair it was not actually being used so this might be an optimisation. I don't think they are related because the above is ms apart. Delay 5s between Wifi connect and service startup also didn't help. "" #define ENABLE_WEBSERVER 1 // Turn on the internal webserver |
Beta Was this translation helpful? Give feedback.
-
@ Scoates Your project is working or not ?? (I) (ConnectToWiFi)(C1) Setting host name to NightDriverstrip... |
Beta Was this translation helpful? Give feedback.
-
Are you uploading via Platform IO 'Upload Filesystem Image'? |
Beta Was this translation helpful? Give feedback.
-
FYI RESERVE_MEMORY && MAX_BUFFERS fixed my issue. NTP is still a problem on parse but everything locally starts correctly. Also noticed the main.js.gz has hard-coded 192.168.8.* which needs to be removed to retrieve local effects. |
Beta Was this translation helpful? Give feedback.
-
Uploaded Filesystem Image is SUCCESS. But can't access to 192.168.150.91 |
Beta Was this translation helpful? Give feedback.
-
Thank you " [MatthewvanBuuren]" for suggest. And tried to spectrum project is same. You some more ideas?. |
Beta Was this translation helpful? Give feedback.
-
Looks right offhand! Methinks you’ll have to do some debugging in, studying of, or adding log messages to the begin() call to see what’s failing.
But maybe it’s just low memory. I’d try RESERVE_MEMORY of 200K. You won’t have many buffers, but that may not be important to your case.
I’ve only run the web server under the spectrum project, which is a matrix. But the config for it looks very similar to what you’re doing.
You might also want to, in a separate folder, try running the Spectrum project on an M5+ if you have one (or even on something else, it should still work). Then see if the web server works, irrespective of the fact you don’t have a matrix connected. That’d be a data point!
Thanks,
Dave
… On Dec 17, 2022, at 1:05 PM, Matthew van Buuren ***@***.***> wrote:
#define ENABLE_WIFI 1 // Connect to WiFi
#define INCOMING_WIFI_ENABLED 1 // Accepting incoming color data and commands
#define WAIT_FOR_WIFI 1 // Hold in setup until we have WiFi - for strips without effects
#define TIME_BEFORE_LOCAL 2 // How many seconds before the lamp times out and shows local content
#define ENABLE_WEBSERVER 1 // Turn on the internal webserver
#define ENABLE_NTP 0 // Set the clock from the web -> Still getting a parsePacket(): could not receive data: 9.
#define ENABLE_OTA 1
#define ENABLE_REMOTE 0
#define ENABLE_AUDIO 0
#define MATRIX_WIDTH 144
#define MATRIX_HEIGHT 1
#define NUM_LEDS (MATRIX_WIDTH*MATRIX_HEIGHT)
#define NUM_CHANNELS 1
#define NUM_RINGS 0
#define RING_SIZE_0 0
#define RESERVE_MEMORY 150000 // Mem Management
#define MAX_BUFFERS 20
Here is my environment config for demo, running only a single strip 144. The hardware is a ESP32 DOIT DevKit v1
—
Reply to this email directly, view it on GitHub <#168 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA4HCFZEASMFLRDGSW6AOKLWNYMKDANCNFSM6AAAAAASRGY72U>.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
-
Web Browser need some more setting ?
|
Beta Was this translation helpful? Give feedback.
-
Yay! That’s progress at least! I did a very minimal react app, "but there’s not room for it here the margin”, which is to say it’s like either only in my own fork or more likely, only in the “interval” branch thereof?
Unfortunately I can’t tell from looking at the react files if it’s the boilerplate conent you show. But all I had was an effect list, so really minimal.
It’d be awesome if a good React developer wanted to join on in, as having this local UI to run things can be quite handy!
… On Dec 22, 2022, at 5:51 AM, Steve-git-hub ***@***.***> wrote:
I built the spectrum project and ran it on an M5+ and had similar problems to those reported above.
Rebuilt with RESERVE_MEMORY at 200k and this has fixed the WiFi connection and webserver access problems.
The webserver now responds but doesn't do anything useful and serves a load of Latin text
<https://user-images.githubusercontent.com/56019215/209137768-de6cbddf-bf66-442d-b450-1b9767040810.jpg>
... but that's another problem!
—
Reply to this email directly, view it on GitHub <#168 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA4HCF7YK7XYMXI7USNYCBTWORFF3ANCNFSM6AAAAAASRGY72U>.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
-
If I copy the /data folder from an earlier incarnation of NightDriverStrip and build and upload the filesystem from that them I get a more useful page from the webserver: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi.
I think I've read through the other web server discussion threads and my problem seems to be unique.
I've got the
demo
environment project running on my LOLIN32 ESP32 board. The lights are fading through their rainbows nicely, but I can't seem to get the web server to respond. Upon boot, I see this in the serial log:And when I try to connect (
curl 192.168.146.225
): I get a TCP connection refused.I do have the
buildfs
anduploadfs
files uploaded (after having to tweak the partitions as I found in another thread:I do get ping replies from the IP, and it is the correct IP address.
Any ideas of where to look next? Thanks!
Edit more info:
I do have
ENABLE_WEBSERVER
inglobals.h
:…and I do have the board set up correctly in
platformio.ini
, I believe:Edit more:
I tried setting
#define WAIT_FOR_WIFI 1
and got:Curl doesn't get connection refused now, but it just times out:
Beta Was this translation helpful? Give feedback.
All reactions