Adrian replied to the topic 'weatherradio cron scripts in Readme-WeatherRadio.md' in the forum. 2 months ago

Thanks Wolfgang

The first block generates the RTdata_[1d|30d|6h|7d].json files

and the second block generates the RTsensors_[1d|30d|6h|7d].json files

Thanks for explaining this.

Adrian

Read More...

Adrian created a new topic ' weatherradio cron scripts in Readme-WeatherRadio.md' in the forum. 2 months ago

I have been trying out weatherradio which is a very nice weather station.

Thank you very much Wolfgang

I have a question regarding the cron scripts outlined in the documentation.

indi-3rdparty/indi-duino/doc/Readme-WeatherRadio.md

#
# cron jobs for arduino weather radio
#
#
 4,9,14,19,24,29,34,39,44,49,54,59 * * * *     <userid> /usr/share/weatherradio/bin/wr_rrd_update.py
 4,9,14,19,24,29,34,39,44,49,54,59 * * * *     <userid> /usr/share/weatherradio/bin/wr_rrd_update_sensordata.py

#---------------------------------------------------
# Update JSON export files
#---------------------------------------------------
 */5 * * * *     <userid> /usr/share/weatherradio/bin/wr_rrd_lastupdate.py 
 */5 * * * *     <userid> /usr/share/weatherradio/bin/wr_rrd_fetch.py -s 6h
 */15 * * * *     <userid> /usr/share/weatherradio/bin/wr_rrd_fetch.py -s 1d
 0 * * * *     <userid> /usr/share/weatherradio/bin/wr_rrd_fetch.py -s 7d
 0 0 * * *     <userid> /usr/share/weatherradio/bin/wr_rrd_fetch.py -s 30d

*/5 * * * * <userid> /usr/share/weatherradio/bin/wr_rrd_fetch.py -s 6h -o /usr/share/weatherradio/html/data/RTsensors_6h.json /usr/share/weatherradio/sensors.rrd
*/15 * * * * <userid> /usr/share/weatherradio/bin/wr_rrd_fetch.py -s 1d -o /usr/share/weatherradio/html/data/RTsensors_1d.json /usr/share/weatherradio/sensors.rrd
0 * * * * <userid> /usr/share/weatherradio/bin/wr_rrd_fetch.py -s 7d -o /usr/share/weatherradio/html/data/RTsensors_7d.json /usr/share/weatherradio/sensors.rrd
0 0 * * * <userid> /usr/share/weatherradio/bin/wr_rrd_fetch.py -s 30d -o /usr/share/weatherradio/html/data/RTsensors_30d.json /usr/share/weatherradio/sensors.rrd

It seems that the first set of calls to we_rrd_fetch.py -s [6h|1d|7d|30] are repeated in the second batch which declares the -o file and the sensors.rrd files.

These are already defined and included from wr_config.py


Can't the last block be deleted?
*/5 * * * * <userid> /usr/share/weatherradio/bin/wr_rrd_fetch.py -s 6h -o /usr/share/weatherradio/html/data/RTsensors_6h.json /usr/share/weatherradio/sensors.rrd
*/15 * * * * <userid> /usr/share/weatherradio/bin/wr_rrd_fetch.py -s 1d -o /usr/share/weatherradio/html/data/RTsensors_1d.json /usr/share/weatherradio/sensors.rrd
0 * * * * <userid> /usr/share/weatherradio/bin/wr_rrd_fetch.py -s 7d -o /usr/share/weatherradio/html/data/RTsensors_7d.json /usr/share/weatherradio/sensors.rrd
0 0 * * * <userid> /usr/share/weatherradio/bin/wr_rrd_fetch.py -s 30d -o /usr/share/weatherradio/html/data/RTsensors_30d.json /usr/share/weatherradio/sensors.rrd

Am I misunderstanding something, or is this a typo?

Adrian

Read More...

Adrian replied to the topic 'weatherradio lastupdate field blank when no windspeed' in the forum. 2 months ago

