|
ENTS-tock
Environmental NeTworked Sensor firmware on Tock OS
|
The ESP32 firmware acts as a WiFi interface the STM32 module. It gets binary data through the I2C connection with the ESP32 and uploads it to a configured web address. The binary response is then passed back to the STM32 for decoding. The ESP32 handles only the WiFi interface. It is up to the STM32 to check all errors relating to decoding binary data.
Before running the following ensure you have updated the ports in
platformio.inidescribed in the root README.md.
The esp32 is programmed through a bootloader through UART. A USB to TTL convert is required to program the microcontroller with your computer and can be found cheaply online. Ensure it supports 3.3V logic levels. Connect TX to RX and RX to TX, RTS, CTS, and GND. We recommend not connecting Vcc as it is already powered through the USB connection. More recent versions of the board have the header removed.
Check the correct environment is selected. Should be env:esp32 (esp32)

NOTE: If the filesystem needs to updated you will need to run
Upload File System imagebeforeUpload and Monitor. THe filesystem store html webpages for the configuration portal.
Goto PlatformIO Tab -> Project Tasks -> Upload and Monitor

The following can be used to flash the firmware on the esp32
NOTE: These must be separate commands or else the firmmware will not be updated.
Note: If you do not have
RTSandCTSconnected, you will need to load into the bootloader mode. This can be done by holding theBOOTbutton while pressing theRESETbutton for the esp32. The buttons are located right above the esp32 module.
We have included the python script tools/http_server.py to enable testing the WiFi interface of the ESP32. By default the server simulates a success POST request, returning a 200 response. The flag --error allows for a 418 to test error handling. See http_server.py --help for more usage information. We recommend hosting a WiFi network for the ESP32 on your local machine. An alternative is having your local machine and ESP32 connected to the same WiFi network. The following are instructions for testing the firmware on the ESP32:
ssid and pass in the ESP32 firmware to the shared WiFi network.Unix
Create the hotspot using NetworkManager. Replace ifname with the name of your wireless interface.
To stop the hotspot.
To reactivate the hotspot.
To delete the connection.
macOS
TODO
Windows
TODO
8080.[your ip address] with the IP address of your local machine. By default the port is 8080.example_dirtviz.cpp. See Flashing for more information.