MicroPython firmware for the ESP32 edge device used by the AgriSentry platform.
The hydroponics setup is the first physical laboratory for the platform. The firmware itself follows a generic agricultural telemetry contract and is not limited to hydroponics.
2.0.0-alpha.1 implements the first firmware-to-gateway vertical slice:
- Wi-Fi connection with timeout;
- NTP clock synchronization;
- MQTT v1 telemetry topic;
- seven simulated sensor channels;
- durable monotonic sequence;
- UUID v4 event identifiers;
- QoS 1 publication;
- complete-envelope offline JSONL cache;
- automatic replay after reconnection;
- host-side contract tests.
Physical sensor drivers, OLED output, buttons and relay commands are the next firmware milestones.
agrisentry/v1/devices/{device_id}/telemetry
air_temperatureair_relative_humiditysolution_temperaturesolution_phsolution_tdsreservoir_levelrelative_light
- Flash a current MicroPython build on the ESP32.
- Install
micropython-umqtt.simple. - Copy
config.example.pytoconfig.py. - Set Wi-Fi and MQTT values in
config.py. - Upload these files to the ESP32 root:
boot.py
main.py
networking.py
time_sync.py
identifiers.py
telemetry.py
simulated_sensors.py
sequence_store.py
cache.py
config.py
The MQTT broker address must be the LAN IP address of the computer running the
broker, not 127.0.0.1.
No ESP32 is required to test the contract-building modules:
python -m unittest discover -s tests -vconfig.py is ignored by Git. Commit only config.example.py.