I updated this driver to work with Python3. Used the program "2to3-2.7" on 
Raspbian Buster to do most of the work,
then had to use str.encode() to fix a string. Not tested much, but it 
appears to work.

Here are my diffs, with white space changes ignored:

pi@weather: diff -w wmII.py.bak wmII.py
2a3,5
> # Modified for Python3:
> # Copyright 2020 Christopher John Shaker <[email protected]>
> # Written by:
29,30c32,33
< DRIVER_VERSION = "0.3"
<
---
> DRIVER_VERSION = "0.35"
> DEFAULT_PORT = "/dev/ttyUSB0"
74c77
<         self.port = stn_dict.get("port", Station.DEFAULT_PORT)
---
>         self.port = stn_dict.get("port", '/dev/ttyUSB0')
121d123
<     DEFAULT_PORT = "/dev/ttyUSB0"
237c239
<         self.serial_port.write("LOOP" + chr(255) + chr(255) + chr(0x0D))
---
>         self.serial_port.write(str.encode("LOOP" + chr(255) + chr(255) + 
chr(0x0D)))
407c409
<         default=Station.DEFAULT_PORT,
---
>         default=DEFAULT_PORT
412c414
<         print("Weather Monitor II driver version %s" % DRIVER_VERSION)
---
>         print(("Weather Monitor II driver version %s" % DRIVER_VERSION))
417c419
<             print(
---
>             print((
419c421
<             )
---
>             ))
pi@weather:

Chris Shaker

On Monday, December 30, 2019 at 10:12:50 AM UTC-8 [email protected] wrote:

> Hi Bob,
>
> Jim pretty much cover what is needed to interface the WMII with a 
> Raspberry Pi. For the hardware you will need: a data logger for the WMII 
> and a Serial Interface for the Pi.
>
> For the software, assuming you will be using Raspbian, follow the 
> instructions to install weeWX on a Debian here: 
> http://www.weewx.com/docs/debian.htm
>
> After installing weeWX, follow the instructions in my github repository 
> for installing the WMII driver here: https://github.com/jardiamj/wmII
>
> If you get stuck just send me an email or leave me a message on the github 
> repository.
>
> Jim, thanks for the mention in your website. That's a nice looking 
> website, by the way.
>
> Jardi.
>
>
> On Sunday, December 29, 2019 at 4:07:40 AM UTC-8, Jim Brand wrote:
>
>> Jardi wrote a driver for the weather monitor II, which I have been using 
>> successfully on both a pi zero and/or a pi one. It can be found here. I am 
>> successfully feeding a half dozen other weather sources.
>>
>> https://github.com/jardiamj/wmII
>>
>> You'll  need the weather logger/serial interface for the weather monitor. 
>> You can still find them if you look hard. And don't  have one. You'll also 
>> need a serial interface for the pi. They are cheap on Amazon or elsewhere, 
>> less than 10 bucks.
>>
>> If it is of interest to you, you can see some of that here.
>> http://www.jimbrand.net/weather.html
>>
>> If you are brand new to the pi or this type of project, there is a bit to 
>> be learned here, but it is a fun journey and it works well when done.
>>
>> Hope this helps a little.
>>
>> Jim
>>
>> On Sat, Dec 28, 2019, 7:20 PM Bob Jonas <[email protected]> wrote:
>>
> Im looking to tie a WM2 to a Raspberry Pi.
>>> Either by using existing software or by other means. Problem is I'm new 
>>> Raspberry Pi.
>>>
>>> If you have any insight or direction you could point me, that would be 
>>> greatly appreciated!
>>>
>>> Thanks
>>> Bob
>>>
>>> -- 
>>> 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 [email protected].
>>
>>
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/weewx-development/2521edf1-51b8-430b-9b74-9aefab1bf19d%40googlegroups.com
>>> .
>>>
>>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-development/9c590a4c-3ae3-426f-ad5c-827268f62e39n%40googlegroups.com.

Reply via email to