Looking for help with Oregon Scientific WMR 89

942 views
Skip to first unread message

Kevin Hedgepeth

unread,
Jan 3, 2018, 4:13:29 PM1/3/18
to weewx-user
I came across an OS WMR89.  I contacted Oregon Scientific prior to getting the 89 and I was told that the 88 and 89 are identical in operation; the 89 is the current model on the market.

I checked the manual and wiki and found that the 88 is compatible with weewx using the WMR100 driver.  So I jumped in and got the 89.

I am using a pi 3.  I used the setup.py installation method.  the WMR89 is giving correct temps on the display.

I am not getting the public_html directory under weewx in the Pi's home directory.

Looking at the Syslog I am getting USB unfound errors.  running lsusb shows that the usb port on the WMR89 is listed; but strangely.  there is no name associated with USB port as I am accustomed to seeing with USB ports; just a manufacturer's ID number.

I have turned Debug on in the .conf file.

If anyone has a WMR89 working or if you have thoughts I would appreciate hearing from you.

thanks in advance
Kevin Hedgepeth
Hermiston, Oregon

Thomas Keffer

unread,
Jan 3, 2018, 4:21:40 PM1/3/18
to weewx-user
It's possible the WMR89 has a different vendor/product ID combo, but it's hard to say without actually seeing that log.

While you're at it, post the results of a "lsusb -v" command.

-tk


mwall

unread,
Jan 3, 2018, 4:36:11 PM1/3/18
to weewx-user
On Wednesday, January 3, 2018 at 4:13:29 PM UTC-5, Kevin Hedgepeth wrote:
I came across an OS WMR89.  I contacted Oregon Scientific prior to getting the 89 and I was told that the 88 and 89 are identical in operation; the 89 is the current model on the market.

you were given incorrect information.

the 88 and 89 may be able to talk to the same sensors, but their computer interfaces are completely different and incompatible.

weewx works with the wmr88, but it does not work with the wmr89.

as of january 2018, no one has been able to reverse engineer the serial communications on the wmr89 (or, if they have, they have not published it).

you could purchase a 20$US sdr-usb dongle then use the weewx-sdr driver to capture the transmissions from the sensors.

or you could build an arduino that does the same thing as the sdr-usb dongle.

then you could add a pressure sensor to the rpi so that you get pressure (and inside temperature and humidity if the pressure sensor includes t/h as well)

as daunting as these might sound, none is terribly difficult - many other people have done it.  there are recipes available to make it happen, and plenty of people on this forum who are willing to help.

m

Kevin Hedgepeth

unread,
Jan 4, 2018, 2:05:57 AM1/4/18
to weewx-user
Ok then.  Thanks for your help and ideas.  I have boxed up the Wx station and it will be returned tomorrow.  I will probably set this project aside until next March or April (unless I come across a killer deal on a station that is on the list of tested stations).

Thanks for the advice.

Kevin

fcauwe

unread,
Feb 5, 2018, 3:13:38 PM2/5/18
to weewx-user
Hi,

With help of others I created a driver for the WMR89,

You can find it here:
https://github.com/fcauwe/weewx/blob/master/bin/weewx/drivers/wmr89.py
You have tell the linux kernel to use the cp210X serial driver for this device.

sudo sh -c 'echo 0fde ca0a > /sys/bus/usb-serial/drivers/cp210x/new_id'

https://www.wxforum.net/index.php?topic=27581.25

François

mwall

unread,
Feb 5, 2018, 3:22:27 PM2/5/18
to weewx-user
On Monday, February 5, 2018 at 3:13:38 PM UTC-5, fcauwe wrote:
Hi,

With help of others I created a driver for the WMR89,

You can find it here:
https://github.com/fcauwe/weewx/blob/master/bin/weewx/drivers/wmr89.py
You have tell the linux kernel to use the cp210X serial driver for this device.

sudo sh -c 'echo 0fde ca0a > /sys/bus/usb-serial/drivers/cp210x/new_id'

https://www.wxforum.net/index.php?topic=27581.25

François

françois,

nice work on the wmr89 driver!

could you describe the system configuration on which you run it?  specifically, what is the architecture, operating system, kernel version, and serial driver version?

there is still confusion about what combination of kernel and/or cp210x versions will accept the non-standard 128000 baud rate.

m

François Cauwe

unread,
Feb 5, 2018, 3:53:47 PM2/5/18
to weewx...@googlegroups.com


mwall schreef op ma 05-02-2018 om 12:22 [-0800]:
>
>
> françois,
>
> nice work on the wmr89 driver!
>
> could you describe the system configuration on which you run it?
> specifically, what is the architecture, operating system, kernel
> version, and serial driver version?
>
> there is still confusion about what combination of kernel and/or
> cp210x versions will accept the non-standard 128000 baud rate.
>

I'm using it on my desktop ubuntu 17.10 with kernel
4.13.0-25-generic #29-Ubuntu SMP Mon Jan 8 21:14:41 UTC 2018 x86_64
x86_64 x86_64 GNU/Linux

