Bi-monthly release with minor bug fixes and improvements
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.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
//#define USE_DHT_SENSOR
// DHT sensor family
#define DHTPIN 3 // Digital pin connected to the DHT sensor
//#define DHTTYPE DHT11 // DHT 11 - Uncomment whatever type you're using!
#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321 - Uncomment whatever type you're using!
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
#include "DHT.h"
DHT dht(DHTPIN, DHTTYPE);
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.