matthewwall / weewx-sdr

weewx driver for software-defined radio
GNU General Public License v3.0
114 stars 74 forks source link

new driver based on weewx-sdr for adafruit indoor sensor on usb. uses rtl-sdr rtl_433 for external #170

Open garberw opened 1 year ago

garberw commented 1 year ago

here is what I found about adding a new sensor similar to what I did: https://infiniteknowledge.co.uk/tag/weewx/ https://www.oneeyedman.net/posts/2020052301-weatherstation.html https://www.williamreading.com/2021/07/25/weather-station.html the external sensors are from an Acurite Atlas sending radio to rtl-sdr read by rtl_433 as device 40 and intercepted by weewx-sdr. I had a WH32B sensor for indoors which broadcast to 915Mhz and rtl_433 was set up to frequency hop between the 433 Mhz Atlas and the 915Mhz WH32B. Instead I replaced the WH32B with an arduino with a BME680 sensor which outputs to Serial USB (ttyACM0). Also the rtl_433 driver for the rtl-sdr radio receiver dongle outputs to Serial USB. So the weewx-sdr driver has the AsyncInput class which reads these Serial USB inputs. The original version reads stdin and stdout from rtl_433. My version adds a third AsyncInput instance/thread which reads the arduino. The stdout and the arduino threads share the same queue (asynchronous?) where they put the lines read from both devices. A few questions:

(1) I am getting SMALL gaps in some of the data (e.g. outTemp but maybe not other variables) which must be from archive intervals where (outTemp) had nothing but None data points. The arduino has an RTC which is not set perfectly. Could this be the problem? Not sure how to set the RTC clock better it's a DS3231. Other suggestions are bad usb cables or bad radio interference. Checking the usb output directly shows a relatively smooth signal from Atlas every 30 seconds and from Arduino every 15 seconds. Or is one choking out the other. They should be independent but the usb cables go to a hub which goes to the weewx server. They have to share that usb cable.

(2) should I rewrite this driver as a separate service as the manual suggests?

(3) I will have to check out any LICENSE issues.

attached driver please look :-) weewx_atlas_adafruit.tar.gz

also the server is a raspi zero 2 W and it has three weather stations managed by three instances of weewx. I thought maybe it was tied up doing reports.

it is not due to line_gap_fraction=0.3 that's big enough. if this is not the place for this post please let me know :-)