Simple Esp32 async web server
Libraries/reference:
https://github.com/me-no-dev/ESPAsyncWebServer
https://www.arduino.cc/en/Reference/WiFi
Basics:
I'm using this code to turn a relay module on and then off after 1 second.
It creates a simple web server where I can use the /
route to check if its alive and the /actions
route to trigger my relay module.
I also included a simple access token check for basic security.
Here's an example of the two routes we get:
http://192.168.0.10/
http://192.168.0.10/actions?code=123456
Before using this code:
- Install the necessary libraries
- Define the pins of your choice
- Check if you need a positive or negative signal to turn on the relay module
- Change the Wifi settings to match your router
- Choose a good access_token to use later when accessing the web server
- Choose for how long you want the relay to stay on when triggered
Tested on the board "Esp32 Wroom Devkit V1"