Project provides codes for IoT devices, MQTT protocol, WebSocket server and Machine learning in order to monitor and analyse plant data.
plant-monitoring/
├── README.md // Documentation file
├── iot-device // Codes for IoT devices
├── server
│ ├── data-analysis // Data, models and codes for data analysing
│ ├── mqtt-client // Mqtt client which subscribes to topic published by the devices
│ └── websocket-server // Websocket server which maintains real time connection with Mqtt client and web application
└── web-app // React web app for user interface
Necessary package
numpy
pandas
matplotlib
sklearn
keras
tensorflow
paho-mqtt
flask_socketio
socketIO-client
pymongo
Dependencies can be found in package.json file.
In server directory, creating a virtual environment for deploying server:
virtualenv env -p python3
Activating virtual environment:
source env/bin/activate
Installing dependencies:
pip install {package}
Running mqtt subcribe node:
python mqtt-client/client-subscribe.py
Running web socket server:
python websocket-server/server.py
In web-app directory, installing dependencies for deploying web application
npm install
Starting web application
npm start
Starting script can be found in package.json file.
When deploying in a real server, PM2 is a good choice for managing process.
Webapp allows users to monitor sensors and control actuators. Real product where 1,2,3 are sensors, 4 is actuator, 5 is NodeMCU, 6 is App.