×

INDI Library v1.9.9 Released (30 Nov 2022)

Bi-monthly INDI Library released with new drivers and bug fixes.

Weather radio don't want connect

  • Posts: 1014
  • Thank you received: 302
I think I found the problem. All wr_rrd... scripts use wr_config.py as config reader. And config.py expects the configuration file weatherradio.ini either in /etc or in /usr/local/share/weatherradio.

Simply move the configuration file to /etc and then it should be used.

If you want to place it in a different location, simply change the corresponding code from line 63 onwards:
        # read config files
        for file in ['/etc/weatherradio.ini',
                     '/usr/local/share/weatherradio/weatherradio.ini']:
            self.config.read(file)
TSA-120 + FSQ-85 + ONTC 10"F4 Newton (+ epsilon-160 on Japan trip) | Avalon Linear + M-zero | ASI 1600mm pro + 6200mm pro | KStars/INDI on Raspberry Pi 4/Intel NUC
3 months 1 week ago #85674

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

  • Posts: 279
  • Thank you received: 54
Thanks Wolfgang,

I seem to have move forward as running wr_rrd_update.py with verbose gives me the following output, to which I added the print statement to confirm the connection:
Establishing connection SUCCEEDED to "Device:1"@192.168.2.245:7624
Reading weather data from "Weather Radio"@192.168.2.245:7624
Reading weather parameter...
Reading weather parameter... (succeeded)
Reading sensor data from "Weather Radio"@192.168.2.245:7624

My /etc/weatherradio.ini file is as follows:
#-----------------------------------------------------------------------
# Configuration file for weather radio.
#-----------------------------------------------------------------------
 
[WeatherRadio]
# INDI server delivering weather data
INDISERVER = 192.168.2.245
INDIPORT = 7624
# RRD storage holding time series data
RRDFILE = /usr/share/weatherradio/weather.rrd
 
# RRD storage holding time series for raw sensor data
RRDSENSORSFILE = /usr/share/weatherradio/sensors.rrd
 
# path to the JSON files holding the data
DATAPATH = /usr/share/weatherradio/html/data
 
# path to the directory holding web cam images and videos
MEDIADIR = /usr/share/weatherradio/html/media
 
#-----------------------------------------------------------------------
# configure INDI devices - create for each a separate section and
# let its name start with Device
#-----------------------------------------------------------------------
[Device:1]
# INDI device name
INDIDEVICE = Weather Radio
# INDI device connection mode: Ethernet or Serial
INDIDEVICEMODE = Ethernet
# INDI serial device port (only necessary for Serial mode)
###INDIDEVICEPORT = /dev/ttyUSB0
# INDI IP address (only necessary for Ethernet mode)
INDI_IP_ADDRESS = 192.168.2.155
# INDI IP port (only necessary for Ethernet mode)
INDI_IP_PORT = 80
# Geo Coordinates - Latitude (as decimal)
GEO_COORD_LAT = 45.5
# Geo Coordinates - Longitude (as decimal)
GEO_COORD_LONG = -75.75
# Geo Coordinates - Elevation (as decimal)
GEO_COORD_ELEV = 60.0
 
# [Device:2]
# INDIDEVICE = Rain Radio
# INDIDEVICEMODE = Serial
# INDIDEVICEPORT = /dev/ttyUSB0
# INDI_IP_ADDRESS = 172.28.4.42
# INDI_IP_PORT = 80
# GEO_COORD_LAT = 43.916876
# GEO_COORD_LONG = 5.716624
# GEO_COORD_ELEV = 650.0

What I am not sure of is that it's not clear that the script connects to the Weather Radio device @192.168.2.155 to get the weather and sensor data. The current weather data is not displayed on 192.168.2.245. I may be missing something trivial but I can't find it.

Thanks again for any help,

Gilles
3 months 1 week ago #85684

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

  • Posts: 1014
  • Thank you received: 302
Glad to see, Gilles!

