Created a Driver for Davis Weather Monitor II

495 views
Skip to first unread message

jard...@gmail.com

unread,
Nov 24, 2018, 5:11:34 PM11/24/18
to weewx-development
I inherited an old Davis Weather Monitor II station when I bought my house a few years ago. Since I couldn't find a weeWX driver for it anywhere I wrote one this last weekend, I used the Ultimeter driver as the basis for it and adapted some code from an app I found online called Weather Update (http://www.dotfunk.com/projects/weatherupdate/). I also found the documentation for the serial communication that was packed with some drivers for MS Windows.

The code is hosted in github: https://github.com/jardiamj/wmII

My weeWX setup with that driver has been running for a couple of days now without a crash so it should be pretty stable, I even unplug and plugged back the data-logger from the console and it didn't crash.

I haven implemented the CRC-checksum in the driver yet, I do have working python code for it but I just haven't added it. I am adding one thing at the time.

I know this is an older station, and I am just happy I was able to give a bit of new life to this old hardware. If you have a WMII and can give my driver a try I would love some feedback.

thanks,
Jardi.

Thomas Keffer

unread,
Nov 24, 2018, 6:26:19 PM11/24/18
to jard...@gmail.com, weewx-de...@googlegroups.com
Well done!

Be sure to include a link off the main Wiki page (section "Drivers") so people can find your driver.

-tk

jard...@gmail.com

unread,
Nov 25, 2018, 3:42:41 AM11/25/18
to weewx-development


On Saturday, November 24, 2018 at 3:26:19 PM UTC-8, Tom Keffer wrote:
Well done!

 
Thanks Tom!
 
Be sure to include a link off the main Wiki page (section "Drivers") so people can find your driver.
 
 
Done! I also added CRC-Checksum to the driver code.

I also discovered that the reed sensor in my rain gauge is malfunctioning and I'll have to replace it.
I am loving this little project so far. The next thing I want to do is access my weather conditions from Home Assistance.

-Jardi

jard...@gmail.com

unread,
Jan 31, 2019, 7:33:15 PM1/31/19
to weewx-development
Hello people!

I have had my custom driver running without issues for a while, I am very happy about it. I have a little question though:
Right now I have my driver reporting the raw pressure measured by the station (pressure) to weeWX and let the weeWX engine take care of calculating the Sea Level Pressure (barometer).
My station allows me to store a reference pressure from a local station and use that as a calibration measurement to estimate Sea Level Pressure (barometer), should I do that calculation in my driver and pass the value as barometer to weeWX or just let weeWX take care of that. What is the recommended approach?

In that same note, I am also writing a driver for the Build Your Own Weather Station tutorial for Raspberry Pi and I'm facing the dilemma of calculating wind gust in the driver or not. Should I just pass the wind speed and then let weeWX engine calculate wind gust?

Thanks,
Jardi.

Thomas Keffer

unread,
Jan 31, 2019, 8:19:11 PM1/31/19
to jard...@gmail.com, weewx-development
Generally, drivers should not calculate derived variables. They should let StdWXService do that. It has access to way more information than the driver, particularly the database. This allows it to do things like correct for semi-diurnal tides.

Another point is that the calculation to go from gauge pressure to sea-level pressure is highly non-linear. You can't just add a correction constant to the former and expect it to work at all temperatures and humidities.

Be sure to see the General guidelines section for writing a device driver.

-tk

Jim Brand

unread,
May 5, 2019, 2:34:21 PM5/5/19
to weewx-development
Hey, Thanks for your work on this.

I'm brand new to weewx, but also have a wmII, and managed to find a datalogger. I've taken this as an opportunity to discover the joys of Rpi serial communications.

I have weewx running fine using the simulator. I seem to have the serial port working, with other serial sources.

When I hook it to the wm, and resetart weewx,  the last line I seem to get in /var/log/messages is:

13:07:49 weather weewx[319]: engine: Loading station type wmII (user.wmII)

Then, well nothing.

Not sure if it is driver, or a weather station issue, and I am still tinkering with it. Having been down this road, if you have any insights, I would be most interested.

Thanks!

Jardi Martínez

unread,
Aug 22, 2019, 2:57:51 PM8/22/19
to weewx-development
Hi Jim! I just saw this message today. Did you ever get the driver working on your WMII Station?

Jardi Martínez

unread,
Aug 22, 2019, 3:39:31 PM8/22/19
to weewx-development
Never mind... I just realized that I actually replied to this message a while back and you got the driver working.
I am going crazy...

Jardi.

Bob Jonas

unread,
Dec 28, 2019, 8:20:26 PM12/28/19
to weewx-development
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

Jim Brand

unread,
Dec 29, 2019, 7:07:40 AM12/29/19
to Bob Jonas, weewx-development
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.


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.

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

--
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/2521edf1-51b8-430b-9b74-9aefab1bf19d%40googlegroups.com.

Jardi Martínez

unread,
Dec 30, 2019, 1:12:50 PM12/30/19
to weewx-development
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.


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.

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 <wx2...@gmail.com> 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 weewx-de...@googlegroups.com.

Christopher Shaker

unread,
Jul 17, 2020, 12:05:08 AM7/17/20
to weewx-development
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 <cjsh...@gmail.com>
> # 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

Christopher Shaker

unread,
Oct 25, 2020, 3:00:14 PM10/25/20
to weewx-development
If my changes really were working, they are not working now.

I configured my system only have Python 3, and now weewx isn't running.

Even the weewx engine code doesn't work on Python 3 without this change:
https://groups.google.com/g/weewx-user/c/G0poSyhJUyc

I'm working with Version 4.2.0 alpha ...
Starting over with my driver mods...

Chris Shaker

Tom Keffer

unread,
Oct 25, 2020, 8:33:24 PM10/25/20
to Christopher Shaker, weewx-development
I'm sorry. Was there a question in there? 

-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/0bad299e-be69-4127-ab64-9d99cdcdc3bdn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages