Close

Back to Boring

A project log for Soil moisture monitoring in a flower garden

When do your flowers have enough water, and how do you know?

joseph-eoffJoseph Eoff 03/17/2021 at 20:210 Comments

I've started on the ESP32 control node software.  I'm writing an all new program rather than using the existing MiFlora MQTT bridge as I originally planned.


The changes I'd have needed to make were so massive and invasive that you couldn't have called it the same program any more - I decided I didn't want to try to untangle licensing requirements on something mangled beyond recognition.

I have a basic structure set up, with the ESP32 capable of connecting to WLAN and reporting its battery status via MQTT.


I was surprised at how quickly the ESP32 connects to  WLAN and then the MQTT server.  From reset to the MQTT message arriving at the server takes less than two seconds.

I have things set up to use the ESP32 watchdog to reset the ESP32 if something goes wrong.  I have it set to trigger if it isn't reset every 60 seconds.

If something gets stuck (WLAN or MQTT server connection right now,) then the ESP32 will go into deep sleep and reboot after 5 minutes.


I've started work on decoding the data from the sensors, but haven't gotten that to a state that I want to commit it to the repository.

I don't normally work with C++ or whatever mix of C and C++ the Arduino IDE uses, and I had forgotten how hairy it can be to do things like return an array from a function.  That's caused me the stop and rethink the structure I had in mind for the message decoding.

I'm going to sleep on it, and see if I have a better idea tomorrow evening.

I think I'm just going to make a static decoder that just accepts the raw data and has a bunch of methods or properties with the decoded values in them.  Maybe two decoders - one for the sensor data, and one for the sensor battery data.  The flora sensors have two queries you can make - sensor data and version/battery.  A decoder for each query seems like the best bet right now.

Discussions