Skip to content

Commit c55dbb1

Browse files
author
Ilia Shcheglov
committed
.
1 parent 624cfaa commit c55dbb1

File tree

3 files changed

+54
-1
lines changed

3 files changed

+54
-1
lines changed

create_db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import sqlite3
55

6-
DB_PATH = 'sensor_data.db'
6+
DB_PATH = '../sensor_data.db'
77

88
conn = sqlite3.connect(DB_PATH)
99
cursor = conn.cursor()

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
hidapi
2+
Flask
3+
pandas
4+
plotly

web_service/REAMME.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Web Service for Sensor Data Visualization
2+
3+
The web interface provides real-time data visualization and displays the current CO2, temperature, and humidity readings. Access it at [http://localhost:5000](http://localhost:5000) (or replace localhost with your Raspberry Pi's IP address if accessing from another device).
4+
5+
## Features
6+
7+
- **Real-time Data Visualization**: The main dashboard displays CO2 levels, temperature, and humidity over time.
8+
- **Current Readings**: A dedicated page shows the latest sensor readings.
9+
10+
## Installation
11+
12+
1. Clone the repository:
13+
```bash
14+
git clone <repository-url>
15+
cd <repository-directory>
16+
```
17+
18+
2. Install the required packages:
19+
```bash
20+
pip install -r requirements.txt
21+
```
22+
23+
3. Set up the database:
24+
Ensure that the `sensor_data.db` file is in the correct directory as specified in the application.
25+
26+
4. Run the application:
27+
```bash
28+
python web_service/app.py
29+
```
30+
31+
5. Access the web interface:
32+
Open your web browser and go to [http://localhost:5000](http://localhost:5000).
33+
34+
## Web Pages:
35+
36+
- **/**: Main dashboard for real-time data visualization.
37+
- **/current**: Shows the latest sensor readings.
38+
39+
## License
40+
41+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
42+
43+
## Contributing
44+
45+
Contributions are welcome! Please fork the repository and submit a pull request.
46+
47+
## Contact
48+
49+
If you have any questions or issues, feel free to open an issue in the repository or contact me directly.

0 commit comments

Comments
 (0)