Bi-monthly release with minor bug fixes and improvements
git clone --single-branch --branch weatherradio-v_1.9 https://github.com/sterne-jaeger/indi-3rdparty.git
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
indiserver -v indi_weatherradio
[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
sudo systemctl enable indi-weatherradio.service
sudo systemctl start indi-weatherradio.service
Please Log in or Create an account to join the conversation.
*/5 * * * * /home/pi/bin/picAndList.sh
0 */1 * * * /home/pi/bin/mkVideo.sh
#!/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`
#!/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
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
#!/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
#!/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
)
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
#!/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
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.