Davis VP2 can't open ttyUSB0

108 views
Skip to first unread message

bgra...@umw.edu

unread,
Nov 16, 2020, 10:55:33 PM11/16/20
to weewx-user
I have a VP2 console that I am connecting to an RPI OS (latest). Weewx is latest using setup.py. This RPI was running weewx (jessie) with no problems and using ttyUSB0 from weewx.conf. The vantage driver seems ok and I actually moved the old one over to be sure.
I tried listening to the console with minicom but got no data. I swapped out the RS232/USB converter but got the same problem.  Not sure what I have done wrong, other than trying to fix something that wasn't broken...

Attached file of some debug info.

Thanks for any suggestions.

Bob
ttyUSB0.txt

Graham Eddy

unread,
Nov 16, 2020, 11:36:18 PM11/16/20
to weewx...@googlegroups.com
from the log:
the USB/serial adapter seems okay and provides a port.
weewx has opened the port, written some data out, but received no data on read.
is the vp2 connected to the USB/serial adapter? (my DB9 plug sometimes comes adrift so i screwed it in…)

--
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/328d0e08-16f5-461c-8782-f6ee86e95008n%40googlegroups.com.
<ttyUSB0.txt>

Tom Keffer

unread,
Nov 16, 2020, 11:43:17 PM11/16/20
to weewx-user
When you say  you "tried listening to the console with minicom but got no data" what do you mean?

In particular, did you set the baudrate? And, did you type <enter> a few types before trying to type TEST?

-tk

--

bgra...@umw.edu

unread,
Nov 17, 2020, 12:57:53 AM11/17/20
to weewx-user

I don’t remember the minicom string but it was the one posted to test TEST. When I opened minicom it just sat there no echo on TEST or VER. No reply. Several reboots no results. /dev/ttyUSB0 is there but does not respond. Dmesg Seems to have found it.
I checked all plugs and connections. Removed batteries from console to reboot. Even tried new RS232/USB dongle. I have a main ubuntu linux pc running from the ISS so I know that’s working and sending data. The rpi is setup as a second console which was running weather34. Thanks Tom and Graham (you helped me in the days of wview).
Bob
Main setup: grattans.org/wx

Tom Keffer

unread,
Nov 17, 2020, 12:59:54 AM11/17/20
to weewx-user
OK, but did you hit <enter> a few times before typing "TEST"? If so, you have a connectivity problem, not a WeeWX problem.

But, you probably already knew that!

-tk

bgra...@umw.edu

unread,
Nov 17, 2020, 1:04:53 AM11/17/20
to weewx-user
Yes, I did hit enter many times. Since dmesg said that the usb had attached to ttyUSB0 then I assumed (maybe incorrectly) the rpi had connected. I’m at a loss because everything was working...  Thanks.

Tom Keffer

unread,
Nov 17, 2020, 1:30:14 AM11/17/20
to weewx-user
The only thing I can think of to try is to reseat the logger. 

Unless, you actually have the serial version of the VantagePro and are using a serial-to-usb converter. They are notoriously flakey. If you have a spare one, try that.

If none of that works, call Davis.

Greg from Oz

unread,
Nov 17, 2020, 1:36:54 AM11/17/20
to weewx-user
Is the user running this in the dialout group? 

Tom Keffer

unread,
Nov 17, 2020, 1:43:34 AM11/17/20
to weewx-user
If it were a permissions problem, it would have said so. Same if modemmanager controlled the port. Still, it doesn't hurt to try lsof and see if anything else is using the port.

lsof /dev/ttyUSB0




bgra...@umw.edu

unread,
Nov 17, 2020, 2:41:56 PM11/17/20
to weewx-user
root@raspberrypi:/home/pi# ll /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Nov 16 17:48 /dev/ttyUSB0


root@raspberrypi:/home/pi# lsof /dev/ttyUSB0
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.

bgra...@umw.edu

unread,
Nov 17, 2020, 11:07:18 PM11/17/20
to weewx-user

Thanks everyone, I think I have a bad logger (6540).

Tom Keffer

unread,
Nov 18, 2020, 1:14:53 AM11/18/20
to weewx-user
Are you sure? Depending on what permissions the usb port has, you may need to use sudo to run lsof:

sudo lsof /dev/ttyUSB0

Come to think of it, you may have to do that with minicom, too.

Personally, I change the udev rule that governs permissions for usb devices to give everyone access to the port. The rule that governs this is most likely in the directory /lib/udev/rules.d, but which file it is in depends on the operating system. I believe on Raspbian, it's in file 91-permissions.rules, but it may be in 50-udev-default.rules.  Wherever you find it, you want to change this

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664"

to this

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0666"


-tk

Greg from Oz

unread,
Nov 18, 2020, 1:29:08 AM11/18/20
to weewx-user
I set my fineoffset rule to:

SUBSYSTEM=="usb", ATTRS{idVendor}=="1941", ATTRS{idProduct}=="8021", MODE="0666", GROUP="plugdev", SYMLINK+="weather"

That way it is always /dev/weather regardless of the ttyUsb it is attached to.

ll /dev/weather 
lrwxrwxrwx 1 root root 15 Nov 17 09:26 /dev/weather -> bus/usb/002/002

lecoqacr...@gmail.com

unread,
Nov 18, 2020, 1:54:50 PM11/18/20
to weewx-user
What is a good way to test the symlink rule to verify that it was created correctly? There is the new file in /dev/weather but is there a more complete way to test? thank you

Greg from Oz

unread,
Nov 19, 2020, 2:54:41 AM11/19/20
to weewx-user
You would test it the same way as if you configured using /dev/ttyUSB0 for example. 
You just use /dev/weather instead of /dev/ttyUSB0.
There is nothing special about it really. I just use this method as I have several usb devices on my server and I name them to reflect the application I am using so it is easier to know what device has been configured for that application.


Reply all
Reply to author
Forward
0 new messages