Integrating an existing automated farming/gardening IoT project into FarmOS

The FarmOS app is quite impressive and I’m interested in seeing whether I can make IoT systems I’ve built work with FarmOS.

I’ve spent years building a suite of IoT gardening/farming tools that currently include soil moisture monitoring, light monitoring, temperature/humidity monitoring, automated irrigation, automated ventilation, and automated lighting devices. More devices will be added over time.

The devices work and are about 99% solid.
They include fairly comprehensive amount of automated testing (and more automated testing gets added as needed), including using Jenkins CI to automatically upload code to microcontrollers, and use a second microcontroller to simulate sensor signals and check the devices behave correctly, to ensure they’re reliable.
This automated testing can test the devices work properly in less than half an hour (depending on the device, as different devices have different numbers of tests), rather than having to wait days or weeks for soil to dry and manually check that pumps (for example) turn on/off as expected.
I also have automated deployments set up which install the system to multiple live systems after every code change/update to ensure updates don’t break anything.

I’m currently polishing the system up fixing any remaining small issues but they’re ready for early adopters to use/test and will hopefully soon be rolled out as a commercial product, once early adopters confirm they are reliable, and once things like documentation (which is currently rather disorganised at the moment) is completed.

I have multiple small systems currently running and growing food on a small scale. And soon I’ll be scaling up to deploy these in larger gardens. I’ll also be deploying a solar system (most of the solar equipment has already arrived) soon to prove the systems can be run offline/off-grid.

The system is distributable so there is virtually no limit to the number of devices that can be deployed in a single system. The load can be spread over multiple single-board-computers, and the system allows these SBCs to be linked together to create a single distributed system.

All devices are plug and play. Just plug any combination of devices into a garden host computer via USB and they will be automatically added and configured, showing up on the UIs so they can be monitored and controlled from anywhere in the world.
The WiFi/ESP versions can be then unplugged and deployed, and still remain part of the system, connected via WiFi instead of via USB. The arduino versions remained plugged in via USB. But they can all be mixed and matched in a single system depending on the needs of the user.

I’m curious about the idea of integrating monitoring and control of these systems into FarmOS and using it as a website based UI for the system.

The system has both an embedded system UI and a mobile UI (using an existing MQTT based app) but what it is currently missing is a website based UI. That’s where FarmOS could come in.
A custom website based UI has just started being developed, but if FarmOS can do everything I want then maybe that won’t be necessary. Or at least it would be good to give end users the option to use either UI or both.

The systems I’ve built are completely open source so it seems like it would be a great opportunity to collaborate and use FarmOS as either the official web UI or at least as one of the UIs end users can choose from.

Currently the project group goes by the name of GreenSense but because that name is currently in use by an Australian company we are investigating a number of other names, so we can rename the project group.
The source code can be viewed here:


The index includes device code as submodules, and includes everything needed to make them all work together as a single system.

This doc shows some of the small test/demo systems I’ve built:


Since those photos were taken the systems have been updated, improved and planted out with edibles (some of which have already been harvested and eaten). I need to update that doc with more up to date photos but it provides an idea of what the systems entail.

While I am at the moment the sole developer of the project I am collaborating with Sensorica and have a number of people getting involved in various aspects of the project, and a number of people wanting to buy systems.
A green wall is currently being built at the Sensorica lab which will soon have GreenSense systems embedded into it to control irrigation, etc. It will be used partly for testing and partly for publicity.

Who would I talk to about collaborating and bringing these projects, GreenSense and FarmOS, together?
Is anyone interested in discussing the possibility of collaborating?

While I could simply attempt to go through the FarmOS documentation and attempt to work with the API, it would be beneficial to start a discussion with the FarmOS team, to discuss the best ways to go about things.

Most discussions on the project take place in the sensorica@googlegroups.com and sensorica-ecg@googlegroups.com Google Groups, so if you’re interested in getting involved in those discussions feel free to sign up.
Note: “ecg” stands for the previous name for the project which was eCommunityGarden.

I look forward to discussing the possibility of collaborating.

