N8MDP
New Member
Posts: 33
Raspberry Pi: Yes
Other Device: Arduino
|
Post by N8MDP on Jun 13, 2021 11:18:23 GMT -8
Now that I have the GroveWeather python code updated for python3 (and it's working great!), my next step is to create a webpage where the data from the python program is used to update graphical gauges and charts. Right now, when the 'sampleAndDisplay' function is executed, I build an html page that outputs textual results. Every time the function is repeated, the HTML page is rebuilt. The output looks like the following:
N8MDP Weather Station Data
Raspberry Pi Time = 2021-06-13 15:08:51
DS3231 Temperature= 21.75 C
Rain Total= 0.00 in
Rain Last 60 Minutes= 0.00 in
Wind Speed= 0.00 MPH
MPH wind_gust= 0.00 MPH
Wind Direction= 67.50 Degrees
Barn Temperature = 71.94 *F
Altitude = 361.11 m
Barometer = 28.67 in Hg
Lightning Count = 0.0
Outside Temperature: 68.7 F
Outside Humidity: 52.2 %
The webpage is being served using an Apache2 server.
What I would like to do is use the measurements from the python program to drive gauges on a webpage. I've been looking at the Plotly Python libraries. I got a gauge to work but I'm not sure how to pass the python data to the webpage to have the gauges update. Right now, each time the code executes, it just opens another webpage tab with a new gauge. I want the gauges to update on the same page, not open a new tab each time in the browser.
Are there other gauge like or plotting tools that I should be looking at for a dynamically updating webpage? I've seen some posts about passing python data to javascript. Not quite sure how to do this. I'm sure this has been done before. Would appreciate someone could point me in the right direction.
Thanks...N8MDP
|
|
|
Post by SDL on Jun 16, 2021 12:35:38 GMT -8
For plotly, take a look at the dash app software in the SkyWeather2 source code. That is what we are doing for the newer SkyWeather2 systems. You could adapt or use it for a model at least. github.com/switchdoclabs/SDL_Pi_SkyWeather2BP
|
|
N8MDP
New Member
Posts: 33
Raspberry Pi: Yes
Other Device: Arduino
|
Post by N8MDP on Jun 16, 2021 15:10:20 GMT -8
I'll check it out. Thanks!
|
|