×

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

Bi-monthly release with minor bug fixes and improvements

Weather radio don't want connect

  • Posts: 89
  • Thank you received: 16
Hi Gunter

The file you need to change locally is /usr/share/weatherradio/bin/weatherradio.py
This must be replaced with add-on/weatherradio/bin/weatherradio.py

To clone a paticular branch you could try
git clone --single-branch --branch weatherradio-v_1.9 https://github.com/sterne-jaeger/indi-3rdparty.git

Or if you are browsing github you can click on the little box near the top left that says master and select the version
you want from the drop down menu, then go to
indi-duino/add-on/weatherradio/bin/weatherradio.py
and download the file from there.

The url is

github.com/sterne-jaeger/indi-3rdparty/t...-on/weatherradio/bin

My weather box has sprung a leak and water has got it, again!
Last edit: 3 years 4 months ago by Adrian. Reason: url updated
3 years 4 months ago #63685

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

  • Posts: 108
  • Thank you received: 4
Thanks again Wolfgang,

the git clone download worked but the result is the same. Still no connection to indi driver failed.
Here the last log-file incl. start of driver log. You can see the data are coming in from the sensors.
I feel sorry for you about the weather box. I use a waste water PVC pipe (see allsky cam) . This is tide.

tail -f ~/.local/share/kstars/logs/2020-12-01/log_21-46-25.txt
[2020-12-01T21:53:56.650 CET INFO ][ org.kde.kstars.indi] - Weather Radio : "[WARNING] Warning: Parameter Clouds (%) value (100) is in the warning zone! "
[2020-12-01T21:53:56.652 CET INFO ][ org.kde.kstars.indi] - Weather Radio : "[INFO] Device configuration applied. "
[2020-12-01T21:53:56.684 CET DEBG ][ org.kde.kstars.indi] - INDI Server: "2020-12-01T20:53:56: Driver indi_weatherradio: snooping on GPSD.GEOGRAPHIC_COORD"
[2020-12-01T21:53:56.684 CET DEBG ][ org.kde.kstars.indi] - INDI Server: ""
[2020-12-01T21:53:56.707 CET INFO ][ org.kde.kstars.ekos.scheduler] - "Caution: weather conditions are in the DANGER zone!"
[2020-12-01T21:53:56.904 CET INFO ][org.kde.kstars.ekos.observatory] - "Weather Alert"
[2020-12-01T21:53:56.988 CET INFO ][ org.kde.kstars.indi] - Weather Radio : "[WARNING] Caution: Parameter SQM value (5.9493) is in the danger zone! "
[2020-12-01T21:53:56.990 CET INFO ][ org.kde.kstars.indi] - Weather Radio : "[WARNING] Warning: Parameter Clouds (%) value (100) is in the warning zone! "
[2020-12-01T21:53:57.329 CET INFO ][ org.kde.kstars.indi] - Weather Radio : "[WARNING] Caution: Parameter SQM value (5.9493) is in the danger zone! "
[2020-12-01T21:53:57.331 CET INFO ][ org.kde.kstars.indi] - Weather Radio : "[WARNING] Warning: Parameter Clouds (%) value (100) is in the warning zone! "
[2020-12-01T21:54:57.425 CET INFO ][ org.kde.kstars.indi] - Weather Radio : "[WARNING] Caution: Parameter SQM value (5.93757) is in the danger zone! "
[2020-12-01T21:54:57.428 CET INFO ][ org.kde.kstars.indi] - Weather Radio : "[WARNING] Warning: Parameter Clouds (%) value (100) is in the warning zone! "




[2020-12-01T21:55:07.234 CET DEBG ][ org.kde.kstars.indi] - INDI Server: "2020-12-01T20:55:07: Client 30: new arrival from 192.168.178.20:32994 - welcome!"
[2020-12-01T21:55:07.234 CET DEBG ][ org.kde.kstars.indi] - INDI Server: ""
[2020-12-01T21:55:07.246 CET DEBG ][ org.kde.kstars.indi] - INDI Server: "2020-12-01T20:55:07: Client 30: read EOF"
[2020-12-01T21:55:07.247 CET DEBG ][ org.kde.kstars.indi] - INDI Server: "2020-12-01T20:55:07: Client 30: shut down complete - bye!"
[2020-12-01T21:55:07.248 CET DEBG ][ org.kde.kstars.indi] - INDI Server: ""

Have a good evening.

Gunter
3 years 4 months ago #63693

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

  • Posts: 1185
  • Thank you received: 370
Hi Gunter,
it seems like indiserver does not get a CONNECT, but I do not have an idea why this happens.