Dmesg output;
[1938408.566973] usb 3-1.3: new full-speed USB device number 12 using
xhci_hcd
[1938408.688704] usb 3-1.3: New USB device found, idVendor=0fde,
idProduct=ca0a
[1938408.688705] usb 3-1.3: New USB device strings: Mfr=1, Product=2,
SerialNumber=3
[1938408.688705] usb 3-1.3: Product: WMR89 Professional Weather Station
[1938408.688706] usb 3-1.3: Manufacturer: Silicon Labs
[1938408.688707] usb 3-1.3: SerialNumber: 009F1604
[1938408.690053] cp210x 3-1.3:1.0: cp210x converter detected
[1938408.691030] usb 3-1.3: cp210x converter now attached to ttyUSB0

François

Timo Helkiö

unread,
Mar 14, 2018, 5:35:10 AM3/14/18
to weewx-user

I did get my WMR89 this monday for replacement for 5 years old WMR88, which starts to shown some defunction features.  
oon appeared that direct replacement was not possible. I found this fcauwe's driver and instruction to modify cp210x-driver. I changed cp210x source code from https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers to recognize WMR89, compiled and installed it. Now loading module creates /dev/ttyUSB0.
In weewx.conf I added this:

[WMR89]
    # This section is for the Oregon Scientific WMR100
    
    # The driver to use
    #driver = user.wmr89
    driver = weewx.drivers.wmr89
    
    # The station model, e.g., WMR100, WMR100N, WMRS200
    model = WMR89
    
    type = serial
    product_id = 0xca0a
    port = /dev/ttyUSB0

It did not work before I added "type=serial"
Driver should use these parameters as default. I found this "type"-parameter by reading driver code.
After these, driver worked, but I have two extra temperature sensors. 
Temperature packet in driver is like this:

if (packet[2].encode('hex')=='00'):
          _record = {
            'humidity_in': hum,
            'temperature_in': float(temp),
            'dewpoint_in': dew,
            'dateTime': int(time.time() + 0.5),
            'usUnits': weewx.METRIC
          }
        elif (packet[2].encode('hex')=='01'):
          _record = {
            'humidity_out': hum,
            'temperature_out': float(temp),
            'dewpoint_out': dew,
            'dateTime': int(time.time() + 0.5),
            'usUnits': weewx.METRIC
          }

I did add this:
elif (packet[2].encode('hex')=='02'):
          _record = {
            'humidity_1': hum,
            'temperature_1': float(temp),
            'dewpoint_1': dew,
            'dateTime': int(time.time() + 0.5),
            'usUnits': weewx.METRIC
          }
        elif (packet[2].encode('hex')=='03'):
          _record = {
            'humidity_2': hum,
            'temperature_2': float(temp),
            'dewpoint_2': dew,
            'dateTime': int(time.time() + 0.5),
            'usUnits': weewx.METRIC
          }

Now everything is working, except barometer data is quite often missing. 

         Timo

François Cauwe

unread,
Mar 14, 2018, 4:18:52 PM3/14/18
to weewx...@googlegroups.com
Hi,

I'm happy to hear you got it working, I update my github with you
modification;
https://github.com/fcauwe/weewx

I noticed that the barometer only opdates every 15 minutes, so I have
modified the "archive_interval" to "900", now I always have barometer
data on the WOW site.

François



Timo Helkiö schreef op wo 14-03-2018 om 02:35 [-0700]:
> --
> You received this message because you are subscribed to a topic in
> the Google Groups "weewx-user" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/top
> ic/weewx-user/FxNx6am2MgM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to w
> eewx-user+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

dani.mac...@gmail.com

unread,
Apr 3, 2018, 4:05:15 AM4/3/18
to weewx-user
Thank you very much for your efforts doing this driver for WMR89.
Like Timolavi, my WMR88 died yesterday and I am looking for a replacement with which I can reuse my old sensors. WMR89 seems perfect, despite the driver problem... I am running Weewx in a Raspberry Pi, do you know if your driver will work fine with my hardware? I have read that in Raspberry Pi the baud rate 128000 can not be set.
Another option would be the WMR86, but I don't see it in the compatible list of hardware altough in the WMR 100 driver appears as compatible... Does somebody has experience with this station?

dani.mac...@gmail.com

unread,
Apr 9, 2018, 6:22:43 AM4/9/18
to weewx-user
Hello again,

I have been experimenting with François drivers since last Wednesday and I have found a couple of problems:
  • In the driver, the rain packet does not contain the attribute rain. I have used the version from WMR100 driver and I think it is working correctly now: _record['rain'] = weewx.wxformulas.calculate_rain( _record['rain_total'], self.last_rain_total) self.last_rain_total = _record['rain_total'].
  • I get some estrange values in the outHumidity sensor: "LOOP value 'outHumidity' 252.0 outside limits (0.0, 100.0)". I am not sure if the problem is in my station (I was not able to see the humidity value in the console) or in the driver. Will try to have a closer look in the next days.
