How python-iot/smart-iot-planting-system works
SIPS is an IoT greenhouse monitoring and control system spanning MCU devices, a Raspberry Pi gateway, and a Django-based cloud service. The runtime workflow begins with device-side sensing and actuation, passes device messages over LoRa to the gateway, and connects the gateway to cloud services over MQTT/HTTP; users monitor and control the system through the browser UI. README-documented capabilities include device tracking, scheduled/manual/automatic lighting and irrigation, security alarms, and gateway database-file management. Device and gateway code is sampled; cloud workflow details and several gateway features are documented but not shown in source excerpts.
Main entry points: src/main.py Device Runtime · src/main.py Gateway Runtime · sips Django Web Service · LoRa.py Device LoRa Link
Components 19
Field Device
- Device Runtime
device/src/main.py - Light Sensor
device/src/LightIntensity.py - Soil Moisture
device/src/moisture.py - Rain Sensor
device/src/rainfall.py - Water Level
device/src/WaterLevel.py - Motion Sensor
device/src/security.py - Pump Control
device/src/irrigate.py - Device LoRa Link
device/src/LoRa.py
Gateway
- Gateway Runtime
gateway/src/main.py - Gateway LoRa Link
gateway/src/LoRa.py - Gateway Database
gateway/src/database.py - Database File Management
gateway/src/backup_db.py
Cloud Services
- Django Web Service
cloud/platform/sips - MQTT Publisher
cloud/mqtt_server/pub.py - MQTT Subscriber
cloud/mqtt_server/sub.py - Cloud SQL Access
cloud/database.py - Monitoring Charts
cloud/echarts-python.py
User Interface
- Browser UI
Other components
- Greenhouse Operator
Connections 19
- Device Runtime → Light Sensor: reads
device/src/main.py - Device Runtime → Soil Moisture: reads
device/src/main.py - Device Runtime → Rain Sensor: reads
device/src/main.py - Device Runtime → Water Level: reads
device/src/main.py - Device Runtime → Motion Sensor: reads
device/src/main.py - Device Runtime → Pump Control: controls
device/src/main.py - Device Runtime → Device LoRa Link: uses
- Device LoRa Link → Gateway LoRa Link: sends over LoRa
- Gateway Runtime → Gateway LoRa Link: receives
gateway/src/main.py - Gateway LoRa Link → Device LoRa Link: replies over LoRa
- Gateway Runtime → MQTT Publisher: exchanges via MQTT/HTTP
- MQTT Subscriber → Gateway Runtime: forwards commands
- Gateway Runtime → Gateway Database: persists device data
- Greenhouse Operator → Browser UI: uses
- Browser UI → Django Web Service: accesses
- Django Web Service → Monitoring Charts: shows monitoring
- Django Web Service → Cloud SQL Access: reads system data
- Greenhouse Operator → Django Web Service: controls planting
- Gateway Runtime → Database File Management: supports backup