×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

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

  • Posts: 89
  • Thank you received: 16
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
Last edit: 4 years 4 weeks ago by Adrian. Reason: Solved
4 years 4 weeks ago #50967
Attachments:

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

  • Posts: 1185
  • Thank you received: 370
Hi Adrian,
nice to hear that you like it.Simple answer: YES.

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.

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

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

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

Hope that helps.
Wolfgang
The following user(s) said Thank You: Adrian
4 years 4 weeks ago #50970

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

Time to create page: 0.150 seconds