• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Stuck with Hello World Webserver

Q&A Forum › Category: ESP32 › Stuck with Hello World Webserver
0 Vote Up Vote Down
James Powell asked 2 years ago

Hi Team.
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.
James
 

5 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
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?
REgards,
Sara

0 Vote Up Vote Down
James Powell answered 2 years ago

Hi Sara
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 :

https://github.com/me-no-dev/ESPAsyncWebServer.git

 
Also, another compiler error is thrown up where in the AsyncWebSocket.cpp file

IPAddress(0U);
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 

WiFi.mode(WIFI_STA);

or

WiFi.begin(ssid, password);

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.
Best regards
James

 

 

 

 

 
 
 

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
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?
Regards,
Sara

0 Vote Up Vote Down
James Powell answered 2 years ago

Hi Sara
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.
Linking .pio\build\esp32-c3-devkitm-1\firmware.elf
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.
Best regards
James
 
 
 
 

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
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.
REgards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.