Regards,

Daniel

Rod Avery

unread,
Apr 17, 2018, 5:40:19 AM4/17/18
to weewx-user
Hello all,

I have been using the driver posted by fcauwe for a little while and am getting data through from the WMR89. 

I did notice that it was not reporting rain fall per hour. Looking through the code I found the following if statement under def _wmr89_rain_packet(self, packet):

 if packet[2:4].encode('hex')=='fffe':
           Rh = None
 else:


Looking at the output from the WMR89 it looks like having output in the packet containing fffe means there is rain data not that there isn't rain data. So I modified the code to NOT EQUAL :

 if packet[2:4].encode('hex')!='fffe':
           Rh = None
 else:


I am now getting correct output with regards to rain.

I have also taken Daniels suggestion and added the code from his post.

On a side issue, I am getting the following:
Apr 17 10:34:30 weatherstation weewx[27499]: wmr89: Invalid data packet (b3050100b9).

Does anyone know what this packet is? I have a UV sensor connected so could it be for that?

Big thank you to all involved in writing the driver for the WMR89 - Very helpful!

Rod.



Rod Avery

unread,
Apr 17, 2018, 8:28:15 AM4/17/18
to weewx-user
Hello again.

Through further testing I think it is the UV sensor. 

For example: 

b3050100b8 -> ignore b3, gives 5 : 1 : 0 : 185
b3050200ba -> ignore b3, gives 5 : 2 : 0 : 186

So bit 1 always gives 5 - Could be battery status not sure
Bit 2 seems to tally with what the WMR89 is displaying on its screen
Bit 3 is always 0
Bit 4 is 184 plus bit 2

I have added the following to the driver and am getting what looks to be sensible readings:

    def _wmr89_uv_packet(self, packet):
        ## 0   1   2   3   4
        ## b3  05  00  00  b8
        ## b3  05  01  00  b9
        ## b3  05  02  00  ba

        ## looks like 2 is the UV reading although 4 is 184 + UV reading at the moment

        #Get readings from the packet to print out to syslog for testing
        num1=ord(packet[1])
        num2=ord(packet[2])
        num3=ord(packet[3])
        num4=ord(packet[4])

        Send readings to the syslog
        logdbg("UV1 : " + str(num1) + "  UV2 : " + str(num2) + "  UV3 : " + str(num3) + "  UV4 : " + str(num4))

        _record = {'uv': ord(packet[2]),
                   #'battery_status_uv': packet[0] >> 4,
                   'dateTime': int(time.time() + 0.5),
                   'usUnits': weewx.METRIC
        }

        return _record


To get it all working and to help people like me who have no real idea on how to code you'll need to add the following to the driver:

class WMR89(weewx.drivers.AbstractDevice):
    """Driver for the Oregon Scientific WMR89 console.

    The connection to the console will be open after initialization"""

    DEFAULT_MAP = {
        'barometer': 'barometer',
        'pressure': 'pressure',
...
        'windchill': 'windchill',
        'UV': 'uv'}

...


and in  def genLoopPackets(self):

 elif decode[i][0].encode('hex')=='b5':#T/Hum  OK
                    _record = self._wmr89_temp_packet(decode[i])
                 elif decode[i][0].encode('hex')=='b3': #UV ?
                    _record = self._wmr89_uv_packet(decode[i])
                 else:

...



Dani Macías Perea

unread,
Apr 17, 2018, 9:34:04 AM4/17/18
to weewx...@googlegroups.com
Hi Rob,

Regarding the rain faill per hour, I am not sure if what you proposed is correct. What you are doing in your code, if I understood you correctly, is the following:

if packet[2:4].encode('hex')!='fffe':
           Rh = None
 else:
           Rh = (256*ord(packet[2])+ord(packet[3]))*2.54/100

So in your else branch, you will always have packet[2]=ff and packet[3]=fe. Of course, you are now getting output regarding the rain but the Rh will always be 1664.56, isn't? 

As it is not saved in DB, I don't use the Rh and have never checked its values. I don't have neither an UV sensor, so I can't help in your second question.



--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/FxNx6am2MgM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+unsubscribe@googlegroups.com.

Rod Avery

unread,
Apr 17, 2018, 2:41:01 PM4/17/18
to weewx-user
Dani,

You are quite right, obvious when pointed out!

I think its correct to assume that FFFE part of the packet means there has been rainfall in the last hour. I have just run another test:

b111000000000000003f0e01010c00011d = 0 rain fall in the last hour (some in the last 24 hours)

b111fffe0008000800470e01010c000332 = 0.08in / 2ml in the last hour.

I'm going to have a look through it all now and see if I can work it out.

To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Kari Haapanen

unread,
Jun 9, 2018, 5:20:03 AM6/9/18
to weewx-user
Looks like people are able to use wmr89 with weewx. Except me.
I run weewx raspbian on raspberry pi. 