Thanks Wolfgang for fixing this.

Those changes to charts.js have fixed the problem with lastupdate when there is no windspeed.

Also it updates every 5 minutes on its own.
The time shown is the last time the data was updated which is before the current time as there is no sync between
the python scripts executing in cron and the webpage update, not a problem.

I will open another topic regarding a question I have on the cron scripts in Readme-WeatherRadio.md

Adrian

Read More...

Adrian created a new topic ' weatherradio lastupdate field blank when no windspeed' in the forum. 3 months ago

From my other post the lastupdate field contains only -- and not the proper date and time.

The root of the problem is that I don not have a wind speed device.

The function in chart.js that updates #lastupdate throws an error due to there being no windspeed.

Uncaught TypeError: Cannot read property 'toFixed' of null
    at Object.success (charts.js:263)
    at c (jquery.min.js:2)
    at Object.fireWith [as resolveWith] (jquery.min.js:2)
    at l (jquery.min.js:2)
    at XMLHttpRequest.<anonymous> (jquery.min.js:2)
(anonymous)	@	charts.js:263
c	@	jquery.min.js:2
fireWith	@	jquery.min.js:2
l	@	jquery.min.js:2
(anonymous)	@	jquery.min.js:2
load (async)		
send	@	jquery.min.js:2
ajax	@	jquery.min.js:2
k.<computed>	@	jquery.min.js:2
updateSeries	@	charts.js:240
init	@	charts.js:232
onload	@	weatherradio.html:19

This is triggered by
   windSpeed.updateSeries([{name: "Wind Speed", data: [currentWindSpeed]}]);

Moving call to update lastupdated prior to this means it gets updated fine.

Tweaking required if the probes/sensors do not match up with the webpage.

Read More...

I am looking at weatherradio and the recent documentation posted on github

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

Thank you Wolfgang for this nice firmware and website addon.

Question regarding indiserver start up.
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 ?

Question regarding data on webpage - graph times (locale and timezone problem)
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

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}}
>>> 
Which is in my localtime.

But the graphs are one hour ahead of this due to timezone calculation.
$ 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)])

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
        document.querySelector("#lastupdate").textContent = new Date(lastUpdate).toLocaleString();
Should I pass en-IE to toLocaleString ?
       document.querySelector("#lastupdate").textContent = new Date(lastUpdate).toLocaleString("en-IE");

Question re autoupdate of webpage
Does the page autoupdate when new values are available?

Question about best way to change webpage when I don't have the anenometer
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

Read More...

Adrian replied to the topic 'meteostationWEB cloud flag 0 when clouds: 100% (SOLVED)' in the forum. 3 months ago

Problem wasn't me this time.

In case anyone else has a problem with this.

The recent updates to indiduinoMETEO.ino have
- put in a divider by 100.0 on the mlx reads (not sure if this is for a different version of the Adafruit library or a different sensor)
- reveresed the meaning of the cloudy and freezing flags.

