jlab-sensing / ENTS-node-firmware

Firmware for STM32 and ESP32 microcontrollers on the Soil Power Sensor board
MIT License
0 stars 3 forks source link

Add WiFi functionality through the ESP32 (Due: 2024-03-15) #46

Open jmadden173 opened 7 months ago

jmadden173 commented 7 months ago

The ESP32 is connected via the I2C bus to the STM32 but neither side has the firmware written to allow for communication. If there is time implement a way to identify message types. I would recommend having the first byte sent from the STM32 be the number of bytes and having the ESP32 read loop for that number of bytes and return an ACK at the end.

Outcomes: Libraries written for the ESP32 and STM32 for communicating arrays of bytes back and forth. Example applications on both ends that demonstrate the functionality using the example HTTP server.

jmadden173 commented 1 month ago

Esp32 module interface has been implemented along with the protobuf message encodings that are used in the i2c interface.

Current TODO:

jmadden173 commented 1 month ago

Realized that the Arduino Wire (i2c) interface has a software buffer size of 32 bytes which is less than ideal for protobuf messages. The limit of LoRaWAN messages is 222 bytes which exceeds this. The WiFi configuration is ~600 bytes. Need to implement some sort of chunked data transfer over i2c within module_handler interface.

jmadden173 commented 1 month ago

Also thinking of renaming to something like main/sub where the main is on the stm32 and the sub is the current module_handler implementation.

jmadden173 commented 1 month ago

Planning on switching to Controller/Agent naming convention for coms between the stm32 and esp32. On the esp32 side, it was written with the name ModuleHandler that should be changed.