This week i have just purchased your “Building Web Servers with ESP32” to get me going and i have failed at the first hurdle. Im am completely new to the ESP32 platform but very experienced on STM32 etc.
First of all its has taken quite a bit of googling to even compile the hello world example. The webserver library directed to use in the platform IO .ini file is out of date giving link errors and had to pull in another fork from git.
Finally i have got the project complied but crashes in the initWifi() function. Basically the code doesn’t get past the wifi.mode or wifi.begin function.
I am flashing to an ESP32 C3 DevKit M-1.
I am surprised i am hitting so may issues for what should be a straight forward get-up-and running example.
Is there something i need to know relating to this C3 chip that could be giving me issues.
Any suggestions much appreciated.
I’m sorry for the delay in my response…
Which version of the ebook do you have?
There is an issue with the library, but we provide several options to fix it on the eBook.
Can you provide more details about the errors you’re getting?
Thanks for the reply. The book purchased last week is the latest version (2nd Ed 2.2) of Building Web Servers with ESP32.
First of all, when starting your hello world Module 3 1.1, you say lib_deps in the platform IO .ini file has to be ESP Async Webserver.
This will not compile. By searching around, the only way i can get the project to compile is to install git on my PC and use :
Also, another compiler error is thrown up where in the AsyncWebSocket.cpp file
has to be replaced with IPAddress(unit32(0U));
This gets the hello world program compiled but does not run.
Ive done a bit of debugging and the program is hanging on a call to
I have put some non WiFi code in there to flash an LED etc and the ESP32 seems to run OK.
Something definitely not right with the Wifi.
As i said in my previous message, i am trying to get this going on an ESP32 C3 Devkit M-1
Unfortunately as this is my first delve into ESP32 , at present i don’t have any further variations of ESP32 kit to try this out on.
Can you share the exact errors that you’re getting?
I’m not sure if it’s some imcopatibility with that specific board. What board did you select for your project when you start the VS Code project?
I don’t have that specific model to try it out.
Have you tried a basic wi-fi program? For example, the WiFiScan example in arduino ide to check if it is running fine?
Re Errors, the one regarding the IP class issue is:
.pio/libdeps/esp32-c3-devkitm-1/ESP Async WebServer/src/AsyncWebSocket.cpp:840:28: error: call of overloaded ‘IPAddress(unsigned int)’ is ambiguous
As discussed, this fixed by casting to uint32_t
The error regarding the webserver library is when PlatformIO trys to link.
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\esp32-c3-devkitm-1\firmware.elf] Error 1
As you can see, PIO has the correct board selected.
Have you tried your examples on any of the ESP C family?
Thanks to my semi distributor, i have some S family boards on the way to test and compare.
I have not tried a a basic Wifi program yet but will give it a go a let you know how i get on.
The issue with the IP address seems to be specific for the ESP32 C3: https://github.com/me-no-dev/ESPAsyncWebServer/issues/1101
So, after fixing it as you mentioned, as if the code uploaded without issues, it should be running as expected.
Let me know if a basic wifi program is working as expected so that we know that wi-fi is working properly.