Developed by Mukoma Mpashi
This Flask server serves as an intermediary for handling IoT sensor data and controlling a pump connected to an IoT hub. The server communicates with a Firebase Realtime Database and receives sensor data from the hub, allowing control of the pump status.
To run the Flask server locally or in a production environment, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/your-flask-server.git cd your-flask-server
-
install dependicies:
pip install -r requirements.txt
-
Create a Firebase Realtime Database and obtain the necessary credentials file (secrets.json). Place it in the root directory of the project
-
Run the server:
python app.py Usage
Once the server is up and running, you can interact with it using the following endpoints:
. /update_data (POST): Send sensor data to update the database. . /control_pump (GET): Get or set the status of the pump.