400,403c400,401
<     //Tir = mlx.readAmbientTempC() / 100.0;
<     Tir = mlx.readAmbientTempC();
<     //IR = mlx.readObjectTempC() / 100.0;
<     IR = mlx.readObjectTempC();
---
>     Tir = mlx.readAmbientTempC() / 100.0;
>     IR = mlx.readObjectTempC() / 100.0;
512c510
<     if (cloudy==IPS_ALERT) {
---
>     if (cloudy==IPS_OK) {
524c522
<     if (frezzing==IPS_ALERT) {
---
>     if (frezzing==IPS_OK) {
1279d1276
<     runMeteoStation();
1280a1278
>     runMeteoStation();

Now my meteostation is reporting the correct flags for cloudy and freezing :-)



Marking this as SOLVED

Read More...

Adrian replied to the topic 'Indiduino MeteoStation (legacy and SQM) buttons non responsive' in the forum. 3 months ago

Thanks G_Gagnon.

I have got meteostationWEB working with meteostationSQM_sk.xml

I had to alter the meteoRRD_updater.py script so it wasn't looking for light

63d62
<         skyQuality=vectorMeteo.get_element("WEATHER_SKY_QUALITY").get_float()
65,66c64,65
<         #vectorLIGHT=indi.get_vector(INDIDEVICE,"LIGHT")
< 	#light=vectorLIGHT.get_element("LIGHT").get_float()
---
>         vectorLIGHT=indi.get_vector(INDIDEVICE,"LIGHT")
> 	light=vectorLIGHT.get_element("LIGHT").get_float()
72d70
<         daylightFlag=int(statusVector.get_element("daylight").is_ok())
74c72
< 	return (("HR",HR),("Thr",Thr),("IR",IR),("Tir",Tir),("P",P),("Tp",Tp),("Dew",dew),("Light",skyQuality),
---
> 	return (("HR",HR),("Thr",Thr),("IR",IR),("Tir",Tir),("P",P),("Tp",Tp),("Dew",dew),("Light",light),
76c74
<            ("frezzingFlag",frezzingFlag),("daylightFlag",daylightFlag))
---
>            ("frezzingFlag",frezzingFlag))

The cloudflag, dewflag,frezzingFlag initially were all zero. But then the frezzing flag went on
{'date': datetime.datetime(2020, 2, 23, 17, 33, 20), 'ds': {'HR': 67.14, 'Thr': 0.0, 'IR': 19.25, 'Tir': 18.55, 'P': 1019.3, 'Tp': 19.1, 'Dew': 12.85, 'Light': 6.93, 'T': 19.1, 'clouds': 100.0, 'skyT': 12.65, 'cloudFlag': 0.0, 'dewFlag': 0.0, 'frezzingFlag': 1.0, 'daylightFlag': 0.0}}

See image

I suspect that as it occurs with kstars and meteostationWEB, there must be a problem in the indiduinoMETEO.ino file or
at least a disagreement between the indiduinoMETEO.ino sketch and the meteostationSQM_sk.xml file.

Will have another peep!

Read More...

Adrian replied to the topic 'Indiduino MeteoStation (legacy and SQM) buttons non responsive' in the forum. 3 months ago

I have the same issue with the non-responsive Connect button.
It happens each time unless I
$ cd ~/.indi
$ rm Arduino*

Then it connects ok.

I am using the mlx90614, TSL2591 and BME280 sensors on I2C connected to an arduino Uno

My mlx IR T and mlx ambient T were giving strange values, the conversions in the meteostationSQM_sk.xml file seemed ok and corresponded with the
case 0: etc switch statement in the indiduinoMETEO.ino file.

However there was a / 100.0 in the mlx.read statements in the indiduinoMETEO.ino file, I don't recall if this is new.

  if (mlxSuccess) {
    //Tir = mlx.readAmbientTempC() / 100.0;
    Tir = mlx.readAmbientTempC();
    //IR = mlx.readObjectTempC() / 100.0;
    IR = mlx.readObjectTempC();
  } else if (mlxSuccess = mlx.begin()) {

So I edited that and the temperatures look okay now.

But my lights/flags for Cloudy, Freezing daylight don't appear to work. They are usually just grey.

Sometimes the Freezing flag is green when it is not freezing,
The cloudy flag is grey when clouds are 100%.
The daylight flag is grey when it is daytime.

I attach the /usr/share/indi/meteostationSQM_sk.xml file,

File Attachment:

File Name: SQM_sk.xml.txt
File Size: 5 KB


I also attach a log file,

File Attachment:

File Name: indi_duino_120438.log
File Size: 42 KB


Strange!

Read More...

Adrian replied to the topic 'meteostationWEB cloud flag 0 when clouds: 100%' in the forum. 4 months ago

My mistake again
The RTdata.json file shows

{"cloudFlag": 1.0, "dewFlag": 0.0, "clouds": 100.0, "HR": 56.76, "Light": 16.17, "IR": 20.69, "Thr": 0.0, "Tir": 21.8, "Dew": 12.8, "P": 992.0, "frezzingFlag": 0.0, "Tp": 21.75, "TIME": "Sun Feb 16 18:34:22 2020", "skyT": 13.15, "T": 21.75}

Where as the RRD file contains
{'date': datetime.datetime(2020, 2, 16, 18, 34, 42), 'ds': {'HR': 56.64, 'Thr': 0.0, 'IR': 20.65, 'Tir': 21.75, 'P': 992.1, 'Tp': 21.75, 'Dew': 12.75, 'Light': 16.0, 'T': 21.75, 'clouds': 100.0, 'skyT': 13.1, 'cloudFlag': 1.0, 'dewFlag': 0.0, 'frezzingFlag': 0.0}}


Read More...

Adrian created a new topic ' meteostationWEB cloud flag 0 when clouds: 100%' in the forum. 4 months ago

I am rebuilding my meteostation with the new sensors: BME280, TSL2591 in addition to my old MLX90614.
All are connected to the I2C bus on an arduino Uno.

All work fine with I2CScanner and the Adafruit test programs.

I have uploaded the indiduinoMETEO.ino file from the indi-3rdparty/indi-duino/devices/Firmwares/indiduinoMETEO

I didnt have any luck with meteostationSQM_sk.xml so I edited meteostation_sk.xml

31,32c31,32
<     <defNumber name="WEATHER_SKY_QUALITY" label="Sky Qual (mag/arcsec2)" format="%4.2f" min="0" max="10240" step="1">
<     <indiduino pin="21" type="input" mul="0.01" add="0"/>
---
>     <defNumber name="WEATHER_IR_RADIANCE" label="IR Radiance" format="%5.0f" min="0" max="10240" step="1">
>     <indiduino pin="21" type="input" mul="1" add="0"/>
47c47
<     <defLight name="frezzing" label="Freezing">
---
>     <defLight name="frezzing" label="frezzing">
97,99c97,99
< <defNumberVector device="Arduino MeteoStation" name="LIGHT" label="SQM" group="Raw Sensors" state="Idle" perm="ro" timeout="60">
<     <defNumber name="LIGHT" label="SQM (mag/arcsec2)" format="%4.2f" min="0" max="10240" step="0.01">
<     <indiduino pin="21" type="input" mul="0.01" add="0"/>
---
> <defNumberVector device="Arduino MeteoStation" name="LIGHT" label="IR Radiance" group="Raw Sensors" state="Idle" perm="ro" timeout="60">
>     <defNumber name="LIGHT" label="LIGHT" format="%5.0f" min="0" max="10240" step="1">
>     <indiduino pin="21" type="input" mul="1" add="0"/>
106c106
<     <defLight name="MLX_FAIL" label="MLX Failure">
---
>     <defLight name="IR" label="IR Failure">
110c110
<     <defLight name="SQM_FAIL" label="TSL Failure">
---
>     <defLight name="HR" label="HR Failure">
114c114
<     <defLight name="BME_FAIL" label="BME Failure">
---
>     <defLight name="P" label="P Failure">

I had to edit the javascript in index.html
329c329
< 								sqm.setValueAnimated(data.Light);
---
> 								sqm.setValueAnimated(data.SQM);

When I startMETEO.sh, I see a few

2020-02-16T17:49:13: Client 5: read: Connection reset by peer

Messages and things seem to work well enough.

But I see that my cloud flag is not set correctly

{'date': datetime.datetime(2020, 2, 16, 18, 8, 7), 'ds': {'HR': 57.78, 'Thr': 0.0, 'IR': 19.75, 'Tir': 20.65, 'P': 991.7, 'Tp': 20.75, 'Dew': 12.15, 'Light': 14.62, 'T': 20.75, 'clouds': 100.0, 'skyT': 12.55, 'cloudFlag': 0.0, 'dewFlag': 0.0, 'frezzingFlag': 0.0}}

and even though I have run it for a while I only see RTdata.json and no Min Max or Avg .json files.

Any ideas?

Adrian

Read More...