×
INDI Library v1.8.4 Released

Minor bugfix release with some highlights:

Weatherradio - indiserver starup, timezone issue, lastupdate field blank[SOLVED]

1 week 6 days ago 1 week 4 days ago by procras. Reason: Solved
procras
Senior Boarder
Senior Boarder
Posts: 55
More
Topic Author
Weatherradio - indiserver starup, timezone issue, lastupdate field blank[SOLVED] #50967
I am looking at weatherradio and the recent documentation posted on github

github.com/indilib/indi-3rdparty/blob/ma...adme-WeatherRadio.md

<strong>Thank you Wolfgang for this nice firmware and website addon.</strong>

<em>Question regarding indiserver start up.</em>
I have run ekos and started weather radio and see all the nice readings, and lights etc.
I have set my preferred sensors for the readings and saved the configuration.

I would like to run weatherradio without Ekos, for instance just to have the web pages.
Can I simply execute
$ indiserver -v indi_weatherradio
Will this pick up any settings from ~/.indi/Weather Radio_config.xml ?

<em>Question regarding data on webpage - graph times (locale and timezone problem)</em>
In bin/wr_rrd_fetch.py and bin/wr_rrd_lastupdate.py the default timezone is set to 1, (? for central europe)
I am in Cork.
My data is saved in the rrd files like so
<code>
Python 2.7.16 (default, Oct 10 2019, 22:02:15)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rrdtool
>>> a = rrdtool.lastupdate("sensors.rrd")
>>> print (a)
{'date': datetime.datetime(2020, 3, 21, 11, 19, 7), 'ds': {'BME280_Temp': 20.94, 'MLX90614_Tamb': 19.91, 'TSL2591_Lux': 19.51082, 'BME280_Pres': 1020.375, 'MLX90614_Tobj': 19.19, 'DHT_Temp': None, 'DHT_Hum': None, 'BME280_Hum': 59.03027}}
>>>
</code>
Which is in my localtime.

But the graphs are one hour ahead of this due to timezone calculation.
<code>
$ cd /usr/share/weatherradio/bin
$ grep timezone *.py
wr_rrd_fetch.py:parser.add_argument("-t", "--timezone", default=1, type=int,
wr_rrd_fetch.py: series[categories[pos]]["data"].append([(time + args.timezone*3600)*1000, round(y, 2)])
</code>

Should I set the default to 0 here or should I pass -t 0 to the call from cron ?

Question regarding lastupdate on webpage
See screenshot of homepage

lastupdate is --
Not sure why it does not contain the correct time.

In charts.js
<code>
document.querySelector("#lastupdate").textContent = new Date(lastUpdate).toLocaleString();
</code>
Should I pass en-IE to toLocaleString ?
<code>
document.querySelector("#lastupdate").textContent = new Date(lastUpdate).toLocaleString("en-IE");
</code>

<em>Question re autoupdate of webpage</em>
Does the page autoupdate when new values are available?

<em>Question about best way to change webpage when I don't have the anenometer</em>
I don't have the anenometer. Should I just edit weatherradio.html to delete the references to the windspeed?

Again sorry for all the questions, just trying to get to grips with weatherradio.

Adrian
Attachments:

Please Log in or Create an account to join the conversation.

1 week 6 days ago
sterne-jaeger
Platinum Boarder
Platinum Boarder
Posts: 478
Karma: 6
More
Weatherradio - indiserver starup, timezone issue, lastupdate field blank[SOLVED] #50970
Hi Adrian,
nice to hear that you like it.

I would like to run weatherradio without Ekos, for instance just to have the web pages.
Can I simply execute
$ indiserver -v indi_weatherradio
Will this pick up any settings from ~/.indi/Weather Radio_config.xml ?

Simple answer: YES.

<em>Question regarding data on webpage - graph times (locale and timezone problem)</em>
In bin/wr_rrd_fetch.py and bin/wr_rrd_lastupdate.py the default timezone is set to 1, (? for central europe)
I am in Cork.
...
Should I set the default to 0 here or should I pass -t 0 to the call from cron ?

YES! The RRD file holds the values as GMT values. So if you want to display the time series also with GMT, simply pass a "-t 0" to the scripts generating the JSON docs.

Question regarding lastupdate on webpage
...
Not sure why it does not contain the correct time.

Should I pass en-IE to toLocaleString ?
<code>
document.querySelector("#lastupdate").textContent = new Date(lastUpdate).toLocaleString("en-IE");
</code>

Hm, not sure where the problem is. Did you generate the RTdata_lastupdate.json?

Does the page autoupdate when new values are available?

No, you need to push the refresh button of your browser.

I don't have the anenometer. Should I just edit weatherradio.html to delete the references to the windspeed?

Right. Maybe you need to clean up the javascript code in js/charts.js

Hope that helps.
Wolfgang

TSA-120 + FSQ-85 + GSO 150/750 | Avalon Linear + M-zero | Moravian G2-8300 + ASI 1600mm pro + ASI 294mc pro | KStars/INDI on Raspberry Pi 4 with Raspbian 10
The following user(s) said Thank You procras

Please Log in or Create an account to join the conversation.

Time to create page: 0.247 seconds