A physiacl button to the ESP32 will send out a REST request to a given server.
- DMX Web Endpoint configurable into nvs via webserver
- DMX Web Reqeust Configurable content
To support UART flashing and debugging:
- Download the CP210x VCP driver for your OS
- Unpack, if necessary
- Follow the steps for your Operating System to install the drivers.
The code must be compiled and flashed onto the ESP32 microcontroller via USB.
Prerequisites:
- Have the necessary drivers installed as described above
- Make sure your USB to micro-USB cable can transport data and not only charge!
- Visual Studio Code with the
espressif
extension to support the build for the ESP with all required libraries.
- Open this repository in its own VS-Code instance.
- Install the Espressif Extension - i used the extension version 1.6.3
- Follow the extension setup process
- Select an ESP-IDF version (i used 5.0.2)
- Note: This version differs from the extension versions, as it is two different things.
- Select an installation directory (i chose the workspace directory)
- Select an ESP-IDF version (i used 5.0.2)
- After the installation, restart VS-Code, just to be sure.
- Make sure you followed the instructions for installing the driver
- Select your ESP32 device by:
- Selecting
UART
as protocol (the star symbol at the bottom in VS Code) - Selecting the right USB
COM
interface.
- Selecting
Here is an example settings.json
for VSCode which can be put in the folder .vscode.
.
I especially recommend the setting for files.readonlyInclude
to prevent editing ESP32 library files by accident and terminal.integrated.scrollback
as an ESP restart quickly floods the default terminal size.
{
"idf.flashType": "UART",
"idf.adapterTargetName": "esp32",
"idf.openOcdConfigs": [
"board/esp32-bridge.cfg"
],
"terminal.integrated.scrollback": 10000,
"files.readonlyInclude": {
"build/**": true,
"**/esp/esp-idf/**": true,
"**/.espressif/**": true
}
}
You can then run ESP-IDF
commands from VS-Code (CTRL+SHIFT+P)
- ESP-IDF: Build your Project
- ESP-IDF: Flash your Project
- ESP-IDF: Erase flash memory from device
or select them from the bottom tray menu.
- Build your project (CTRL+SHIFT+P -> ESP-IDF: Build your project)
- Flash the Code onto the ESP32 (CTRL+SHIFT+P -> ESP-IDF: Flash your Project)
- Turn on the power
- If no previously configured wifi can be reached, the esp32 opens its own wifi with SSID
ESP32-REST-BTN
and no password. - Connect to this wifi with a device and visit the default gateway (http://192.168.4.1) with your favorite browser.
- On the webpage insert the credentials of the network you want to provision.
This seems to be a bit tricky, because the ESP32 seems to require a lot of energy when booting up WITH the wifi module active. Many batteries, that usually supply enough energy, cannot handle this burst in energy drain.
A list of setups, that worked for me:
- Lithium Battery CR123 (3.0V), connected to 3V3 PIN and GND