VantagePro 2 No longer connecting after S/W Update

93 views
Skip to first unread message

Chip Towner

unread,
Nov 24, 2020, 7:19:58 PM11/24/20
to weewx-user
Hi,
I have been using Weewx since 2014 on a RaspberryPi 2.  My weather station is a VantagePro2 and the connection is a straight serial connection (no data logger).  Weewx has worked well for this entire time.

This year after a failed update (mirror sites no longer exist),  I decided I would take a chance and upgrade to the latest version of the Raspbian OS (Buster I beleive).  I backed up my Weewx data as directed prior to the update.  Then I updated the OS and took the opportunity to also update Weewx to the latest/greatest.

Unfortunately Weewx is now unable to connect to the VP2.  

Since I originally configured this connection in 2014 it is possible (perhpas eve likely) that I have missed something or even damaged the VP2 (hope not).  
  • I have dug into the User Guide and believe I have things configured properly.
  • I have used minicom and screen to confirm that my RPi can in fact talk to the VP2.   
    • Used TEST and received the expected reply
    • Used LAMP 1 and turned the display light on
  • I attempted to use wee_device to turn on the VP2 lamp. It did not work. 
    • I copied the results into the file weeDeviceLog.txt in case it might be helpful 
  • I edited the weewx.conf that was installed and did my best to configure things as they were previously (attached is weewxCurrent.conf, a renamed version of this document with some passwords removed)
    • I have updated the weewx.conf file to use software based record generation.
    • The port settings appear to be correct - even when comparing to my previous weewx.conf file.
I am attaching a portion of the tail of the syslog file. I stopped weewx and then started it to show what happens. 

Because it appears that I can communicate with the VP2 using minicom and screen I am hoping this means my RPI & VP2 are healthy and that this is some weewx configuration issue I have missed.

Any help is appreciated!
weewxCurrent.conf
sysLog.txt
weeDeviceLog.txt

Tom Keffer

unread,
Nov 24, 2020, 7:32:11 PM11/24/20
to weewx-user
You didn't say much about your direct serial connection to the console, but it is not properly emulating the Davis WRD command. This command returns the hardware type (VantageVue, VantagePro, etc.)

If all else fails, you can hard set it in the driver. At line 494 (or thereabouts), change this

self.hardware_type = None

to this

self.hardware_type = 16

That may fix things, but there are likely to be other problems. You'll have to do this every time you upgrade. Or, get the serial connection fixed!



--
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 email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/e9bf7d61-7762-4853-b8be-4805299e7536n%40googlegroups.com.

Chip Towner

unread,
Nov 24, 2020, 10:00:35 PM11/24/20
to weewx-user
Hi,
Thanks for the quick reply!
You must see the code and/or these log messages in your sleep, I didn't see anything that even mentioned WRD.  I confirmed with minicom that I am not getting a response when I send out a WRD.  

I appreciate the work around, but before I use it I need to understand why the WRD is not working otherwise I have no idea what else is going wrong and my brain will start to itch.  

FYI, the serial connection is three wires connected from the serial port on the PI to the serial port on the VP2.  The cable ends do not appear to have been moved but it is certainly not robust. I had to move my hardware to perform the upgrade and if things were not shut down properly I suppose I could have damaged something.  Not sure why the WRD was impacted put the TEST, LAMP, VER, NVER commands were not impacted.  Of course different parts of the underlying circuits could have been damaged.

Again thanks very much.

Cheers! 

Tom Keffer

unread,
Nov 25, 2020, 7:25:50 AM11/25/20
to weewx-user
It's not quite that simple. The command is "WRD\x12\x4d". That is, it's the characters WRD, followed by two bytes with values 0x12 and 0x4d. Unfortunately, I don't know of any easy way to transmit special characters using minicom. But, here's a little program that will do it:

import serial
import time

# open up the serial port. Your port may differ.
s = serial.Serial('/dev/ttyUSB0', 19200)
# Wake up the console
s.write(b"\n\n")
time.sleep(0.2)
# Query for the hardware type
s.write(b"WRD\x12\x4d\n")
# Wait a bit for the console to respond
time.sleep(0.2)
# Get the response
b = s.read(4)
print(b)

When I run this program on my machine, I get:
b'\n\r\x06\x10'

The \x06 is the <ACK> character. 

The \x10 is the code for the type of Davis console. \x10 is a VantagePro2. \x11 would be a VantageVue.

As for why this worked before, but not now, I don't know what version of WeeWX you were running. It's possible very old versions did not query for hardware type, but I really don't remember.

-tk



tomn...@frontier.com

unread,
Nov 25, 2020, 9:39:04 AM11/25/20
to weewx-user
I think you might need one of these:  https://www.abelectronics.co.uk/p/51/serial-pi-plus
The RPi's don't have an RS232 port, which is what the weather station is expecting to be hooked to.
I use one of the linked items with no trouble, twice actually.

Chris

Chip Towner

unread,
Nov 27, 2020, 1:19:05 PM11/27/20
to weewx-user
Hi Tom,
After your help, and a bit of forehead on wall thumping I finally figured out my problem.  The permissions for the serial port I am using /dev/ttyAMA0 on my RPi2 were: 
crw--w---- 1 root tty 204, 64 Nov 26 11:57 /dex/ttyAMA0
and my user was a member of the tty group and not the owner.  So it could not read from the port.

My previous attempts to communicate all worked because I was issuing the commands using sudo (duh).

So I have fixed the permission issue by changing the group of ttyAMA0 using the command:

sudo systemctl mask serial...@ttyAMA0.service

so that the port is now a member of the dialout group which has the proper permissions for the port and my user is also a member of this group.
crw--w---- 1 root dialout  204, 64 Nov 26 11:58 /dex/ttyAMA0

Not sure why the permissions are set this way but my RPi2 is about 6 years old now, and the RPi OS & hardware in use today have evolved significantly as has the need for better security.  These combined with my infrequent use of Linux all bit me in the back side.

Again thanks! 

Chip Towner

unread,
Nov 27, 2020, 1:25:38 PM11/27/20
to weewx-user
Tom,
Thanks very much for the link. I looked at options like this when I first started capturing data from my weather station and it seemed like a little bit of overkill for what I needed.  I really only need data from a couple of the serial pins to simply to get the weather data.  

I am actually considering getting a serial to USB cable to clean up the connection and prevent mishaps that can occur if an errant dog tail is not kept a reasonable distance away.

Cheers!

Chip

Chip Towner

unread,
Nov 27, 2020, 3:00:06 PM11/27/20
to weewx-user
Sorry - Chris thanks! :)
Reply all
Reply to author
Forward
0 new messages