An edge + cloud smart farm that survives an internet outage
Separate control from analysis, keep data in the right place, and let the board own safety.
Published
The hydroponic plot at my home tests an idea I also use in factories: control must never fail because analysis is down.

Figure: the real plot this system looks after. Source: the author.

Figure: the Baan Rak Phak web sign-in; the farm is run from web, cloud and mobile. Source: the author.
Live values, AI advice
Weather and water
Device control
Two paths, two jobs
The ESP32 boards in the plot report on two paths at once. The first goes to a cloud server over MQTT with TLS and serves the web, the mobile app, alerts, automation rules and firmware updates. The second goes over the LAN to an edge computer at home, which keeps every raw reading every 10 seconds and runs AI.
If the edge computer is off, the farm, web and app keep working. If the home internet drops, the edge still gets data straight from the boards, with no gap.
Keep data in the right place
All raw data lives on the edge, because it is large and it is what AI learns from. The cloud keeps only what has to be seen from outside. The same rule suits factories that do not want production data leaving the site.
Safety lives on the board
Every relay has a maximum on-time and switches off by itself when contact is lost for too long. Whether a command comes from a person, a rule or an AI, the board has the final say on safety.
AI that reads the forecast
The system pulls a weather forecast every hour. If the afternoon will be very hot, a rule starts misting in pulses before the hot hours, and rests when rain is likely or the greenhouse is already humid. The data collected along the way will train a model that predicts greenhouse temperature.
A small lesson from the real thing
The first edge computer was a laptop. Closing the lid put it to sleep and half an hour of data was lost. Any system that must always run needs power cuts, sleep and its network address checked from day one.