matthewwall / weewx-sdr

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

Parser for Kedsum temperature humidity sensor #157

Open Sar6e opened 2 years ago

Sar6e commented 2 years ago

The USB console for my WH1080 station failed some time ago. I was really pleased to be able to continue to use the sensor array for the station using weewx-sdr. Thanks so much for your work! The instructions were clear and simple to follow. Great work!

Now that I have no console I've lost inside temperature and humidity. I have a temperature and humidity sensor that came with a set of kitchen scales of all things. I can see this output when running manually.

out: ['{"time" : "2022-06-17 00:23:59", "model" : "Kedsum-TH", "id" : 235, "channel" : 1, "battery_ok" : 0, "flags" : 8, "temperature_F" : 59.000, "humidity" : 74, "mic" : "CRC"}\n']

I'm not sure if creating a parser is within my capabilities or not but haven't been able to identify any pointers on how I might go about it.

andylittle commented 2 years ago

Try this. What does the 'flags' indicate?

Sar6e commented 2 years ago

I renamed the existing sdr.py file then downloaded the updated sdr.py file. When I try to run the driver manually, I get an error.

File "/usr/share/weewx/user/sdr.py", line 8 <!DOCTYPE html> ^ SyntaxError: invalid syntax

Should I have done something more than just update the sdr.py file?

andylittle commented 2 years ago

How did you run it? If you installed in /home/weewx cd /home/weewx sudo PYTHONPATH=bin python bin/user/sdr.py --cmd="rtl_433 -M utc -F json"

Sar6e commented 2 years ago

I originally installed using wee-extension. In /usr/share/weewx/user I now have sdr-dist.py which is a copy of the original sdr.py. I also have sdr-kedsum.py which is a download of your latest commit.

If I copy sdr-dist.py to sdr.py and execute sudo PYTHONPATH=/usr/share/weewx python /usr/share/weewx/user/sdr.py --cmd="rtl_433 -M utc -F json" I start to see data being captured and parsed.

If I copy sdr-kedsum.py to sdr.py and execute the same command I get the syntax error.

Sar6e commented 2 years ago

To answer your other question... I have no idea what the flag attribute is returning.

andylittle commented 2 years ago

https://github.com/andylittle/weewx-sdr-1/blob/16c92a043450db06f2e662146a08b76801522230/bin/user/sdr.py maybe that link was wrong.

Sar6e commented 2 years ago

Hi,

I just grabbed downloaded from the new link provided. Unfortunately, when I use that version of sdr.py, I'm still getting the syntax error.

Sar6e commented 2 years ago

I grabbed the additions you made to sdr.py and added them to my original copy of sdr.py. The driver is running manually and parsing the Kedsum data successfully. After updating weewx.conf, the values are writing to the DB successfully.

Happy to continue to test additional updates if that helps.