In the next days I will update weatherradio.py making it more verbose.

Wolfgang
3 years 4 months ago #63696

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

  • Posts: 108
  • Thank you received: 4
Thank you,
3 years 4 months ago #63841

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

  • Posts: 108
  • Thank you received: 4
Hi Wolfgang,

btw. Is it reslly necessary to have kstars running on the RPi (stellarmate) or how to start only ekos respectively a profile/indiserver during startup?

Schönen Redtadvent

Gunter
3 years 4 months ago #64012

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

  • Posts: 1185
  • Thank you received: 370
Hi Gunter,
no, you do not need KStars to start the INDI server. You can do it simply from the command line:
indiserver -v indi_weatherradio
If you want to start it automatically when your RPi starts, create a new service definition /etc/systemd/system/indi-weatherradio.service with the following content:
[Unit]
Description=INDI server for weather radio
Wants=network-online.target
After=network-online.target
 
[Service]
Type=simple
User=root
ExecStart=/usr/bin/indiserver -v indi_weatherradio
 
 
[Install]
WantedBy=multi-user.target

Save the file, enable and start the service:
sudo systemctl enable indi-weatherradio.service
sudo systemctl start indi-weatherradio.service

Have fun!
Wolfgang
3 years 4 months ago #64017

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

  • Posts: 89
  • Thank you received: 16
Wolfgang, can I ask you to share your scripts for the webcam?

I see this with my set up at the moment.


I see you suggested a pi zero in the documentation.
My setup is a pi3 with the HQ camera and a 2.1 mm wide angle lens (came with a ZWO camera).
If I get things working on the pi3 I will move the images over to my main pi which is serving the data from the weatherstation arduino.


Maybe I have not been running it for long enough but I have something wrong!
None of the images (lightbox? js) are seen and when
you click on them they are white and not the same as the images in the html/media/2020-12-06/ directory

I am using cron to execute two shell scripts
*/5 * * * *    /home/pi/bin/picAndList.sh 
0 */1 * * *    /home/pi/bin/mkVideo.sh 

picAndList.sh is executed every five minutes;
#!/bin/bash
# Script for webcam function of weatherradio
# First take and image with the camera
# Then update the json file for the webapp
#
# This is called by cron
# */5 * * * *	/home/pi/bin/picAndList.sh
#
 
# Take an image
/usr/share/weatherradio/bin/camera.py
 
# Create the imagelist in html/data/images.json
/usr/share/weatherradio/bin/wr_list_media.py -d /usr/share/weatherradio/html/media/`date +%Y-%m-%d`

mkVideo.sh is executed every hour and is;
#!/bin/bash
# Script for webcam function of weatherradio
# Calls python binary to make the video
# Then creates link to most recent timelapse for webpage
#
# This is called by cron
# 0 */1 * * *	/home/pi/bin/mkVideo.sh
#
 
WEATHERPATH=/usr/share/weatherradio
DATE=$(date +%Y-%m-%d)
 
# Create the timelapse
$WEATHERPATH/bin/wr_video_create.py -d $WEATHERPATH/html/media/$DATE
 
# Find most recent mp4 file
RECENT=`ls -Art $WEATHERPATH/html/media/timelapse_$DATE*.mp4 | tail -n 1`
 
TARGET=$WEATHERPATH/html/media/timelapse_current.mp4
 
if [ -f "$TARGET" ]; then
    rm -f $TARGET
fi
 
ln -s $RECENT $WEATHERPATH/html/media/timelapse_current.mp4

Thanks

Adrian
3 years 4 months ago #64020
Attachments:

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

  • Posts: 108
  • Thank you received: 4
Thank you, I try that because I run clients on Kobuntu or MacOS. Probably I can save some ram without Kstars on the RPi.

Have a good one

Gunter
3 years 4 months ago #64041

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

  • Posts: 1185
  • Thank you received: 370
Hi Adrian,
my setup consists of a Pi zero named weathercam that hosts the camera and a Pi 3b named lg-10 that renders the videos and hosts the web server. My scripts work as follows:
  1. mediasync.sh running every 5 mins on weathercam synching the images to lg-10 and to an external drive, that both have mounted
  2. updatemedia.sh running every 5 mins on lg-10 updating the links and creating an updated time lapse video

mediasync.sh
#!/bin/bash
 
DIR=/var/www/cam/media/`date +"%F"`
 
