ESP32 UART to HTTP bridge for simple streaming interface. This application will communicate on UART1 to a target device at 460800bps (configurable)
It will then create a /config
and /stream
endpoints for get the device configuration and stream data to the Data Capture Libraries
It is assumed that you will have the ESP-IDF set up on your machine already.
To clone this repository, make sure it is cloned with the --recursive
option. git clone https://github.com/sensiml/esp32_simple_http_uart.git --recursive
Run the ESP-IDF menuconfig tool: idf.py menuconfig
, and configure the Example Connection Configuration
section with your SSID/Passphrase.
In the ESP-IDF menuconfig tool, you will see Application UART Configuration
If you are connecting two feather boards together, you will need to swap the UART RX/TX Pins. Select Data UART Swap RX/TX
to do this.
The application defaults to 480600 bps
as a baud rate for the UART. This can be configured in the configuration.
Select Data UART Baud Rate
And choose from the list of options
The application defaults to 4MB of flash. You may need to change this value depending on your boards manufacture. To do that,
Select Serial Flasher Config
And choose from the list of options
idf.py build
idf.py -p [PORT] flash
idf.py -p [PORT] monitor
Look for the static ip address (sta ip) to know where to connect
> I (3115) esp_netif_handlers: sta ip: 192.168.86.249, mask: 255.255.255.0, gw: 192.168.86.1
It is useful to have the UART ISR configured to be placed in RAM, but it is not necessary. This is done through the menuconfig.
The application will assume that if it gets valid JSON over a serial port, and it isn't a capture configuration, that it is getting recognition results.
These results will be viewable at the /results
endpoint. /config
and /stream
endpoints won't work when streaming results.
Using the Huzzah32 Feather with stacking headers installed, insert another feather/wing board into the headers to connect them. Shown here is the QuickLogic QuickFeather on top.
Note: When using two feather boards, you will need to Swap UART pins in order for communication to work properly.
When using a battery, use the battery terminal of the Huzzah32 Feather.
SensiML's firmware for the Arduino Nano33 is set up to communicate with this firmware using the second hardware UART on the Nano33. However, the cables aren't necessarily meant to line up. Below, an image is shown with a breadboard to illustrate the wiring needed to power the Nano33 from the ESP32 feather with a battery.