The script wr_rrd_update.py connects to the INDI server you configured in the [WeatherRadio] section. This script needs to be run from the server that hosts the web page, since the wr_rrd_fetch.py script creates JSON files with the current weather data that should be placed in a directory that Apache sees. This directory is configured with the DATAPATH entry.

Wolfgang
TSA-120 + FSQ-85 + ONTC 10"F4 Newton (+ epsilon-160 on Japan trip) | Avalon Linear + M-zero | ASI 1600mm pro + 6200mm pro | KStars/INDI on Raspberry Pi 4/Intel NUC
3 months 1 week ago #85687

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

  • Posts: 279
  • Thank you received: 54
Got a little further as far as making sure connections were established but, apart from what seems to be a time code since the web page display the correct time range, the json sensor data are all 0.0. Below is the indi-weatherradio.service restart and output from ./bin/wr_rrd_update.py --verbose; as well as some data from /usr/share/weatherradio/html/data/RTdata_6h.json.

<code>
gilles@MissionControl:/usr/share/weatherradio$ sudo systemctl restart indi-weatherradio.service
gilles@MissionControl:/usr/share/weatherradio$ ./bin/wr_rrd_update.py --verbose
Setting ethernet ip:port to 192.168.2.155:80
Waiting for connection...
Connection succeeded.
Setting location to lat=45.5, long=-75.75, elev=60.0.
Reading weather data from "Weather Radio"@192.168.2.245:7624
Reading weather parameter...
Reading weather parameter... (succeeded)
Reading sensor data from "Weather Radio"@192.168.2.245:7624
gilles@MissionControl:/usr/share/weatherradio$ ./bin/wr_rrd_fetch.py -s 6h
</code>