# sync images to carousel
if [ -d $DIR ] ; then
    rsync -rtml $DIR/*00[0-9][0-9].jpg wolfgang@lg-10:/usr/local/share/weatherradio/html/media
fi
 
# sync all images to the central location where timelapses will be created
rsync -rtml --exclude '*~' --exclude '*archive*' /var/www/cam/media/ /ext/public/weather

updatemedia.sh
#!/bin/bash
 
mediadir="/usr/local/share/weatherradio/html/media"
img_limit=6
 
# current day
YESTERDAY=$(date --date="yesterday" +"%F")
DATE=`date +"%F"`
# DATE=$YESTERDAY
 
BIN="/usr/local/share/weatherradio/bin"
 
# clear old images
i=0; for f in `ls -Rt $mediadir/*.jpg`; do
    if [ $i -gt $img_limit ]; then
        rm -v $f
    fi;
    i=$(($i + 1))
done
 
# update JSON file for carousel
$BIN/wr_list_media.py
# remove latest time lapse
if [ `find /ext/public/weather -maxdepth 1 -name timelapse_${DATE}_[0-2]*.mp4 | wc -l` -gt 0 ]; then
 
    latest=`ls /ext/public/weather/timelapse_${DATE}_[0-2]*.mp4 | tail -1`
 
    if [ -f $latest ]; then
        rm -f $latest
    fi
fi
 
if [ -d /ext/public/weather/$DATE ]; then
    $BIN/wr_video_create.py -d /ext/public/weather/$DATE
else
    exit 0
fi
 
(cd /ext/public/weather
 #empty time lapse list
 rm -f timelapse_$DATE.txt
 # list all matching time lapse videos
# for f in timelapse_${DATE}_*.mp4;  do
 for f in `ls timelapse_*h.mp4 | tail -24`;  do
     if [ -f $f ]; then
         echo "file $f" >> timelapse_$DATE.txt
     fi
 done
 # remove old video
if [ -f timelapse_$DATE.mp4 ]; then
    rm -f timelapse_$DATE.mp4
fi
 
 # concatenate all time lapse videos of totay into one single video
ffmpeg -f concat -i timelapse_$DATE.txt -loglevel "level+error" -c copy timelapse_$DATE.mp4 
)
 
# update web page
 
(cd /usr/local/share/weatherradio/html/media
 cp -p /ext/public/weather/timelapse_$DATE.mp4 .
 
 if [ -f timelapse_current.mp4 ]; then
    rm -f timelapse_current.mp4
 fi
 
 ln -s ./timelapse_$DATE.mp4 timelapse_current.mp4
 )
The following user(s) said Thank You: Adrian
3 years 4 months ago #64070

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

  • Posts: 89
  • Thank you received: 16
Many thanks Wolfgang,



That works nicely.

Your camera looks like a version 2, is it NOIR?

Do you execute camera.py on your pi Zero every five minutes?

How do you handle the old image files? do you delete them after x days with a cron job?

Kind regards,

Adrian
3 years 4 months ago #64182
Attachments:

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

  • Posts: 1185
  • Thank you received: 370
Hi Adrian,
I started with a NOIR, but I switched to a Raspberry Pi 12 MP HQ camera. It allows longer exposure times and has a more sensitive chip, so that stars are visible on the time lapse videos.

On my PI zero there is a cron job that shoots one image per minute during daytime, during night I reduce it to every two minutes since a single exposure takes more than a minute (although the exposure time is 15s max).

Additionally, I have a cleanup job that runs once per day:
#!/bin/sh
 
# determine number of image directories
nr=`ls -dt -1 /var/www/cam/media/20* | wc -l`
 
# we keep 2 directories
nr=$(($nr-2))
 
if [ $nr -gt 0 ]; then
    for d in `ls -dt -1 /var/www/cam/media/20* | tail -$nr`; do
        rm -rvf $d
    done
fi

As shown above I sync my images to my NAS and keep them only temporarily on the Raspberry. This way it can run for weeks unattended.

HTH
Wolfgang
The following user(s) said Thank You: Adrian
3 years 4 months ago #64188

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

  • Posts: 16
  • Thank you received: 3

Replied by Mark on topic Weewx support

Hi Wolfgang,

Thanks for your great work with Weather Radio. I submitted a pull request here to add some basic support for Weewx: github.com/indilib/indi-3rdparty/pull/254

The reason I added this is so that I can use Weather Radio as a more generic weather station input to Weewx which can then augment the data, produce dashboards, and also push it upstream other places like Weather Underground. I added some simple support for allowing the indi driver to get its information from weewx - this isn't an ideal implementation, in the long run a indi_weewx driver would be better to take full advantage of the other information weewx might provide as well as the data sourced from WR, but for now it works.

-Mark
3 years 4 months ago #64275

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

Time to create page: 0.600 seconds