Cheers,
John

2 Likes

I was only able to post 2 links in the first post so I had to remove this section…

This video shows the first stage of the green wall being developed by Sensorica (sensorica.co):
https://www.youtube.com/watch?v=Ax4ZzRkzAP4
More videos will be published as they progress continues on the green wall.

Cheers,
John

1 Like

Wow very exciting @CompulsiveCoder! Sounds like a great opportunity for integrating with farmOS!

There has been similar discussion in GitHub, as well as in this forum thread: Controlling remote devices from within FarmOS

I would also recommend reviewing these GitHub threads:

There’s been other discussions - but I forget if they were recorded. It would be great to have your thoughts and input! And I’d love to see some kind of integration come together. I can provide guidance on developing a custom sensor type module in farmOS which will give you a lot of freedom to connect to external systems in various ways.

Thanks for the offer to help.
Sorry for the slow reply I’ve been swamped fixing bugs and perfecting the system. Now it seems pretty solid but it’s really lacking a good UI.
The Linear MQTT Dashboard UI (android app) currently being used is somewhat effective just too limited, especially when it comes to having a large number of devices.

I’m keen to look into integration with FarmOS but I likely would need some guidance. It does seem like FarmOS and GrowSense (formerly GreenSense) would be ideal to have working together.

There are 3 automation devices (irrigator, ventilator, and illuminator) and 3 sensor devices (soil moisture monitor, temperature humidity monitor, and light monitor).
I plan on adding more devices too.
So we would need to create a custom module for each. And each one would need a customised UI.

I would also need to add a way to automatically configure the module for each device when it’s detected and installed by the plug and play system. That way people just plug in devices and they show up on the UI automatically.
Hopefully we can come up with scripts to install the module for each device then I can tie it into the existing plug and play scripts. If it’s just a matter of taking a module config file template, injecting some details specific to the device, and copying it over into the FarmOS app then that should be doable.

Do you have Google Hangouts, Facebook, or LinkedIn so we can discuss how we go about this?
I’ve started a Facebook group called GrowSense you could join if you’re interested.

All devices publish to and receive commands from an MQTT broker so FarmOS needs to be able to interact with that broker. Both to receive data and send commands.

Can FarmOS do things like allow users to edit settings on the device? This is done by sending a value back to a specific topic on the MQTT broker which is then passed on to the device.
Settings like like the interval between sensor readings, the soil moisture threshold at which the pump turns on, etc.
The automation devices have all logic on the device itself so if it goes offline it will still work. But the automation is based on a bunch of settings the user can configure.

I could potentially show you the existing Linear MQTT Dashboard UI which does allow users to monitor data and change settings, then we discuss how we make FarmOS provide the same functionality, and how we take it further.

Cheers,
John

1 Like

Hi John,

MQTT integration with FarmOS would be awesome, as it would make a lot of the issues around command and control from a LoRaWAN perspective disappear as well.

For the integration work that I’m looking at, it will involve talking to either InfluxDB or Elasticsearch and converting the data into graphs accordingly, however MQTT feeds are an option here as well to get the data direct from the LoRaWAN servers.

I’d be interested in knowing more about your CI/CD setup for hardware as it’s something that I’ve looked at in the past (I’ve spent the last 10 years as a DevOps consultant, so it’s a subject very close to my heart!) - all our IoT infrastructure is configured and deployed using tools such as Packer, Ansible, and Terraform, so any additional automation is excellent to hear about!

1 Like

I find this very interesting. I have had the idea of developing an open source “smart post” (as opposed to “dumb as a fence post”) that had a series of environmental sensors both above and below ground that can also be used as practical support for fencing and trellising. I am especially interested in how Regenerative Agriculture’s use of cover crops influences microclimates at various levels below and above their canopy. It seems like your project would be a nice fit. I have a programing friend but have had trouble getting my raspberry pi and arduinos to do even the basic collecting myself. He has things set up around his house that work nicely and do data collection and graphing.

3 Likes

Love that! :laughing:

1 Like