You are very nearly there. The next step is to turn that script you have written into a function and save it as SI7021.py in the /lib directory. It is easy to do, so I have done it for you. See the attachment here: SI7021.txt (1.0 KB). I have also modified the code to pass the inTemp variable into the function so that it can be updated with the new temperature. I have hard-coded the temperature in Celsius to be displayed.
Once you have saved it (make sure you change from the .txt to .py extension), open main.py and on line 194 add:
from lib import SI7021
This makes sure the PiConsole knows about the function you wrote. Next we want to call the function from main.py. On line 317 add:
This calls the function immediately and should update the indoor temperature on the display. The last line of SI7021.read schedules the function to be called again in 60 seconds, so it should continue to get the indoor temperature each minute.
Once that is working you should be able to work out how to get the indoor humidity to be displayed. It is important to note, however, that a variable doesn’t exist for the indoor humidity, nor is there a place for it to be displayed, so you will need to dig into the code a lot more.
Peter you are amazing, thank you so much
I’m not really worried about the indoor humidity to be honest, it came with the sensor and I only wanted that sensor because it’s accuracy was much better than the bme280/ds18b20 etc
my next job is to figure out how to get the pi to calculate the min/max indoor temp and time they were at
displaying the results “should” be easy enough to figure out
Thank you for the help
Check out the file lib/derived variables.py. There is a function called outTempMaxMin and inTempMaxMin in there that will provide a good starting point.
Thanks Peter for all the help
for the life of me I cannot figure out where the info for inTempMin and inTempMax is pulled from to show on the display along with the time of the reading
Just wanted to pass on a discovery I made by mistake …
I was able to get my Rpi2 to display wfpiconsole with good aspect ratio, on my 8"Mini HDMI monitor. The same as it was on my Rpi4.
I took the SDcard from my Rpi4 and booted on my Pi Model 2B V1.1 - and it displayed the same.
It is not automatically installed on the Desktop version. Unable to install RealVNC, so I tried TightVNC and TigerVNC, but neither got me the display of the console. I could always log in and see the desktop, but that is where it stopped.
I finally found a solution using Xrdp and it works great and I can see console on my Galaxy 2 tablet!! Success!! Thanks
Peter (or anyone)
Could you tell me where the indoor min/max temps and times are called from to show on the display?
I’ve got the indoor temp showing from my SI7021 and I “think” I have the min/max working but I’m not sure how to get them to display
In the SI7021.py file the variables you need to set are Obs['inTempMin'] and Obs['inTempMax']. The format of these variables needs to be a list, with five elements in each. The elements are
[
max/min temperature as a string,
u'\N{DEGREE CELSIUS}',
time of max/min formatted as a string,
max/min temp as a float,
time of max/min temp as a datetime
]
If you look on lines 321-402 of lib/derivedVariables you will see how these lists are constructed. Note that the format of some of the elements is different (e.g. the second element is ‘c’ rather than ‘u’\N{DEGREE CELSIUS}‘’) as they are converted to the correct format in later steps. Ignore these differences and just stick to the formats I listed above.
So i built up a Pi3B with the following mini 3.5" display. Amazon.com
It’s 480x320 resolution.
I am hoping to use it as a mini monitor for weather status in say a master closet/bath so we know what the weather is without a huge display. but either way… it connects to the Pi via the GPIO interface vs the HDMI port. when i run wfpiconsole start, it ends up loading the interface via the HDMI display output and not the GPIO display. is there a way to switch this?
Hi @brian.vargo, I’m sorry but I’m not sure I know the answer here. I have never tried using an SPI display plugged into the GPIO pins. Have you tried removing the HDMI connection completely and then starting the console? It might be that it defaults to the HDMI screen if it is present, but will use the SPI screen if it is not.
Another option would be to turn the HDMI connection off at a hardware level. Try this at your own risk (make sure you have an alternative way to view the desktop/access a terminal if you need to turn it back on). The command you want is:
I tried turning off the hdmi output like you had suggested, but then I get an unable to get a window error similar to what’s been seen by some of the VNC users above. I’ll have to try it again later today and copy the error message.
Was sooo excited to update to the new version with the new settable resolution. Unfortunately, I said YES to the full update to the Pi and it hung for hours on Weewx. Tried rebooting and am stuck in a boot loop. But wait, I have an image backup so OK, right? Nope, I get a “not enough space” error when trying to write the image to a brand new SD Card. I may have to wipe everything and start over - Ugg!
Sadly, the last time I ran Wfpiconsole update, I did the full Pi update and it worked fine. Time to start over I guess. Still love PiConsole though!
I have done some Googling and it seems like the SPI interface that the screen uses is the problem. Sorry! The SPI interface is controlled by the CPU, whereas Kivy uses the GPU. It looks like there are some workarounds available though that might help:
Unfortunately I haven’t tested every possible screen, so sorry you’re the first person to run into this.
I have now completed the installation on R.Pi3 B + (with 7 "original touch display), it works great, only the weather forecast data is blank (as well as SAGER). Can’t you advise me on what could be the problem?
I am from the Czech Republic and I have WF AIR and SKY.
Another problem, how to set the display to turn off (after a short touch, the image pops up again)?
I’m new to Raspberry, so it will probably be some system setup …