WeeWX service that decodes NMEA 0183 "XDR" sentences and adds values to the WeeWX data stream.
Tested on a Dracal USB-BAR20-N. This is an interesting little instrument because it can add accurate barometric pressure to a data stream, making it perfect for those who are collecting data using a software-defined radio (SDR).
-
Download and install the extension
cd /home/weewx wget https://github.com/tkeffer/weewx-nmea-xdr/archive/nmea-xdr-0.1.0.tar.gz wee_extension --install=nmea-xdr-0.1.0.tar.gz
-
Edit the new stanza
[XDR]
to reflect your situation. Here's an example:[XDR] port = /dev/ttyUSB0 # Map from weewx names to sensor names. Only these types will be processed. # Typical sensor map: [[sensor_map]] pressure = P # Raw, station pressure
This example most relies on the defaults, although it adds an explicity device port where the NMEA device can be found (
/dev/ttyUSB0
).It maps only one observation type,
pressure
, to the incoming XDR data,P
. -
Restart WeeWX. For example:
sudo systemctl stop weewx sudo systemctl start weewx
-
With every LOOP packet, the queue of NMEA sentences will be drained. All data listed in the sensor map will be parsed and added to the LOOP packet.
-
Include a stanza in your weewx.conf configuration file:
[XDR] port = /dev/ttyACM0 # Default is '/dev/ttyACM0' baudrate = 9600 # Default is '9600' timeout = 5 # How long to wait for an XDR packet. Default is 5 max_packets = 5 # Max number of packets to process during a LOOP event. Default is 5 # Map from weewx names to sensor names. Only these types will be processed. # Typical sensor map: [[sensor_map]] pressure = P # Raw, station pressure outTemp = C # Temperature
-
Add the XDR service to the list of data_services to be run:
[Engine] [[Services]] ... data_services = nmea-xdr.py
-
Put this file (nmea-xdr.py) in your WeeWX user subdirectory. For example, if you installed using setup.py,
cp nmea-xdr.py /home/weewx/bin/user
-
Restart WeeWX. For example:
sudo systemctl stop weewx sudo systemctl start weewx
-
With every LOOP packet, the queue of NMEA sentences will be drained. All data listed in the sensor map will be parsed and added to the LOOP packet.