I've done pretty much everything I've found about this topic, but no luck.
When I start weewx it loads the driver and sensor map and then the process just dies. 
Debug = 1, but all I get in the messages log is this:

Jun  9 11:50:23 raspberrypi weewx[4502]: engine: Initializing weewx version 3.8.0
Jun  9 11:50:23 raspberrypi weewx[4502]: engine: Using Python 2.7.3 (default, Nov 24 2017, 21:13:24) #012[GCC 4.6.3]
Jun  9 11:50:23 raspberrypi weewx[4502]: engine: Platform Linux-4.14.39+-armv6l-with-debian-7.11
Jun  9 11:50:23 raspberrypi weewx[4502]: engine: Locale is 'fi_FI.UTF-8'
Jun  9 11:50:23 raspberrypi weewx[4502]: engine: pid file is /var/run/weewx.pid
Jun  9 11:50:23 raspberrypi weewx[4506]: engine: Using configuration file /etc/weewx/weewx.conf
Jun  9 11:50:23 raspberrypi weewx[4506]: engine: Loading station type WMR89 (user.wmr89)
Jun  9 11:50:23 raspberrypi weewx[4506]: wmr89: driver version is 0.1.1
Jun  9 11:50:23 raspberrypi weewx[4506]: wmr89: sensor map is {'yesterdayRain': 'rain_yesterday', 'extraTemp8': 'temperature_8', 'outHumidity': 'humi
dity_out', 'extraHumid1': 'humidity_1', 'inTempBatteryStatus': 'battery_status_in', 'rainBatteryStatus': 'battery_status_rain', 'extraTemp5': 'temper
ature_5', 'extraTemp2': 'temperature_2', 'outTempBatteryStatus': 'battery_status_out', 'inDewpoint': 'dewpoint_in', 'hourRain': 'rain_hour', 'inTemp'
: 'temperature_in', 'barometer': 'barometer', 'windchill': 'windchill', 'dewpoint': 'dewpoint_out', 'extraTemp7': 'temperature_7', 'rain': 'rain', 'e
xtraHumid6': 'humidity_6', 'extraHumid7': 'humidity_7', 'extraHumid4': 'humidity_4', 'extraHumid5': 'humidity_5', 'extraHumid2': 'humidity_2', 'extra
Humid3': 'humidity_3', 'dewpoint5': 'dewpoint_5', 'dewpoint4': 'dewpoint_4', 'extraTemp6': 'temperature_6', 'rainTotal': 'rain_total', 'extraTemp4':
'temperature_4', 'dewpoint8': 'dewpoint_8', 'rainRate': 'rain_rate', 'extraTemp3': 'temperature_3', 'extraHumid8': 'humidity_8', 'extraTemp1': 'tempe
rature_1', 'dewpoint1': 'dewpoint_1', 'dewpoint3': 'dewpoint_3', 'extraBatteryStatus8': 'battery_status_8', 'dewpoint2': 'dewpoint_2', 'extraBatteryS
tatus2': 'battery_status_2', 'extraBatteryStatus3': 'battery_status_3', 'windBatteryStatus': 'battery_status_wind', 'extraBatteryStatus1': 'battery_s
tatus_1', 'extraBatteryStatus6': 'battery_status_6', 'extraBatteryStatus7': 'battery_status_7', 'extraBatteryStatus4': 'battery_status_4', 'extraBatt
eryStatus5': 'battery_status_5', 'windDir': 'wind_dir', 'outTemp': 'temperature_out', 'windSpeed': 'wind_speed', 'dewpoint0': 'dewpoint_0', 'inHumidi
ty': 'humidity_in', 'rain24': 'rain_24', 'windGust': 'wind_gust', 'dewpoint7': 'dewpoint_7', 'pressure': 'pressure', 'windGustDir': 'wind_gust_dir',
'dewpoint6': 'dewpoint_6'}



Then I ran the binary with "strace" and got this before it dies:

stat64("/usr/share/weewx/weewx/drivers", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64("/usr/share/weewx/weewx/drivers", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64("/usr/share/weewx/weewx/drivers/syslog", 0xbedd7560) = -1 ENOENT (No such file or directory)
open("/usr/share/weewx/weewx/drivers/syslog.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/share/weewx/weewx/drivers/syslogmodule.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/share/weewx/weewx/drivers/syslog.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/share/weewx/weewx/drivers/syslog.pyc", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
stat64("/usr/share/weewx/weewx/drivers/weewx", 0xbedd7560) = -1 ENOENT (No such file or directory)
open("/usr/share/weewx/weewx/drivers/weewx.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/share/weewx/weewx/drivers/weewxmodule.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/share/weewx/weewx/drivers/weewx.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/share/weewx/weewx/drivers/weewx.pyc", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
close(5)                                = 0
stat64("/usr/share/weewx/user/math", 0xbedd78f0) = -1 ENOENT (No such file or directory)
open("/usr/share/weewx/user/math.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/share/weewx/user/mathmodule.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/share/weewx/user/math.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/share/weewx/user/math.pyc", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
close(4)                                = 0
gettimeofday({1528530407, 802726}, NULL) = 0
send(3, "<14>Jun  9 10:46:47 weewx[3659]:"..., 63, MSG_NOSIGNAL) = 63
gettimeofday({1528530407, 809532}, NULL) = 0
send(3, "<14>Jun  9 10:46:47 weewx[3659]:"..., 1806, MSG_NOSIGNAL) = 1806
open("/dev/ttyUSB0", O_RDWR|O_NOCTTY|O_NONBLOCK|O_LARGEFILE) = 4
ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 -opost -isig -icanon -echo ...}) = 0
ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 -opost -isig -icanon -echo ...}) = 0
ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 -opost -isig -icanon -echo ...}) = 0
ioctl(4, SNDCTL_TMR_START or TCSETS, {B38400 -opost -isig -icanon -echo ...}) = 0
ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 -opost -isig -icanon -echo ...}) = 0
stat64("/usr/lib/python2.7/dist-packages/serial/array", 0xbedd70f8) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.7/dist-packages/serial/array.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.7/dist-packages/serial/arraymodule.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.7/dist-packages/serial/array.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.7/dist-packages/serial/array.pyc", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
ioctl(4, TIOCGSERIAL, 0xbedd7ee8)       = -1 ENOTTY (Inappropriate ioctl for device)
close(4)                                = 0
gettimeofday({1528530407, 848022}, NULL) = 0
send(3, "<11>Jun  9 10:46:47 weewx[3659]:"..., 125, MSG_NOSIGNAL) = 125
gettimeofday({1528530407, 852714}, NULL) = 0
send(3, "<10>Jun  9 10:46:47 weewx[3659]:"..., 101, MSG_NOSIGNAL) = 101
gettimeofday({1528530407, 857412}, NULL) = 0
send(3, "<10>Jun  9 10:46:47 weewx[3659]:"..., 53, MSG_NOSIGNAL) = 53
rt_sigaction(SIGINT, {SIG_DFL, [], 0x4000000 /* SA_??? */}, {0x2ce78, [], 0x4000000 /* SA_??? */}, 8) = 0
rt_sigaction(SIGHUP, {SIG_DFL, [], 0x4000000 /* SA_??? */}, {0x2ce78, [], 0x4000000 /* SA_??? */}, 8) = 0
rt_sigaction(SIGTERM, {SIG_DFL, [], 0x4000000 /* SA_??? */}, {0x2ce78, [], 0x4000000 /* SA_??? */}, 8) = 0
exit_group(4)                           = ?
root@raspberrypi:~# 

tty device is in place:
crw-rw---T 1 root dialout 188, 0 Jun 8 16:49 /dev/ttyUSB0

I have no clue what to do next. Any help highly appreciated.

Karsta

unread,
Jun 10, 2018, 7:04:16 AM6/10/18
to weewx-user
Does anyone know what should provide those missing files, like "weewxmodule.so" etc?
Googled it and got zero hits.

Timo

unread,
Jun 10, 2018, 10:27:36 AM6/10/18
to weewx-user
Hi all,

Here's yet another WMR89 owner trying to get it working. I've got so far as to get it talking with my raspberry. I had to update pyserial. Then the driver died on unknown packet type:

wmr89: raw: D1 0E 57 4D 52 38 39 20 56 30 35 34 03 55
...
****    File "/usr/share/weewx/user/wmr89.py", line 222, in get_data
****      (ord(x), _fmt(a[i])))
****  TypeError: ord() expected a character, but string of length 2 found
I fixed the problem with ord() and got it over the unknown packets.

But now I'm getting odd errors like:

****  NameError: global name 'weeutil' is not defined

That one I managed to sort out. But then:

****    File "/usr/share/weewx/user/wmr89.py", line 129, in _calculate_rain_delta
****      packet['rain_total'], self.last_rain)
****  KeyError: 'rain_total'

Can anyone decipher from these what is wrong in my setup? Do I have a version mismatch or something?

Here's something about the setup:

engine: Initializing weewx version 3.8.0
engine: Using Python 2.7.9 (default, Sep 17 2016, 20:26:04) #012[GCC 4.9.2]
engine: Platform Linux-4.9.35+-armv6l-with-debian-8.0
engine: Locale is 'LC_CTYPE=en_GB.UTF-8;LC_NUMERIC=fi_FI.UTF-8;LC_TIME=fi_FI.UTF-8;LC_COLLATE=e
n_GB.UTF-8;LC_MONETARY=fi_FI.UTF-8;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=fi_FI.UTF-8;LC_NAME=fi_FI.UTF-8;LC_ADDRESS=fi_FI.UTF-8;LC_TELEPHONE=
fi_FI.UTF-8;LC_MEASUREMENT=fi_FI.UTF-8;LC_IDENTIFICATION=fi_FI.UTF-8'

