Oregon Scientific WMR89 driver for weewx 4.0 and Python3

85 views
Skip to first unread message

andr3id

unread,
May 3, 2020, 12:46:35 PM5/3/20
to weewx-development
I've been using the WMR89 driver from fcauwe https://github.com/fcauwe/weewx for a while, actually totally forgetting that I've had it as an add on and that it is not found in the official repository.

I've got excited when the weewx 4.0 release was available, specially with the update to Python3 which I prefer over Python2, and updated my system without thinking.

Ofcourse the driver for WMR89 stopped working since it's written in Python2 and I had to change to the Python2 version of weewx to get my system up again. I run weewx on a raspberry pi 4 with raspbian.

Is anyone currently developing a WMR89 driver for weewx 4.0 and Python3? I've been planning to do that myself, but if it's already onging, I could just probably contribute with some developing and testing.




Tom Keffer

unread,
May 3, 2020, 7:55:36 PM5/3/20
to andr3id, weewx-development
I've made a quick, first pass at porting the WMR89 driver to Python 3 and WeeWX V4.

If you have the patience, we can probably get it ported. Run it from the command line first --- don't try to run WeeWX with it

If you used setup.py install:

  PYTHONPATH=/home/weewx/bin python3 wmr89.py

If you used package install:

  PYTHONPATH=/usr/share/weewx python3 wmr89.py

Let it run for a minute or two (if it runs at all!), then post the log.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/070d8fed-462d-4b3c-b013-bb941315e59f%40googlegroups.com.
wmr89.py

andr3id

unread,
May 4, 2020, 2:21:28 AM5/4/20
to weewx-development
Thanks a lot!

I will test it and see what's left to figure out and update.


Den måndag 4 maj 2020 kl. 01:55:36 UTC+2 skrev Tom Keffer:
I've made a quick, first pass at porting the WMR89 driver to Python 3 and WeeWX V4.

If you have the patience, we can probably get it ported. Run it from the command line first --- don't try to run WeeWX with it

If you used setup.py install:

  PYTHONPATH=/home/weewx/bin python3 wmr89.py

If you used package install:

  PYTHONPATH=/usr/share/weewx python3 wmr89.py

Let it run for a minute or two (if it runs at all!), then post the log.

-tk

On Sun, May 3, 2020 at 9:46 AM andr3id <andrei...@gmail.com> wrote:
I've been using the WMR89 driver from fcauwe https://github.com/fcauwe/weewx for a while, actually totally forgetting that I've had it as an add on and that it is not found in the official repository.

I've got excited when the weewx 4.0 release was available, specially with the update to Python3 which I prefer over Python2, and updated my system without thinking.

Ofcourse the driver for WMR89 stopped working since it's written in Python2 and I had to change to the Python2 version of weewx to get my system up again. I run weewx on a raspberry pi 4 with raspbian.

Is anyone currently developing a WMR89 driver for weewx 4.0 and Python3? I've been planning to do that myself, but if it's already onging, I could just probably contribute with some developing and testing.




--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-de...@googlegroups.com.

andr3id

unread,
May 4, 2020, 10:46:15 AM5/4/20
to weewx-development
Hi!

The driver seems to work, but the function byte2int has to be removed. I don't think it's needed since binascii.hexlify and binascii.unxelify sorts the types out correctly.
I have attached an update without the byte2int function and here is some output from my tests with Python 2.7 and Python 3.7:

$ PYTHONPATH=/usr/share/weewx python2 wmr89.py --port=/dev/ttyUSB1
{'dateTime': 1588602699, 'inHumidity': 35.0, 'inDewpoint': 6, 'usUnits': 16, 'inTemp': 21.900000000000002}
{'dateTime': 1588602700, 'inHumidity': 35.0, 'inDewpoint': 6, 'usUnits': 16, 'inTemp': 21.900000000000002}
{'windchill': None, 'dateTime': 1588602725, 'windDir': 315.0, 'windSpeed': 17.28, 'windGust': 18.36, 'usUnits': 16}
{'outHumidity': 45.0, 'outTemp': 12.700000000000001, 'usUnits': 16, 'dewpoint': 1, 'dateTime': 1588602725}
{'windchill': None, 'dateTime': 1588602726, 'windDir': 315.0, 'windSpeed': 17.28, 'windGust': 18.36, 'usUnits': 16}
{'outHumidity': 45.0, 'outTemp': 12.700000000000001, 'usUnits': 16, 'dewpoint': 1, 'dateTime': 1588602726}
{'dewpoint1': 4, 'extraTemp1': 19.8, 'dateTime': 1588602754, 'usUnits': 16, 'extraHumid1': 35.0}
{'dewpoint1': 4, 'extraTemp1': 19.8, 'dateTime': 1588602755, 'usUnits': 16, 'extraHumid1': 35.0}
{'dateTime': 1588602760, 'inHumidity': 35.0, 'inDewpoint': 6, 'usUnits': 16, 'inTemp': 22.0}
{'dateTime': 1588602761, 'inHumidity': 35.0, 'inDewpoint': 6, 'usUnits': 16, 'inTemp': 22.0}
{'windchill': None, 'dateTime': 1588602775, 'windDir': 292.5, 'windSpeed': 11.879999999999999, 'windGust': 17.28, 'usUnits': 16}
{'windchill': None, 'dateTime': 1588602776, 'windDir': 292.5, 'windSpeed': 11.879999999999999, 'windGust': 17.28, 'usUnits': 16}

 $ PYTHONPATH=/usr/share/weewx python3 wmr89.py --port=/dev/ttyUSB1
{'inTemp': 22.0, 'inHumidity': 35.0, 'inDewpoint': 6, 'dateTime': 1588602820, 'usUnits': 16}
{'inTemp': 22.0, 'inHumidity': 35.0, 'inDewpoint': 6, 'dateTime': 1588602821, 'usUnits': 16}
{'windSpeed': 14.04, 'windDir': 292.5, 'windGust': 11.879999999999999, 'windchill': None, 'dateTime': 1588602830, 'usUnits': 16}
{'windSpeed': 14.04, 'windDir': 292.5, 'windGust': 11.879999999999999, 'windchill': None, 'dateTime': 1588602831, 'usUnits': 16}
{'outTemp': 13.0, 'outHumidity': 45.0, 'dewpoint': 2, 'dateTime': 1588602831, 'usUnits': 16}
{'windSpeed': 14.04, 'windDir': 292.5, 'windGust': 11.879999999999999, 'windchill': None, 'dateTime': 1588602832, 'usUnits': 16}
{'outTemp': 13.0, 'outHumidity': 45.0, 'dewpoint': 2, 'dateTime': 1588602832, 'usUnits': 16}
{'extraTemp1': 19.8, 'extraHumid1': 35.0, 'dewpoint1': 4, 'dateTime': 1588602871, 'usUnits': 16}
{'extraTemp1': 19.8, 'extraHumid1': 35.0, 'dewpoint1': 4, 'dateTime': 1588602872, 'usUnits': 16}
{'inTemp': 22.0, 'inHumidity': 35.0, 'inDewpoint': 6, 'dateTime': 1588602879, 'usUnits': 16}
{'inTemp': 22.0, 'inHumidity': 35.0, 'inDewpoint': 6, 'dateTime': 1588602880, 'usUnits': 16}
{'windSpeed': 18.0, 'windDir': 292.5, 'windGust': 17.64, 'windchill': None, 'dateTime': 1588602886, 'usUnits': 16}
{'windSpeed': 18.0, 'windDir': 292.5, 'windGust': 17.64, 'windchill': None, 'dateTime': 1588602887, 'usUnits': 16}

I will continue to analyse and verify the received data compared to the data showed on the weather station display, but this is more related to understanding the data from WMR89 and not making the driver work in WeeWX.

Thanks for your time and support!

wmr89.py

Tom Keffer

unread,
May 4, 2020, 11:42:15 AM5/4/20
to andr3id, weewx-development
Wow. First try and it works? Impossible.

Did you try it under both Python 2 and 3?

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

andr3id

unread,
May 4, 2020, 12:02:24 PM5/4/20
to weewx-development
Yes, see the output in my last post. I've run Python 2.7.16 and Python 3.7.3. I don't have older versions of Python 2 available and I don't think older versions will work, but maybe it's out of scope of WeeWX 4.0.

But as stated, byte2int has to be removed, otherwise it crashes.

Den måndag 4 maj 2020 kl. 17:42:15 UTC+2 skrev Tom Keffer:
Wow. First try and it works? Impossible.

Did you try it under both Python 2 and 3?

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-de...@googlegroups.com.

Tom Keffer

unread,
May 4, 2020, 12:27:11 PM5/4/20
to andr3id, weewx-development
OK. The gmail virus scanners are temporarily on strike, so I wasn't able to download your copy of wmr89.py, but I'm sure they'll be back at it soon.

How about the log? Valuable information should have been logged in there. I'd like to see it from your test runs.

-tk

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/ae2cdf20-b62d-4d44-91f9-2ac87716766f%40googlegroups.com.

andr3id

unread,
May 4, 2020, 12:49:17 PM5/4/20
to weewx-development
I've had limited time for testing this, but I will make the working updated driver available online somehow. I'll run some more tests and gather the logs and post them here or make them available on my site.


Den måndag 4 maj 2020 kl. 18:27:11 UTC+2 skrev Tom Keffer:
OK. The gmail virus scanners are temporarily on strike, so I wasn't able to download your copy of wmr89.py, but I'm sure they'll be back at it soon.

How about the log? Valuable information should have been logged in there. I'd like to see it from your test runs.

-tk

Tom Keffer

unread,
May 4, 2020, 12:57:43 PM5/4/20
to andr3id, weewx-development
Never mind that. I found a workaround. Driver is up at


-tk

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/67eb1e84-af3a-41c7-8abf-afcf43e860e4%40googlegroups.com.

andr3id

unread,
May 4, 2020, 1:18:40 PM5/4/20
to weewx-development
Great, thanks! I'll use that in my WeeWX system and monitor how it works.

I think by the way that the fork of weewx with the WMR89 driver is done by fcauwe (Francois?) and not Will Page.


Den måndag 4 maj 2020 kl. 18:57:43 UTC+2 skrev Tom Keffer:
Never mind that. I found a workaround. Driver is up at


-tk

Tom Keffer

unread,
May 4, 2020, 1:24:44 PM5/4/20
to andr3id, weewx-development
You're probably right. Nevertheless, Will wrote the driver.

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/f81137eb-3f34-41c4-a78e-593f637ad9a8%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages