I'll check out that board from adafruit. Looks pretty simple and straight forward.
Another question on your setup - how did you integrate with weewx? I can't find any documentation on "3rd party" stations reporting to it.
Intergration with weewx is the tricky part. You need to first collect the data from the sensors via code on the RPi and save it as a ascii file. I have my station do it every second. That file will look like this
2014-09-27 12:00:10,34.3,10.0,340,10.2,900.3, etc....
2014-09-27 12:00:11,34.1,10.2,341,12.4,900.8,etc...
...
Python2 is the language of choice but you can pick whatever works for you.
Second you will need to create a weewx driver that takes the ascii file and transfers it to weewx. At this point weewx takes over and creates the webpage and transfers your data to wunderground and CWOP. I have included my driver, feel free to use it but it is very simple at this point.
#
# $Revision: 1 $
# $Author: Nickolas McColl $
# $Date: 2014-08-16 $
#
"""Raspberry Pi driver for the weewx weather system"""
from __future__ import with_statement
# import math
import time
#import weedb
#import weeutil.weeutil
import weewx.abstractstation
import weewx.wxformulas
def loader(config_dict, engine):
import weewx.units
altitude_m = weewx.units.getAltitudeM(config_dict)
station = Raspberry_pi(altitude = altitude_m, **config_dict['Raspberry_pi'])
return station
class Raspberry_pi(weewx.abstractstation.AbstractStation):
"""Station using Raspberry Pi"""
def __init__(self, **stn_dict):
self.altitude = stn_dict['altitude']
self.loop_interval = float(stn_dict.get('loop_interval'))
def genLoopPackets(self):
import weewx.units
while True:
start_time = time.time()
# Create Loop packet
f = open('/home/weewx/bin/wxdata.csv')
input = f.readline()
f.close()
data = input.split(',')
if len(data) == 13: # data line is complete, process
for i in range(1, (len(data))):
try:
data[i] = float(data[i])
except ValueError:
data[i] = None
raw_time =time.strptime(data[0], "%Y-%m-%d %H:%M:%S")
_packet = {'dateTime': int(time.mktime(raw_time)),
'usUnits' : weewx.METRIC,
'pressure' : data[1],
'windSpeed' : data[12], #use 3 second average
'windGust' : data[12], #use 3 second average
'windDir' : data[3],
'windGustDir' : data[3],
'outTemp' : data[4],
'outHumidity' : data[5],
'rain': data[6],
'radiation' :data[9],
'inTemp' : data[11]}
_packet['dewpoint'] = weewx.wxformulas.dewpointC(_packet['outTemp'], _packet['outHumidity'])
_packet['barometer'] = weewx.wxformulas.sealevel_pressure_Metric(_packet['pressure'], self.altitude, _packet['outTemp'])
_packet['altimeter'] = weewx.wxformulas.altimeter_pressure_Metric(_packet['pressure'], self.altitude)
_packet['heatdeg'] = weewx.wxformulas.heating_degrees(_packet['outTemp'], 18.333)
_packet['cooldeg'] = weewx.wxformulas.cooling_degrees(_packet['outTemp'], 18.333)
_packet['heatindex'] = weewx.wxformulas.heatindexC(_packet['outTemp'], _packet['outHumidity'])
yield _packet
sleep_time = (start_time - time.time()) + self.loop_interval
if sleep_time > 0:
time.sleep(sleep_time)
def hardware_name(self):
return "raspberry_pi"
Enjoy,