I want to start doing data collection "untethered", so I've been looking at how SensiML has implemented data capture over WiFi and BLE.
In order to do data capture over WiFi, SensiML uses a ESP32 UART to HTTP bridge. Instructions for doing this are located here: https://github.com/sensiml/esp32_simple_http_uart .
This uses the Adafruit HUZZAH32 ESP32 Feather board as the WiFi bridge https://www.adafruit.com/product/3405 .
This is a learning experience for me because I've never used the ESP-IDF programming interface before (https://docs.espressif.com/projects/esp-idf/en/stable/esp32/get-started/ ). Other than the minor installation pain, I had no problems using it per the instructions. ESP-IDF uses Python and Git which I already had installed, but I needed to install other dependencies like Cmake and Ninja.
Configuring the firmware
After the ESP-IDF and its dependencies are installed, you need to clone the GitHub repository git clone https://github.com/sensiml/esp32_simple_http_uart.git --recursive.
Then run the command idf.py menuconfig which will bring up a GUI that allows configuration of the WiFi and UART parameters.
All commands are run in the Windows CMD window.
Swap the RX/TX pins if using stacked boards.
Normally data rate is set to 921600 if using the primary serial port and reduced to 460800 if using a secondary port.
Flashing the firmware
First build using command idf.py build
Then upload using command idf.py -p [PORT] flash
Verify operation and obtain IP address
Run command idf.py -p [PORT] monitor
The program sets the ESP32 in WiFi station mode and connects to the WiFi network and obtains an IP address. Then it goes into listening mode waiting for a connection from the Data Capture Lab.
Connect UART RX/TX and Power/GND between boards
Configure and run Data Capture Lab
You can see the configuration response in the monitor after the DCL query:
Data Capture Lab
You can see the configuration and data capturing in this short video clip:
Now I've got a working configuration to capture data over WiFi. I did make one mistake in the process. I forgot to reprogram the Arduino Nano 33 BLE Sense capture firmware to use the second serial port for the UART. During normal serial capture it uses the first serial port over the USB connection. Had me confused for a while.
I would have preferred if the HUZZAH32 programming had been done using the Arduino IDE. I may look at the program and try to port it over as I normally use the Arduino IDE for ESP device programming.