theelims / ESP32-sveltekit

A simple and extensible framework for ESP32 based IoT projects with a feature-rich, beautiful, and responsive front-end build with Sveltekit, Tailwind CSS and DaisyUI. This is a project template to get you started in no time with a fully integrated build chain.
https://theelims.github.io/ESP32-sveltekit/
Other
90 stars 15 forks source link

ESP32C3 - Serial appears to block the application #21

Closed thiccnfun closed 4 months ago

thiccnfun commented 4 months ago

From discord:

the esp32c3 I'm working with seems to halt execution or something unless there is a serial monitor connected. If I plug it into my PC, it seems to connect to wifi as expected, but the web ui (using the sveltekit build) is not accessible... However the moment I start a serial monitor the UI loads up.

Commenting/removing all references to Serial appears to resolve this issue.

The following files (excluding main.cpp) had Serial lines that were commented: image

Maybe unique to the ESP32C3, or the Seeed Studio XIAO ESP32C3 board specifically.

pletch commented 4 months ago

For reference, I am running the same Seeed Studio board and didn't have to comment out the Serial lines as mentioned. After flashing and moving the board to stand-alone power supply, the web ui was not initially accessible but it did eventually come up when I checked again some time later. During inaccessible time, the board could have been in wifi AP mode rather than connected wifi STA mode but I didn't immediately investigate.

Only customizations I am using are a platformio.ini definition for the Seeed board (LED_BUILTIN assigned to GPIO4 arbitrarily):


board = seeed_xiao_esp32c3
board_build.mcu = esp32c3
board_build.partitions = min_spiffs.csv
build_flags = 
    ${env.build_flags}
    -DLED_BUILTIN=4```
theelims commented 4 months ago

HEAD now contains a buildflag -D SERIAL_INFO to enable or disable all Serial.print() statements.

The issue seems to be coming from the underlying Arduino libraries and is widespread. See https://github.com/espressif/arduino-esp32/issues/7554 https://github.com/espressif/arduino-esp32/issues/8322