Bi-monthly release with minor bug fixes and improvements
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.
[Unit]
Description=INDI server for weather radio
[Service]
Type=simple
User=root
ExecStart=/usr/bin/indiserver -v indi_weatherradio
[Install]
WantedBy=multi-user.target
sudo ls -l /root/.indi
total 16
-rw-r--r-- 1 root root 7897 Nov 21 13:36 'Weather Radio_config.xml'
-rw-r--r-- 1 root root 4534 Nov 18 20:08 'Weather Radio_config.xml.default'
sudo systemctl status indi-weatherradio
● indi-weatherradio.service - INDI server for weather radio
Loaded: loaded (/etc/systemd/system/indi-weatherradio.service; disabled; vend
Active: active (running) since Wed 2020-11-18 20:06:52 GMT; 2 days ago
Main PID: 1199 (indiserver)
Tasks: 2 (limit: 2063)
CGroup: /system.slice/indi-weatherradio.service
├─1199 /usr/bin/indiserver -v indi_weatherradio
└─1200 indi_weatherradio
Nov 21 13:36:08 redpi indiserver[1199]: 2020-11-21T13:36:08: Client 5: shut dow
Nov 21 13:36:37 redpi indiserver[1199]: 2020-11-21T13:36:37: Client 5: new arri
./bin/wr_rrd_update.py -v
Updating data from "Weather Radio"@localhost:7624
Connection established to "Weather Radio"@localhost:7624
Weather parameters read from "Weather Radio"@localhost:7624
./bin/wr_rrd_update.py -v
Updating data from "Weather Radio"@localhost:7624
Establishing connection FAILED to "Weather Radio"@localhost:7624
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.
#!/usr/bin/python
# -*- coding: latin-1 -*-
#-----------------------------------------------------------------------
# Configuration for weather radio.
#
# Copyright (C) 2020 Wolfgang Reissenberger <sterne-jaeger@t-online.de>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# Based upon ideas from indiduinoMETEO (http://indiduino.wordpress.com).
#-----------------------------------------------------------------------
# INDI server delivering weather data
INDISERVER="localhost"
INDIPORT="7624"
# configure INDI devices - separate multiple devices with ","
# INDI device name
INDIDEVICE="Weather Radio"
# INDI device connection mode: "Ethernet" or "Serial"
INDIDEVICEMODE="Serial"
# INDI serial device port (only necessary for Serial mode)
INDIDEVICEPORT="/dev/ttyUSB0"
# INDI IP address (only necessary for Ethernet mode)
INDI_IP_ADDRESS="172.28.4.40"
# INDI IP port (only necessary for Ethernet mode)
INDI_IP_PORT="80"
# Geo Coordinates - Latitude (as decimal)
GEO_COORD_LAT="43.916876"
# Geo Coordinates - Longitude (as decimal)
GEO_COORD_LONG="5.716624"
# Geo Coordinates - Elevation (as decimal)
GEO_COORD_ELEV="650.0"
# 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"
######### INDI Weather vector and element names
WEATHER="WEATHER_PARAMETERS"
WEATHER_TEMPERATURE="WEATHER_TEMPERATURE"
WEATHER_PRESSURE="WEATHER_PRESSURE"
WEATHER_HUMIDITY="WEATHER_HUMIDITY"
WEATHER_CLOUD_COVER="WEATHER_CLOUD_COVER"
WEATHER_SQM="WEATHER_SQM"
WEATHER_DEWPOINT="WEATHER_DEWPOINT"
WEATHER_SKY_TEMPERATURE="WEATHER_SKY_TEMPERATURE"
WEATHER_WIND_GUST="WEATHER_WIND_GUST"
WEATHER_WIND_SPEED="WEATHER_WIND_SPEED"
WEATHER_WIND_DIRECTION="WEATHER_WIND_DIRECTION"
Please Log in or Create an account to join the conversation.
pdb wr_rrd_update.py
Please Log in or Create an account to join the conversation.
if mode == "Serial":
# ensure serial mode
indi.set_and_send_switchvector_by_elementlabel(dev,"CONNECTION_MODE","Serial")
# set the configured port
indi.set_and_send_text(dev,"DEVICE_PORT","PORT",devport)
else:
indi.set_and_send_switchvector_by_elementlabel(dev,"CONNECTION_MODE","Ethernet")
indi.set_and_send_text(dev,"DEVICE_ADDRESS","ADDRESS",ipaddress)
indi.set_and_send_text(dev,"DEVICE_ADDRESS","PORT",ipport)
# connect driver
connection = indi.set_and_send_switchvector_by_elementlabel(dev,"CONNECTION","Connect")
# wait for the connection
time.sleep(7)
# ensure that all information is up to date
indi.process_events()
# check if the connection has been established
connection = indi.get_vector(dev, "CONNECTION")
# set location if connection was successful
if connection._light.is_ok():
indi.set_and_send_float(dev,"GEOGRAPHIC_COORD","LAT",float(lat))
indi.set_and_send_float(dev,"GEOGRAPHIC_COORD","LONG",float(long))
indi.set_and_send_float(dev,"GEOGRAPHIC_COORD","ELEV",float(elev))
# update the result states
result = result and connection._light.is_ok()
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.