EnviroPlus Assistance

Greetings
Success at last!
But of course I have two questions?

  1. You mentioned the program saves sensor data.
    How long does is save the data, does it write over old readings?
  2. You mention, the web address with suffix :80 instead of :5000. Do I need to change from :5000 to :80, so why and how?
    I plan on using VNC to remotely access the enviro plus.
    Thanks so much for your help and understanding in getting this project running,
    Cheers
    Tom

It averages 5 minutes of data sampled every second, i.e. 300 samples and writes them to the end of the file for the day every 5 minutes. It creates a new file very day, so no, it doesn’t overwrite old readings. The files are in the data folder and they are in JSON format.

A day’s worth of data is about 62K, so about 22MB per year, so after about 136 years it will fill the SD card!

If you change the port to 80, it simply means you can drop the :5000 suffix from the web address as browsers default to port 80. To change it you need to change this line: https://github.com/nophead/EnviroPlusWeb/blob/master/app.py#L196 and then start it with sudo python3 app.py.

I don’t know why you would need VNC. That is a remote desktop viewer but you only need a web browser to see the page from any device on your local network.

Greetings

Ok on data saving, that should work fine for me.
How would I look at past JSON data files ?

Fine on - changing the port to 80, I understand that now.

I will mostly babies the data/graph locally but I want to experiment and occasionally view graph remotely- so would VNC work for that purpose or do suggest something else

Again thank you so much for a for a great program, looks like you have good python program skills, way better than myself.
Thanks
Tom

Currently you can only see the past by going to bigger time spans, i.e. week, month, year. Each one averages more data points to keep the number of graph points around 300. Week is half hour resolution, month is two hour and year one day.

I might add an option to scroll backwards eventually but I am currently working on designing a 3D printed case.

I don’r run a desktop on my RPI0, so VNC would not work for me. Are you viewing the page on a browser running on the RPI?

To view it on another machine on the same network you just need to use a browser. For example I can view it on my phone or PC with Chrome.

Greetings

Ok on the recording graph time and graph history.
Yes, currently using the web browser on RPI to view the graph, so I figured that VNC might work to see screen remotely.
I was wondering how you would view past recorded data as you mentioned they are saved using JSON.
Thanks
Tom

When the program starts it reads all the past data so that it can do the year view. Obviously I haven’t tested that for more than a few days. The data in memory should be a lot smaller than the JSON file representation, so I don’t think it will be a problem for many years.

Yes you could use VNC to view a local browser remotely bit it is a lot easier and more efficient to just use a remote browser.

Greetings

Hoping to experiment with Enviroplus project more this upcoming weekend, when Some free time.
Thanks again
Tom

Greetings

Have been viewing/observing data using your enviro + program with very interesting results.
I am both intrigued and disturbed by data observations.

  1. Both temperature and humidity readings seemed to be “off”. Humidity seems low and temperature reading seem much higher than should be. I have tried to isolate and insulate the raspberry pi from the Enviroplus board but the temperature reading still appears high.
    Wonder if you have observed this and have you done any “offset” calculations?

2 Have observed some interesting “particle” spikes which I cannot seem to correlate to any events, where all particle numbers “spike” around midnight?? Furnace had not turned on yet, so kind of puzzling.
Tom

To get temperature correct I had to mount the board at right angles and have a small fan blowing on the back of it. Humidity is relative to temperate so getting the temperature correct causes it to rise. I did that rather than use an offset because the offset doesn’t correct the humidity reading.

It is still about 5% lower than two other hygrometers I have but I don’t know how accurate they are.

Most of my particle peaks can be explained by cooking or bed making. I did have one sharp rise at midnight on Thursday that I can’t explain. We did cook 7 moussakas earlier in the evening and that did give a huge NO2 spike but the particle peak was about two hours later.

Greetings

  1. How did you mount the entire Enviroplus at right angles- you use a 40 pin extender cable? Are the boards separated a large distance from each other? Every time I try an entender cable I get error messages, so elevated the Enviroplus board about 2 inches above the raspberry pi which is in a plastic case, with foam between the case and the Enviroplus board and still the temp is too high. I am using three male/female headers to raise the enviro board above the RPI.
  2. So when you say you use a fan, I assume your are cooling the raspberry pi and not the Enviroplus board ?
    I think I may have to try cooling the raspberry pi better with a small fan, I would rather not use “ correction”
  3. As I am writing this, I may have figured out the particle number rise, about midnight we turn on air air cleaner, which may stir up the air in the room.
    The air cleaner is about 8-10 feet away from setup.
    Tom
  1. The RPI 0 is supplied without a connector so I simply used a right angled header instead of a straight one.
  2. No I cool the Enviro+ with the fan.
  3. That makes sense.

This is my current test setup. I need to design a 3D printed case for it.

Another dashboard for a enviroplus - using a tiny bit of Ruby, writing to a influxdb database and the using Grafana to create the dashboard. All open source stuff running in the house.
Let’s see if I managed to get the screenshot uploaded (-;

2 Likes

Hey Guys,

This looks amazing but what are the install requirements?
I’ve installed Flask with pip3 install Flask but I get this error:

:~/EnviroPlusWeb $ sudo python3 app.py 
Traceback (most recent call last):
  File "app.py", line 27, in <module>
    from enviroplus import gas
  File "/usr/local/lib/python3.7/dist-packages/enviroplus-0.0.1-py3.7.egg/enviroplus/gas.py", line 6, in <module>
ModuleNotFoundError: No module named 'RPi'

I’ve installed python2 Flask but I get this error when I run python app.py and no webserver on :5000

('Particle read failed:', 'ReadTimeoutError')

The latest code on GitHub runs on port 80, i.e. the default for http.

Does the Pimoroni particle demo work?

No I’m not, good point :/

pi@RaspberryPiEnviro:~/enviroplus-python/examples $ sudo python particulates.py 
2019-10-15 09:09:37.360 INFO     particulates.py - Print readings from the PMS5003 particulate sensor.

Press Ctrl+C to exit!

Should I be using “python” or “python3” :) ?

I use Python3, Python2 is EOL in Jan 2020, https://pythonclock.org/

You shouldn’t need sudo to run the examples. It is just needed to start the app if it is on port 80 as mere users are not allowed to take over that port.

OK, no worries.

So I’ve fixed the python3 issue with installing python3-dev python3-rpi.gpio.
I’m still not seeing the webserver:

~/EnviroPlusWeb $ python3 app.py 
Particle read failed: ReadTimeoutError
Particle read failed: ReadTimeoutError
Particle read failed: ReadTimeoutError
Particle read failed: ReadTimeoutError
Particle read failed: ReadTimeoutError
Particle read failed: ReadTimeoutError

pi@RaspberryPiEnviro:~/EnviroPlusWeb $ sudo netstat -tulpn | grep :80
pi@RaspberryPiEnviro:~/EnviroPlusWeb $ 

I assume the reason it is not initializing web server is that it is failing on Particle Read.
Do you have any additional attachments of just the EnviroPlus Board?
Should the particulates.py from examples work of the box?

You need the separate plug in module https://shop.pimoroni.com/products/pms5003-particulate-matter-sensor-with-cable to measure particles.

ahh i see thank you, sorry about that.

I assume i should be able to cut out that part of the app.py to skip it?

Yes you could hack out the reading of it from app.py.

If you are not planning to get one remove the entries from the record and also remove the display here: https://github.com/nophead/EnviroPlusWeb/blob/master/templates/readings.html#L10 and the graphing here: https://github.com/nophead/EnviroPlusWeb/blob/master/templates/index.html#L77.

If you are planning to get one in the future then write zeros to the record and keep the display stuff in place.