A Python project to read environmental data from a BME280 sensor and publish it on a webserver built with Flask. The published sensor data can then be accessed and utilized by INDIlib for further processing.
- Reads temperature, humidity, and pressure data from the BME280 sensor using Python.
- Serves sensor data in HTML format through Flask webserver.
- Designed for integration with INDIlib for astronomical instrumentation and control.
-
Clone this repository:
git clone https://github.com/ecalandrini/bme280-websensor.git cd bme280-websensor
-
(Optional) Create and activate a virtual environment:
python3 -m venv .venv source .venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the required Python packages:
pip install -r requirements.txt
-
Connect your BME280 sensor to the device running this script (e.g., Raspberry Pi).
-
Start the Flask Server:
python3 server_api.py
-
Access sensor data:
-
Move the driver configuration file "Weather Wather_config.xml" in the .indi folder
-
Run the bash script with sudo privileges
sudo bash install_service.sh
-
api_server.py — Flask application serving sensor data.
-
sensor.py — Python script handling communication with BME280 sensor.
-
requirements.txt — Python dependencies.
This project is licensed under the MIT License. See the LICENSE file for details.