Vantage Pro2 connected via USB with QNAP

663 views
Skip to first unread message

Johnnsy

unread,
Apr 2, 2012, 8:13:26 AM4/2/12
to wfrog-users
Hi,

I would like to connect my vantage pro2 weatherstation via USB with my
QNAP (no serial port available). Checking the driver source code for
vantage pro2 I saw only ttys0 mentioned.
Is it planned to add a USB driver for vantage pro2?

Thanks
Johnnsy

Jordi Puigsegur Figueras

unread,
Apr 2, 2012, 9:30:28 AM4/2/12
to wfrog...@googlegroups.com
Hi,

If I am not mistaken USB VantagePro2 stations emulate a serial port. Therefore the implementation is the same. Basically you will have to configure your USB serial port, e.g. /dev/ttyUSB0

Jordi.

2012/4/2 Johnnsy <andreas...@googlemail.com>

Johnnsy

unread,
Apr 2, 2012, 3:53:47 PM4/2/12
to wfrog-users
Hi Jordi,

Can I use the vantagepro wfdriver or do I have to add your vantagepro2
driver? Is there any interface difference between vantagepro and
vantagepro2?
How can I map the USB port to ttyS0? Or will it be done automatically?

Thanks
Johnnsy

Jordi Puigsegur Figueras

unread,
Apr 2, 2012, 4:47:56 PM4/2/12
to wfrog...@googlegroups.com
hi,

You should use vantagepro2. It is a native driver which collects all data packets from the station (every 2 seconds aprox.). It is much better than the vantagepro.

Regarding the port: you should identify which is the name of the port in your system (usually /dev/ttyUSB0) and configure wfdriver/embedded.yaml accordingly. I.e, This is how my config file (/etc/wfrog/wfdriver/config/embedded.yaml) looks like:

station: !${settings.station.driver} 
    port: /dev/ttyUSB0
    pressure_cal: 2

Jordi.

2012/4/2 Johnnsy <andreas...@googlemail.com>

Johnnsy

unread,
Apr 5, 2012, 5:40:21 PM4/5/12
to wfrog-users
Hi,

I changed in
- embedded.yaml
- vantagepro.py (after I stopped and deleted vantagepro.pyc)
- wfdriver.yaml

port: /dev/ttyS0 to port: /dev/ttyUSBx with x=0,1,2. This was always
done with disabling and enabling Wfrog.
Using lsusb I am getting 3 USB devices (always bus 001 and device 001,
002, 003).

This changes didn't help in recognising my vantagepro2 station.

I also restarted the NAS without success

Do you have any ideas?

I also tried to use your vantagepro2 driver from release 0.8.2. but I
was getting always errors right at the
beginning (after I started wfrog.sh) about a missing import serial
file.
Where can I get the file from?

Johnnsy

Jordi Puigsegur Figueras

unread,
Apr 6, 2012, 3:16:58 AM4/6/12
to wfrog...@googlegroups.com
Hi,

You should use vantagepro2 driver, but before you need to install the serial module which is necessary to access the station.

$ apt-get install python-serial

If your station has a serial interface your port should be /dev/ttyS0 and if it is a usb station then it will probably be /dev/ttyUSB0. However this is only a guess, you should do a ls /dev/tty* before and after plugin the station to be sure).

Jordi.

2012/4/5 Johnnsy <andreas...@googlemail.com>

Johnnsy

unread,
Apr 6, 2012, 4:31:40 PM4/6/12
to wfrog-users
Hi,

That's too heavy for me.
I'm still struggling to load the right driver for the usb-serial
interface. It seems as if I have the wrong or old usbserial.ko driver.
No clue where I can get the correct one. This should the dev/ttyUSB0
issue.

The installation of the python-serial package is for me in moment
impossible. I have to get more familiar with the Qnap linux.

That for your help.

Johnnsy

Johnnsy

unread,
Apr 10, 2012, 8:11:54 AM4/10/12
to wfrog-users
Okay,
I installed the usbserial and ftdi_sio driver. The weatherstation is
now detected correctly. Then I installed pyserial 2.6 successfully but
wfrog produced following error (wfrender.log):