engine: Using configuration file /etc/weewx/weewx.conf
engine: debug is 2
engine: Initializing engine

engine: Loading station type WMR89 (user.wmr89)
wmr89: driver version is 0.3

Timo

Timo

unread,
Jun 10, 2018, 2:16:40 PM6/10/18
to weewx-user
Update:

I commented out the call to _calculate_rain_delta and got this basically working. Apparent problems remaining:

- Rain, obviously

- Wind

- weewxd doesn't start with "sudo /etc/init.d/weewx start"

Otherwise things start to look better.

Timo

gjr80

unread,
Jun 10, 2018, 8:54:58 PM6/10/18
to weewx-user
Hi,

I'm not going to touch the WMR89 specific issues, but when you say 'weewxd doesn't start with "sudo /etc/init.d/weewx start"' what exactly happens, is there any response in the log or on the screen? What method did you use to install weeWX? Are you the 'Timo' from 14 March that indicated in an earlier post that it was working except for barometer? If so what changed?

Gary

dani.mac...@gmail.com

unread,
Jun 11, 2018, 2:30:54 AM6/11/18
to weewx-user
Hi Timo,


I don't really know where your problem can be, I have never seen this problems while using this driver (and it has been up and running during more than 2 months). I use Weewx version 3.8.0 too, same Linux and Python 2.7.13. 

Have you tried to start with a fresh installation and see if the problems appears again? 

Dani

dani.mac...@gmail.com

unread,
Jun 11, 2018, 2:39:46 AM6/11/18
to weewx-user

Karsta, was your weeWX installation working correctly before changing to driver WMR89? I don't understand why are you receiving this "file not found" errors.
If so, can you post the configuration regarding the station in weewx.conf file?

Dani

if I understand correctly your logs, your Python is not able to find 

tik...@gmail.com

unread,
Jun 11, 2018, 3:03:33 AM6/11/18
to weewx...@googlegroups.com, gjr80
Hi Gary,

Thanks for taking the time to answer!

On 11.06.2018 03:54, gjr80 wrote:
> I'm not going to touch the WMR89 specific issues, but when you say
> 'weewxd doesn't start with "sudo /etc/init.d/weewx start"' what
> exactly happens, is there any response in the log or on the screen?
Nothing revealing.

terminal:

> timo@raspberrypi:~ $ sudo /etc/init.d/weewx start
> [ ok ] Starting weewx (via systemctl): weewx.service.
> timo@raspberrypi:~ $ ps ax | grep wee
> 5607 pts/0 S+ 0:00 grep --color=auto wee

syslog:

> Jun 11 06:48:41 raspberrypi systemd[1]: Started LSB: weewx weather system.

When I try to replicate the init script by hand, everything looks good:

> timo@raspberrypi:~ $ sudo start-stop-daemon --start --chuid root:root --pidfile=
> /var/run/weewx.pid --exec /usr/bin/weewxd -- --daemon --pidfile=/var/run/weewx.p
> id /etc/weewx/weewx.conf
> timo@raspberrypi:~ $ ps ax | grep wee
> 5617 ? S 0:00 python /usr/bin/weewxd --daemon --pidfile=/var/run/we
> ewx.pid /etc/weewx/weewx.conf
> 5622 pts/0 S+ 0:00 grep --color=auto wee

I tried to output some debugging from the script with "echo xyz >&2" and
"logger xyz" to no avail. It is like the script was not executed at all
but how could that be...

I'm not too familiar with systemd...

> What method did you use to install weeWX?
apt install

> timo@raspberrypi:~ $ cat /etc/apt/sources.list.d/weewx.list
> deb [arch=all] http://weewx.com/apt/ squeeze main

> Are you the 'Timo' from 14 March that indicated in an earlier post
> that it was working except for barometer? If so what changed?
No. I'm yet another Timo. I began to install this thing just last week.

--

Timo

tik...@gmail.com

unread,
Jun 11, 2018, 3:22:16 AM6/11/18
to weewx...@googlegroups.com, dani.mac...@gmail.com
Hi Dani,

On 11.06.2018 09:30, dani.mac...@gmail.com wrote:
> Are you using the driver from
> François? https://github.com/fcauwe/weewx/blob/master/bin/weewx/drivers/wmr89.py

No, https://github.com/matthewwall/weewx-wmr89/archive/master.zip instead.

Thanks for an important hint! I didn't realize that there are many
implementations. I installed weewx with apt and it didn't offer wmr89
driver at all. Matthew's driver was the first hit with google.

> I don't really know where your problem can be, I have never seen this
> problems while using this driver (and it has been up and running during
> more than 2 months). I use Weewx version 3.8.0 too, same Linux and
> Python 2.7.13.

I see now that the tag 3.8.0 doesn't include wmr89 driver. Did you
install the master branch from github or did you add the driver by hand
afterwards?

--

Timo

Dani Macías Perea

