I need your opinion about my project's architecture.
We have a greenhouse complex with 4 greenhouses and 1 seedling lab.
For now there no automation in greenhouses and some automation in seedling lab with sonoff 4ch pro.
I am planning now how to build a greenhouse automation system on esp32 and esp8266 boards and micropython on it.
My conception.
- 2 categories of boards:
"Data senders" boards and "Action boards".
Several esp8266 with bme280 and ds18b20 always send data thru MQTT.
Each agregate in greenhoues has own action board. It will power-up water pump, open doors, starts vents and etc.
- Cluster with 2 rapberry pies will act as MQTT server, task server and Graphana host.
One Pi is a master and second Pi is a slave. Hot backuping for fast change if master will physically broken for a some reason.
On RPI will be touchpad screen and app on Kivy framework to full control a system.
Touchscreen https://www.aliexpress.com/item/5-5inch ... 46179.html
We can use touch interface in front of RPI or we can do a remote connect by VNC to control system outside a greenhouse.
- There a 100% wifi coverage in each greenhouse and 100mbit ethernet connection between routers an RPI. All ESP will have stable powering.
My general idea is to develop a task generating system at server and task scheduling system at ESPs.
Explanation.
We have 4 greenhouse and we will grow a 4 types of flowers. Our bio engeneer develops a grow plan for each flower culture.
Water schedule, temperature mode, nutrient mixing in water and etc.
Growing duration is about 4 month. So, we just generate day-by-day schedule for each "Action boards".
Every day each action boards knocks to a server and get bundle of tasks for today.
For example ESP with ID 57575 tell server:
Code: Select all
[{"get_tasks": 57575}]
Code: Select all
[{
"task_id" : 1,
"mcu_id" : 57575,
"light1" : "on",
"time" : "8:00"
},
{"task_id" : 2,
"mcu_id" : 57575,
"light1" : "off",
"time" : "18:00"
},
{"task_id" : 3,
"mcu_id" : 57575,
"pump2" : "on",
"time" : "13:57"
}]
Architecture is very similar to famous botnet systems (Zeus, SpyEye and etc.)
All logics and decision making will act on server side, ESP just simple do everyday routine.
All ESP IDs we comment on server panel and can see detailed statistics about connection and task progress.
Data senders boards just send sensor data to MQTT.
But for action boards i plan to write a socket server to delivery tasks instantly.
Please give me any feedback about my vision, aspecial about "socket server with json" VS MQTT protocol"