2012-04-10 14:02:32,232 INFO [renderer.http] 192.168.1.164 - "GET /
3hours.html HTTP/1.1" 200 -
2012-04-10 14:04:08,541 ERROR [data.currentxml] Could not parse data/
wfrog-current.xml
Traceback (most recent call last):
File "/share/MD0_DATA/.qpkg/wfrog/wfrender/datasource/xmlquery.py",
line 68, in execute
dom = xml.dom.minidom.parse(self.path)
File "/opt/lib/python2.5/xml/dom/minidom.py", line 1915, in parse
return expatbuilder.parse(file)
File "/opt/lib/python2.5/xml/dom/expatbuilder.py", line 922, in
parse
fp = open(file, 'rb')
IOError: [Errno 2] No such file or directory: 'data/wfrog-current.xml'

Seems to be a similar error as this one:
http://forum.qnap.com/viewtopic.php?f=128&t=55150&start=45

Do you have any further idea?

Thanks
Johnnsy

Jordi Puigsegur Figueras

unread,
Apr 10, 2012, 9:41:49 AM4/10/12
to wfrog...@googlegroups.com
Hi,

This might be an error from the renderer that just occurs the first time wfrog is used, because the logger still has not written this file. Just give it some time and keep it running. Then, after 10 min. or more check again .

Jordi.

BTW, it is interesting to know that the USB datalogger of the Davis VantagePro2 is based on the fdti chip.

Jordi.

2012/4/10 Johnnsy <andreas...@googlemail.com>

Johnnsy

unread,
Apr 11, 2012, 3:24:53 AM4/11/12
to wfrog-users
Hi,

I let it run several hours with the same result. How can I debug
wfrog to get more details?

Johnnsy

Jordi Puigsegur Figueras

unread,
Apr 11, 2012, 4:27:27 PM4/11/12
to wfrog...@googlegroups.com
Hi,

I understand that you have problems with the logger and driver, so that is where you have to focus. How are you running wfrog? A single process or separate logger and renderer? You need to check the log of the logger part. The error you sent is from the renderer part.
 
If you are running wfrog with the wfrog command then you should have all the data in wfrog.log. You can also increase the debug level by modifying /etc/wfrog/wfrender/config/wfrog.yaml (change the first level to debug).

Please, create an issue and submit the data there. It is better than using this list.

Jordi.

2012/4/11 Johnnsy <andreas...@googlemail.com>

Johnnsy

unread,
Apr 19, 2012, 5:42:18 AM4/19/12
to wfrog-users
Hi,

I solved the problem by changing the port values. In embedded.yaml and
wfdriver.yaml instead of "port: /dev/ttyUSB0 " "port: /dev/usb/
ttyUSB0" has to be used. The same applies to the station driver
itself.

One more thing. Davis vantage pro is sending every 2 seconds a data
record. How can I configure wfrog to use only every 30th record (1min
interval)?

Thanks for your support
Johnnsy

Jordi Puigsegur Figueras

unread,
Apr 19, 2012, 3:30:02 PM4/19/12
to wfrog...@googlegroups.com
Hi, 

I am glad that you were able to solve the connection problem. The way each system handles serial ports might be different and needs to be configured.

Regarding the period. You can control the period at which wfrog writes to the database by changing the period entry in either the /etc/wfrog/wflogger/config/wflogger.yaml or  /etc/wfrog/wflogger/config/wfrog.yaml:

collector: !multi
    children:
        aggregator : !buffer
            period: 600

wfrog.yaml if you run wfrog in a single process, wflogger.yaml if you run the logger and the renderer in two separate processes.

Note two things:
- Davis Vantage Pro stations send data every 2,5 seconds
- wfrog does not discard measures. It collects the measures received from the station during the established period and then calculates averages or maximum values and writes them to the database.

Jordi.

2012/4/19 Johnnsy <andreas...@googlemail.com>

Johnnsy

unread,
Apr 20, 2012, 5:29:45 AM4/20/12
to wfrog-users
Hi,

Thanks for the info. But in fact I am looking for a possibility to
configure wfrog in that way that it polls all on the data logger
stored data e.g. every 30min or even 60min and presents them on the
dashboard. The reason behind is that for power saving reasons the HDDs
should go to standby mode and only after the selected time period new
records should be saved to the disc.

Another possibility would be to keep the complete data for a defined
time in the memory and to store it only every 30-60min.

Do you see a chance to customise the current wfrog version? Or maybe
in a later version?

Johnnsy

Jordi Puigsegur Figueras

