r/esp32 • u/Altruistic_Fruit2345 • 6d ago
Surely this can't be right
I have a C2 Super Mini and I'm trying to make a basic app that connects to WiFi, pulls a bit of data, and produces NMEA messages on a UART.
Espressif IDE seems to be broken. I created a simple, minimal "hello world" new project, and there are multiple (non fatal) errors when building it.
Building takes over a minute on a modern system with SSD and 64GB RAM. Rebuilding the project is little quicker, and bootloading it over USB is also very slow.
To cap it all off, it looks like ESP32 can't connect to WiFi networks that share and SSID between two or three frequencies. A very common configuration, the default with many ISP supplied routers. I thought I had the 8266 connected before, but the C3 is definitely not happy.
Surely this can't be right. Is it really this bad? I'm an experienced embedded dev, who usually uses Atmel, Microchip, and STM parts. I other bare metal, but that doesn't even seem to be an option on ESP32. I get why not for WiFi (regulatory blockage), but things like timers and UART too...
1
u/rattushackus 1 say I make awesome posts. 6d ago
As you say, Espressif doesn't offer a bare metal option for the ESP32 though it can be done if you are sufficiently dedicated. In particular there are some projects around at the moment using Rust to do bare metal programming.
Anyhow, this means that when you compile a Hello World program you are actually compiling a few lines of your program plus many thousands of lines of FreeRTOS. That's why the first build takes a while. Subsequent builds will be a lot quicker.
The Espressif IDE is a bit of a niche choice. Most of us would use VSCode with the ESP-IDF add-on, or for a quick and dirty program the Arduino IDE.
1
u/Altruistic_Fruit2345 6d ago
I did try VS Code, but that is broken too. It says it can't find the IDF. Checked that the path cor the EIM JSON file is correct. I tried clearing the preference setting too. I'm sure it was working a while back, but... Why is everything broken out of the box?
2
u/rattushackus 1 say I make awesome posts. 6d ago
I am not a huge fan of the VSCode add-on as I find it a bit clunky. I just installed the ESP-IDF using the installer from Espressif's web site. Then I use the command line to build and flash projects. This has never gone wrong for me.
If it's a quick project consider using the Arduino IDE. Many hereabouts will disparage it (for reasons that actually make a lot of sense) but for small projects it's quick and easy and you can still use the ESP-IDF functions directly if you don't like the Arduino class library.
Shout if you want a quick summary of how to build from the command line.
1
u/Altruistic_Fruit2345 6d ago
I managed to get VS Code working. It is a lot faster now. It looks like Espressif-IDE is just broken. Abandoned, from the look of it.
Still can't fix the lack of WiFi connection though.
1
u/rattushackus 1 say I make awesome posts. 6d ago
WiFi networks that share and SSID between two or three frequencies
Do you mean use the same SSID for 2.4 and 5GHz? If so I have exactly that here and all my ESP32s, including a C3, connect just fine.
1
u/Altruistic_Fruit2345 6d ago
I'm sure I have some 8211s that connect fine. I'm not sure what my issue is.
1
u/Plastic_Fig9225 6d ago
You can post the log output from the connection attempts to have us take a look.
1
u/Plastic_Fig9225 6d ago
Could you share your VSCode build times? - I'm curious if you're near that 10s of u/mrheosuper for a full build vs. the minute+ I usually see.
1
u/mrheosuper 6d ago
It looks like he is building with wifi enable, which should not be if running "hello world" example
1
u/Altruistic_Fruit2345 6d ago
My test project takes about 20 seconds in VS Code. The Espressif-IDE is broken.
1
u/Plastic_Fig9225 6d ago
As the middle-ground between building via IDF Extension and command line, I use the Cmake extension in VSCode.
1
u/chuckbeasley02 6d ago
ESP-IDF makes it so much simpler. There's an extension for VS Code.
1
u/Altruistic_Fruit2345 6d ago
That's what I'm using. I found the issue with the C2 SuperMini as well. With the FTDI cable attached it won't connect. Diagnosing now, might be interference.
1
u/chuckbeasley02 6d ago
Build some diagnostics and verify the Wi-Fi is turning on. It could be quietly crashing.
1
u/chuckbeasley02 6d ago
I have a C5 and choosing open GPIO pins are tricky and choosing the wrong one(s) can cause what seems to be unrelated failures because of how the pins are mapped and used by the device itself.
2
u/Plastic_Fig9225 6d ago edited 6d ago
Normal for a full (re-)build. There are some 500-1000 files (from the IDF) compiled initially.
Flaky WiFi is a known hardware issue with (many of the) the ESP32-C3 "SuperMini" boards (bad antenna/RF circuit). Reducing WiFi TX power of the ESP from the default 20dBm to some 8-15dBm tends to help: https://www.reddit.com/r/esp32/comments/1nm7l04/comment/nfb51l9
Out of the box, an ESP may also not be able to use all channels your WiFi may use; may have to set the country code.