ESP32 Web Function

Hi,
I am playing around with an ESP32 Vroom Module unit, and I can get it to connect to the web when using a sketch that utilizes the WebServer.h code as can be seen on the top sketch, but I get errors uploading when I try to upload the sketch on the bottom. ( These are only portions of the full sketch showing the different libraries used. ) I have the different libraries saved, so they are all available. Anything obvious jump out that I am missing. I've tried different sketches that use the ESPA files but none of them will load up to the ESP32. I keep getting an error message. All of the sketches that use the WebServer.h work perfectly. I can get results on my cell phone without any issues. Hope it's something simple.

// Load Wi-Fi library
#include <WiFi.h>
// Replace with your network credentials
const char* ssid = "******";
const char* password = "******";

// Set web server port number to 80
WiFiServer server(80);

// Variable to store the HTTP request
String header;
// Import required libraries
#ifdef ESP32
  #include <WiFi.h>
  #include <ESPAsyncWebServer.h>
#else
  #include <Arduino.h>
  #include <ESP8266WiFi.h>
  #include <Hash.h>
  #include <ESPAsyncTCP.h>
  #include <ESPAsyncWebServer.h>S
#endif

Please do not post pictures of code

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

Thanks. I revised the code BTW. I posted it the way I did originally just to see if someone new right off the bat that the code in the bottom pic will not work with the Vroom edition of the ESP, and make mention of it. As I stated, the entire code is not there, just the initial libraries. I did not expect anyone to copy and try to diagnose the code for errors.

Cheers,
TT

And what exactly are the errors you are getting?

please what are "ESPA-files"???

post the exact errormessage

what about using this demo-sketch

and start to modify this demo-sketch in small steps?

best regards Stefan

@tonytnt69 Ironically it is easier to copy the code from the IDE to a post here, complete with code tags (3 mouse clicks or 1 keyboard shortcut and 1 mouse click) than it is to create and post a screen shot


This is the error I was receiving from one of the sketches I ran. I ran some other ones and they worked .
They seemed to have the same libraries.
I ran your sketch and got a blue screen with the message STOP CODE from Microsoft.

I'll play around and see if I can get things settled down.
I also tried setting up the ESP32 as a access point, but didn't have any luck with the sketches online. Even the ones from random nerd tutorials. What I seem to run into is that some of the sketches require libraries like wifi_ap.h, but I can't seem to find them anywhere for upload in library manager, or online. I get all these other ones that don't match, and won't function in the sketch when I run it.

You can post code by using this method that adds the code-tags
There is an automatic function for doing this in the Arduino-IDE
just three steps

  1. press Ctrl-T for autoformatting your code
  2. do a rightclick with the mouse and choose "copy for forum"
  3. paste clipboard into write-window of a posting

For Posting the complete error-message:
simply click on the copy error-message button

grafik

change to forum
click on the </>-Button above the textfield
press Ctrl-V to insert the whole error-message

Now don't you think that this is done quicker than a screenshot where most of the error-message ist still hidden and therefore very important information is left out?

best regards Stefan

Oh, I did not know that. I think in this session, that one line is the only error message line though.
I'll have to try again and see if there is more to it.

Also, the code is not the issue for this post. The other gentleman was asking me to show what was displayed as the error.

Cheers,
TT

Well there is even more to know

in the file - preferences
grafik

you can set show verbose output during compilation upload
and you can set compiler-warnings to all

grafik

This gives the maximum information that is running through while the compiling / upload is active
Usually I have this setting because it will yell everything that isn't 100% correct.
In rare cases if a provided code has some medium dangaerous warnings this setting leads to a compiler-error that end in compiler-stop
In these cases a switch to compiler-warnings none to make the code compile
But this has the inbuild danger that your code can crash later

best regards Stefan

Thanks for the info. I'll set it up and try again to see if anything else shows up

Cheers,
TT

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.