A basic system that can show and save real-time data such as temperature, humidity of a room. Also you have the ability to manage a device remotely and have the status of it.
Communication between the various devices is mainly through the use of the MQTT protocol.
-
Arduino ESP8266 (publish/subscribe) sends the temperature and humidity with the sensor DHT11 and switches an electrical device (e.g. fan)
-
MQTT Broker manages all the publish and subcribe MQTT between connected devices
-
Python MQTT ( subscribe ) saves from the corresponding topics (e.g. temperature and humidity, device status) to a database (SQLite 3)
-
Python API mainly are the APIs which provide in JSON format to the measurements saved in the database
-
WebApp React (publish/subscribe)
- shows current values (temperature & humidity) directly from MQTT
- shows in a diagram all measurements/values from an API
- remote control of an electronic device (example fan connected to relay in arduino) and give the status of the device
- Board Wemos D1 Mini ESP8266
- Sensor DHT11
- 5V Relay Songle
- MobX-State-Tree (State management)
- React
- FastAPI
- MQTT
- SQLite 3
- Material UI
- Chart.js
# run python scripts
cd python
# install dependecies
python3 -m venv my_env
source my_env/bin/activate
pip install -r requirements.txt
python3 main_fastAPI.py
python3 mqtt_sub_save.py
# run the react web app
cd ../mqtt-react
npm install
npm start