At present, we have “sensors” that can “listen” and store the data that is sent from them into FarmOS.
I’m interested in also being able to send data the other way, for example clicking on a button to change the state of a valve and activate crop watering for a given field.
With LoRaWAN, this would be relatively simple as all it requires is a call to the appropriate API with the relevant payload, however with “home-brew” or devices connected via WiFi/Bluetooth it could be a bit more difficult.
I think for the second category of devices we probably have a couple of options:
- There is a “hub” (raspberry pi or similar?) that polls the FarmOS API every
nseconds/minutes and looks for state change. If it finds a state change then it does some analysis on the state and the “sensor”, then sends the appropriate message to activate the end-device
- FarmOS publishes state changes to a messaging bus (I’d suggest MQTT here as it seems to be the most used in the IoT space). At this point “something” (either a hub as in (1) or the devices themselves) would connect to the message bus and act based on the messages they receive
- Devices are coded so that they connect directly to the FarmOS API and monitor their own state. If the state changes then they act accordingly.
Given the work that we (Mockingbird Consulting) have done so far on IoT, I’d probably recommend (2) over the others as it allows for integration with AWS/Azure/Google Cloud IoT as well if required in future, but I’m open to suggestions on this.