unread,
Apr 21, 2012, 7:07:59 AM4/21/12
to wfrog...@googlegroups.com
Why don't you set up a tempfs filesystem and configure wfrog accordingly. Then just have a task that backups the file to hard disk. I think that is much easier than modifying the architecture of wfrog.

Jordi.

2012/4/20 Johnnsy <andreas...@googlemail.com>

Johnnsy

unread,
May 4, 2012, 12:54:44 PM5/4/12
to wfrog-users
Could you give me a list of files and paths which need to be modified
in case of tmpfs? I've tried a couple of them with the result that
wfrog failed completly.
Thanks

Johnnsy

Jordi Puigsegur Figueras

unread,
May 4, 2012, 5:20:24 PM5/4/12
to wfrog...@googlegroups.com
Hi,

I understand that you want to change the place where wfrog stores the CSV file. You only need to change /etc/wfrog/wfcommon/config/storage.yaml. 

First make sure you have a working wfrog and then just modify this file and restart wfrog. Everything should keep working and your CSV file will live in the tmps filesystem.


Jordi.

2012/5/4 Johnnsy <andreas...@googlemail.com>

Johnnsy

unread,
May 8, 2012, 4:58:40 AM5/8/12
to wfrog-users
Hi,

I made the changes for wfrog.csv and wfrog-current.xml and it is
working but I still have to change the path information for
- wflogger.log and
- wfrender.log.

Could you tell me which files and paths have to be changed?

Thanks
Johnnsy

Jordi Puigsegur Figueras

unread,
May 8, 2012, 9:56:59 AM5/8/12
to wfrog...@googlegroups.com
Yes,

You need to change the logs also. I forgot that. It can be done by editing the following files:

/etc/wfrog/wfcommon/config/loghandler.yaml

Change
 filename: /var/log/${process}.log

by
filename: /...path.../${process}.log

Jordi.

2012/5/8 Johnnsy <andreas...@googlemail.com>

Johnnsy

unread,
May 8, 2012, 3:37:46 PM5/8/12
to wfrog-users
Done!
Now all regularly updated files are now stored in tmpfs, the HDDs are
in energy safe mode and the weather station is up and running.
Many thanks for your support!!

Johnnsy

P.S.: Maybe I will add a webcam and a rain radar picture in future but
this will take some time.

Jean

unread,
Oct 10, 2014, 3:58:14 AM10/10/14
to wfrog...@googlegroups.com, andreas...@googlemail.com
Hello everyone!
I too would like to connect my Davis Vantage Pro 2 to the Qnap TS-112P, but reading everything you have written did not really understand what are the steps you need to do.
Can someone kindly do a step by step list of what and where to change?
And in the end what and where is it generated? A CSV file? Can attach an example?
And with that file after you can upload it to a website?
Finally ... you can save the data locally in the format "wlk" for the WeatherLink?

Sorry for the many questions but I would like to be able to load the data in a weather website, without having to take on the PC.

Thank You Very much!!!

Jordi Puigsegur Figueras

unread,
Oct 15, 2014, 11:37:09 AM10/15/14
to wfrog...@googlegroups.com, andreas...@googlemail.com
Hi Jean,

2014-10-10 9:58 GMT+02:00 Jean <barz...@gmail.com>:
I too would like to connect my Davis Vantage Pro 2 to the Qnap TS-112P, but reading everything you have written did not really understand what are the steps you need to do.
Can someone kindly do a step by step list of what and where to change?

A normal setup should be easy. Just read the "User Manual" (https://code.google.com/p/wfrog/wiki/UserManual) and choose !vantagepro2 driver when asked.
 
And in the end what and where is it generated? A CSV file? Can attach an example?

The default storage is CSV. In the Wiki you can also find instructions on how to change  the storage to a database, as well as configure other parameters like rendring, ftp upload, etc. (https://code.google.com/p/wfrog/wiki/CustomizationGuide). Everything is done via configuration files which are already prepared with commented out sections.
 
And with that file after you can upload it to a website?

Yes, You can configure wfrog to upload the web page to an ftp server. If you check the Online Stations section (https://code.google.com/p/wfrog/wiki/SupportedStations) you'll find examples of ftp stations.
 
Finally ... you can save the data locally in the format "wlk" for the WeatherLink?

No. That's the propietary format of WeatherLink. If you use wfrog you'll get your data in either CSV files or a database. Data will be open and you will have full access to it.
 

Jordi.
Reply all
Reply to author
Forward
0 new messages