<code>
{
"CloudCover":{
"data":[
[
1661423100000.0,
0.0
],
[
1661423400000.0,
0.0
],
[
1661423700000.0,
0.0
],
[
1661424000000.0,
0.0
],
[
1661424300000.0,
0.0
],
[
1661426100000.0,
0.0
],
[
1661426400000.0,
0.0
],
[
1661426700000.0,
0.0
],
[
1661428500000.0,
0.0
],
[
1661431200000.0,
0.0
],
[
1661431500000.0,
0.0
],
[
1661431800000.0,
0.0
]
],
"name":"CloudCover"
},
"DewPoint":{
"data":[
[
1661423100000.0,
0.0
],
[
1661423400000.0,
0.0
],
...
</code>

If I go directly to http://192.168.2.155 I get the current Weather Radio as shown below:
{"weather":{"Davis Anemometer":{"init":true,"direction":98,"avg speed":0.320915908,"min speed":0.22614342,"max speed":0.552159548,"rotations":8},"RG11 Rain Sensor":{"init":true,"mode":"drop detect","count":0,"drop freq":0},"BME280":{"init":true,"Temp":32.72999954,"Pres":1012.715942,"Hum":80.35742188},"MLX90614":{"init":true,"T amb":49.36998749,"T obj":3.249993801},"TSL2591":{"init":true,"Lux":60971.78516,"Visible":63550,"IR":19968,"Gain":0,"Timing":1}}}

And here is the Weather Radio web page:




Thanks again for any insight.
Last edit: 3 months 1 week ago by Gilles Gagnon. Reason: Added more info
3 months 1 week ago #85690
Attachments:

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

  • Posts: 1014
  • Thank you received: 302
Gilles,
it takes a couple of minutes until values are shown. If you want to check whether the RRD contains data, use
rrdtool fetch weather.rrd AVERAGE -s -6h

This should show you the last 6h of data from the RRD. Maybe you need to install rrdtool.

HTH
Wolfgang
TSA-120 + FSQ-85 + ONTC 10"F4 Newton (+ epsilon-160 on Japan trip) | Avalon Linear + M-zero | ASI 1600mm pro + 6200mm pro | KStars/INDI on Raspberry Pi 4/Intel NUC
3 months 1 week ago #85692

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

  • Posts: 279
  • Thank you received: 54
Thanks Wolfgang,

Interestingly enough, the sensors.rrd file gets populated with valid data, interspersed with lines of "... -nan -nan -nan... -nan", so the sensor data is being read from the Weather Radio station. On the other hand the weather.rrd file only gets filled with either -nan or 0.0000000000e+00. Furthermore, even after a fair bit of time, the web page does not show any sensor data. Even though I installed the web interface according to the instructions provided and every file should be in the appropriate place, I will dig a little further in case of a problem on my part.
3 months 1 week ago #85696

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

  • Posts: 279
  • Thank you received: 54
Endlich, hurra!

After adding a print (result) statement in weatherradio.py I traced down the problem between the Indi Weather Radio driver and weatherradio.py as I was only getting 0.0000 as data values from the driver, via the indiserver. Trying something simplistic such as purging the xml configuration file of the driver and re-creating it again by saving the configuration, in KStars/EKOS/Indi, solved the data value problem. Yeah!

Now, on with the crontab to automate it.

Thanks for all the clues.
3 months 1 week ago #85700

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

  • Posts: 279
  • Thank you received: 54
Hello Wolfgang,

Well, its a little bit more obscure than what I thought.

After a fresh reboot, if I stop and restart the indi-weatherradio.service, /usr/share/weatherradio/bin/wr_rrd_update.py --verbose connects to the Weather Radio device and gives me only 0.000 weather values. If I start and then stop KStars/EKOS/indi with the Weather Radio driver I get expected weather values once I run /usr/share/weatherradio/bin/wr_rrd_update.py --verbose again. Makes me wonder if wr_rrd_update.py or what is in between wr_rd_update.py and the Weather Radio driver is missing some sensors or parameters configuration or initialisation, unless KStars and friends are run prior.

Currently running KStars 3.6.0 stable with indilib 1.9.7

Thanks
3 months 1 week ago #85735

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

  • Posts: 1014
  • Thank you received: 302
I'm not so sure where this problem is coming from, but be careful connecting with EKOS, since it might shutdown the INDI driver. Better connect first with EKOS, configure the sensors, SAVE the profile (don't forget that!) and then leave the INDI server. If you connect now with wr_rrd_update.py, it should work.
TSA-120 + FSQ-85 + ONTC 10"F4 Newton (+ epsilon-160 on Japan trip) | Avalon Linear + M-zero | ASI 1600mm pro + 6200mm pro | KStars/INDI on Raspberry Pi 4/Intel NUC
3 months 1 week ago #85745

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

  • Posts: 279
  • Thank you received: 54
Hi Wolfgang,

When I start indi from EKOS and the indiserver and indi Weather Radio are already running, indi asks me if I want to restart indiserver, to which I answer a resounding NO! So it keeps the indiserver and driver running from the indi-weatherradio.service.

Does wr_rrd_update.py uses the Weather Radio profile? I had thought yes at first but I am not so sure anymore even though it would make sense if it did since it contains the sensors info. If it does, where does wr_rrd_update.py and friends expect the profile to be saved. Mine is in /home/gilles/.indi/'Weather Radio_config.xml' and it may not be in the appropriate place.

Thanks again.
3 months 1 week ago #85746

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

  • Posts: 1014
  • Thank you received: 302
It's not wr_rrd_update.py, it's the INDI server that runs the weatherradio driver which loads the configuration file. And the INDI server uses the user's home directory that started the INDI server. So if the user "gilles" starts the INDI server, it will utilize the config file you mentioned above.
TSA-120 + FSQ-85 + ONTC 10"F4 Newton (+ epsilon-160 on Japan trip) | Avalon Linear + M-zero | ASI 1600mm pro + 6200mm pro | KStars/INDI on Raspberry Pi 4/Intel NUC
3 months 1 week ago #85795

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

Time to create page: 0.398 seconds