Web interface for Enviro and Enviro+ sensor board plugged into a Raspberry Pi.
This simple webapp serves a page with the current sensor readings in a graph over a specified time period.
Runs thanks to Flask and Chart.js
Choose the tutorial that matches your Raspberry Pi OS:
Installation and setup for Bookworm
Installation and setup for Bullseye
Feel free to add your features and improvements.
In the file CONTRIBUTING.md you have detailed information that explains how to collaborate with this project.
Contributions made by users on the Enviro Plus Web by merge requests:
William A Loring, Hagoort, Alex, Musa Ecer, Daniel Fr, i.j
GNU Affero General Public License v3.0
-
Your data will be stored in the same place where you have the application, in JSON format inside a folder called
/enviroplusweb-data. -
Enter
hostname -Iin a Terminal window on your Raspberry Pi, then you will see the IPv4 and the IPv6. -
You need to wait to have some data recorded in your Raspberry Pi. If you just run the app for first time, give it some time to save a few readings (~30min).
-
Version 4 brings a major change in file reading and management. These changes mean that readings from old versions are not taken into account due to their different file name format and JSON structure.
However, there is a fix, which requires two actions:
- Renaming the reading files
- Editing the files format/content
First step:
Access to the folder where you have the readings (by default/enviroplusweb-data). You will see that the files have the following file name: YEAR-0xx (eg: 2025-034)You need to change the file name, including the month and day it belongs to. For example, if the file 2025-034 has the readings for 14th April 2025, then the file should be renamed as: 2025-04-14.json
Second step:
Edit each JSON file and add the character[at the beginning of the file. Do the same thing, including the character]at the end of the file. To finish, just add a comma,at the end of each line/reading in the list, which is after the character}(remember that the last reading doesn't need a comma).Once done, you can reboot your Raspberry Pi and the old readings will appear in your graphs.
-
When I connect a display via HDMI to the Raspberry Pi Zero W, this error shows in the terminal:
ValueError: No input device matching 'adau7002'
Simply disconnecting the HDMI cable solves the problem.Another case where this error occurs, is after a reboot at application launch (no display connected).
It seems that the library that manages the audio is not very reliable. There is a thread about this issue that is still open.
At the moment the quickest solution is to reboot your Raspberry Pi again. -
You can change the port to avoid any conflict with other applications. In that case edit the file
config.pyand find this line:HOST_PORT = 8080
Just change the
HOST_PORTfor another number (for example4567) and run again the app. Now you can access to your EnviroPlusWeb typing the ip address followed by:4567 -
If running your app, you can see in the terminal or in the log file the following message:
* Serving Flask app 'enviroplusweb' * Debug mode: off Permission deniedThis problem may be due to
port=80not being available to be used by the application and you have to use another port. -
By default you use HTTP to connect to your Raspberry Pi through your browser, but some browsers will redirect automatically to HTTPS. If you prefer to have your project running under HTTPS here you have a tutorial explaning how to setup Flask with HTTPS:
https://blog.miguelgrinberg.com/post/running-your-flask-application-over-https -
There is an option that manages the power of the wifi and allows to put it in saving mode. Disabling this option may help you to avoid this problem. First check if the wifi power save feature is enabled or not:
iw wlan0 get power_saveIf it is enabled, then edit the following file. Remember to replace in the path your HOSTNAME (if your default hostname is not 'pi'):
sudo nano /home/pi/.bashrcAnd add the following line at the end:
sudo iwconfig wlan0 power offReboot and check again typing the first command to see if the feature is enabled or not.
Check the closed issues, you might find your question there.
If nothing matches with your problem, check the open issues or feel free to create a new one.