unread,
Jun 11, 2018, 4:44:19 AM6/11/18
to tik...@gmail.com, weewx...@googlegroups.com
You are wellcome Timo. I don't remember just now why, but for some reason Matthew's drivers was not working fine in my installation too.
I just added the file ( https://github.com/fcauwe/weewx/blob/master/bin/weewx/drivers/wmr89.py) to /usr/share/weewx/drivers/  and configured as required the weewx.conf file. It should be something like that:
[WMR89]
    model = WMR89
    driver = weewx.drivers.wmr89
    type = serial
    product_id = 0xca0a
    port = /dev/ttyUSB0

After restarting weewx, it should start importing data.

tik...@gmail.com

unread,
Jun 11, 2018, 5:45:41 AM6/11/18
to Dani Macías Perea, weewx...@googlegroups.com
On 11.06.2018 11:44, Dani Macías Perea wrote:
> ...
> I just added the file (..) to /usr/share/weewx/drivers/ ...

Thank you, Dani. I'll try that right when I get my hands on my RB.

--

Timo

Timo

unread,
Jun 11, 2018, 1:11:07 PM6/11/18
to Dani Macías Perea, weewx...@googlegroups.com
On 11.06.2018 11:44, Dani Macías Perea wrote:
> ...
> I just added the file
> https://github.com/fcauwe/weewx/blob/master/bin/weewx/drivers/wmr89.py
> to /usr/share/weewx/drivers/
> ...
> After restarting weewx, it should start importing data.

Yees, works perfectly.

For the record: I have only 'driver' and 'port' lines in [WMR89] section.

--

Timo

gjr80

unread,
Jun 11, 2018, 7:27:09 PM6/11/18
to weewx-user
Timo the latter,
 
> Are you the 'Timo' from 14 March that indicated in an earlier post
> that it was working except for barometer? If so what changed?
No. I'm yet another Timo. I began to install this thing just last week.

Talk about coincidence, two Timo's in the same thread with the same station.... Anyway.


I'm not too familiar with systemd...

You and me both, you've done about all I can think, you might need Matthew or someone else well versed on systemd to help further.


I tried to output some debugging from the script with "echo xyz >&2" and
"logger xyz" to no avail.

 log_daemon_msg "message text" won't help will it?


Gary

Glenn McKechnie

unread,
Jun 11, 2018, 8:16:11 PM6/11/18
to weewx-user
Timo,

You can run the sysv start script with the -x flag and it may yield a hint. ie:-

sudo bash -x /etc/init.d/weewx start

You'll get a lot of output but amongst it all there might be something
enlightening?


eg;- mine returns the following, the 'return 0' says it was successful.

+ do_start
++ count_procs
+++ ps ax
+++ wc -l
+++ grep /home/weewx/bin/weewxd
+++ grep weewx.pid
++ NPROC=0
++ echo 0
+ NPROC=0
+ '[' 0 '!=' 0 ']'
+ start-stop-daemon --start --chuid root:root --pidfile
/var/run/weewx.pid --exec /home/weewx/bin/weewxd -- --daemon
--pidfile=/var/run/weewx.pid /home/weewx/weewx.conf
+ return 0


Cheers
Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an

Kari Haapanen

unread,
Jun 12, 2018, 9:58:39 AM6/12/18
to weewx...@googlegroups.com, dani.mac...@gmail.com
​​
Hi guys.
I still don't have it working.

I've purged and installed weewx several times with apt-get, but nothing changes.
The last lines of bash -x while running the init script start are:

+ RED=''
++ /usr/bin/tput setaf 3                                                                                                                                        
+ YELLOW=''                                                                                                                                                     
++ /usr/bin/tput op                                                                                                                                             
+ NORMAL=''                                                                                                                                                     
+ '[' 0 -eq 0 ']'
+ echo .
.
+ log_end_msg_post 0
+ :
+ return 0
+ RETVAL=0
+ exit 0

I wonder how can the exit code be zero?

The driver path becomes different than what you have stated. Mine is:
/usr/share/weewx/weewx/drivers/

When I put the wmr89.py file in there, it's selectable when running "wee_config --reconfigure"
I've also tried several modified drivers plus the one you have used now.

Looks like my setup does not even try to communicate with anything wmr89 related even it's loading the driver
Could some of you explain how you did it on raspi? 
I'm getting really desperate.

- Karsta

Timo

unread,
Jun 12, 2018, 12:05:17 PM6/12/18
to Kari Haapanen, weewx...@googlegroups.com, dani.mac...@gmail.com
Terve Kari,

On 12.06.2018 16:58, Kari Haapanen wrote:
> ​Hi guys.
> I still don't have it working.

Works for me ;)

I'll try to tell something about my route to success in the hope it
gives you some hints

> I've purged and installed weewx several times with apt-get, but
> nothing changes. The last lines of bash -x while running the init
> script start are: > ...

I'm not able to start weewxd with init script either. As of now I have
always started it manually:

> sudo start-stop-daemon --start --chuid root:root --pidfile=/var/run/weewx.pid --exec /usr/bin/weewxd -- --daemon --pidfile=/var/run/weewx.pid /etc/weewx/weewx.conf

I have a feeling that systemd has its role in this problem. I have
traced so far that it seems that systemd scripts finally makes this call:

> systemctl start weewx

which returns success but actually does nothing, at least when tried
manually.

> Looks like my setup does not even try to communicate with anything
> wmr89 related even it's loading the driver Could some of you explain
> how you did it on raspi? I'm getting really desperate.
From your earlier strace I see that you get 'Inappropriate ioctl for
device' and then the port is closed. I got the same error and the
solution was this:

> sudo apt remove python-serial
> https://kent.dl.sourceforge.net/project/pyserial/pyserial/2.7/pyserial-2.7.tar.gz
> tar xzf pyserial-2.7.tar.gz
> cd pyserial-2.7/
> sudo python setup.py install

I'm not sure if you have the same problem.

Earlier I did also this:

> sudo modprobe cp210x
> sudo sh -c 'echo 0fde ca0a > /sys/bus/usb-serial/drivers/cp210x/new_id'

but if you have /dev/ttyUSB0 already, I think you don't need to do that.

--

Timo

Kari Haapanen

unread,
Jun 12, 2018, 1:20:40 PM6/12/18
to tik...@gmail.com, weewx...@googlegroups.com, dani.mac...@gmail.com
Kiitos Timo.

My raspi does not have systemd (raspbian 7, wheezy)

The python replacement sounds an option, but removing it would remove as well
weewx and wfrog (which kind of works with wh1080)

Install without removing first might mess things up even more, or what do you think?

- Karsta

Timo

unread,
Jun 12, 2018, 1:46:51 PM6/12/18
to Kari Haapanen, weewx...@googlegroups.com, dani.mac...@gmail.com
On 12.06.2018 20:20, Kari Haapanen wrote:
> The python replacement sounds an option, but removing it would remove
> as well weewx and wfrog (which kind of works with wh1080)
>
> Install without removing first might mess things up even more, or
> what do you think?

As you say it I now remember that that was precisely what I did. apt
wanted to remove something so I skipped the 'apt remove' part. pyserial
went into /usr/local/lib/python2.7/dist-packages directory.

I can't tell about messing other things up because I have no other
python programs than the weewx in my RB.

The problem at least in my case was that WMR89 wants 128000 baud and the
standard python serial code can't do custom bauds (maybe that was fixed
in python3).

I too went into desperate mode for a while so my memory might not serve
accurate details...

--

Timo

Timo

unread,
Jun 12, 2018, 4:16:09 PM6/12/18
to weewx...@googlegroups.com, Glenn McKechnie, gjr80
Glenn, Gary,

Thanks for your help!

Armed with ideas I got some grip of the systemd.

When init script is run manually, it was actually not executed at all after

> . /lib/lsb/init-functions

line. I had to put

> export _SYSTEMCTL_SKIP_REDIRECT=1

there at the beginning. Then it worked manually too. At boot time it
always worked, I suppose, but I didn't know because at first serial port
didn't work.

I appended 'cp210x' into /etc/modules and

> echo 0fde ca0a > /sys/bus/usb-serial/drivers/cp210x/new_id

line into /etc/init.d/weewx do_start function and now weewxd comes up
unattended on boot.

--

Timo

Kari Haapanen

unread,
Jun 19, 2018, 11:24:14 AM6/19/18
to tik...@gmail.com, weewx...@googlegroups.com, dani.mac...@gmail.com
Guys. Finally. Too old pyserial. Got it working by this procedure:

tar -xvzf pyserial-2.7.tar.gz
cd pyserial-2.7/
python setup.py install
service weewx start

Thank you guys. Especially Timo!

Next to struggle with skins and localization...

Timo

unread,
Jun 19, 2018, 1:30:40 PM6/19/18
to Kari Haapanen, weewx...@googlegroups.com
On 19.06.2018 18:23, Kari Haapanen wrote:
> Thank you guys. Especially Timo!

Glad to help in my turn!

> Next to struggle with skins and localization...

I also tried to do a little bit translation work. I'll attach what I
have done so far (/etc/weewx/skins/Standard/skin.conf and
index.html.tmpl). Obviously not all translations are "correct" but I
tried to make it easy to understand. For example 'lämpöindeksi' (heat
index) or 'vektorikeskinopeus' (Vector Average Speed) wouldn't tell my
parents in law much. Of course, I can't tell whether I did any better.

It would be nice if we could arrange for some kind of shared effort for
localization. There seems to be also other finnish users here (even
other Timos)...

--

Timo
index.html.tmpl
skin.conf

Kari Haapanen

unread,
Jun 19, 2018, 1:58:24 PM6/19/18
to tik...@gmail.com, weewx...@googlegroups.com
Sounds good. 
I'll go for Bootstrap and amphibian at least next, but not before Juhannus :)
Reply all
Reply to author
Forward
0 new messages