I've created a tutorial on getting a Davis Vantage Vue running with:
WeeWX
A non-logging serial cable
Ubuntu Linux
MySQL
Hopefully this can help some other folks out along the way!
Up to date tutorial link:
__http://www.blueskybust.com/homewx.html__
Original contents copied to this post… sorry for the poor formatting.
Updated 11/2012
I wanted to get a Davis Vantage Vue on the Internet. Since I already have an Ubuntu Linux PC running 24 hours a day, this is where I chose to send the data from the station. The Davis product to interface with a PC, called WeatherLink, only contains software for Macs or Windows. Essentially, you spend $100+ for a serial cable and software you throw away.
Fortunately, community grown solutions exist to do this for much cheaper. Through Google I found a homebew serial cable to interface between the Davis console and the Ubuntu PC. This cable can be found by googling for SLOweather and Davis serial cable. I got my for around $30. There are two kinds for purchase, a serial cable, and a USB interface. I have read that the serial interface is rock solid compared to the USB interface, and since my PC has a serial port, I went with that.
Prerequisite steps:
Disclaimer: I found that some things needed to be run as sudo to work on Ubuntu, or that certains files couldn't be edited because I wasn't logged in as 'weewx'. My quick fixes are to change the permissions of those files to 777, and to run a lot of stuff as sudo. It works to get things going. I know it's not the secure way to do things.
Install the program minicom on Ubuntu:
sudo apt-get install minicom
Find your serial port identified in the device list with this command:
dmesg | grep ttyS
For me, this returned the information of:
[ 0.510838] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 0.532564] 00:08: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
The serial port device to use based on this is ttyS0.
sudo minicom -s
Go to the menu option Serial port setup.
Change setting of “Serial Device” to be what was in the previous step, with /dev/ prepended.
Example: /dev/ttyS0
Change setting of “Bps/Par/Bits” to:
Speed: 19200
Parity: None
Stopbits: 8-N-1
When done, save the config on the first menu with Save setup as dfl.
Start minicom with:
sudo minicom
When it starts, type TEST in all capitals. You wont be seeing what you are typing. If the word TEST is replied back, then it works.
Next, type LOOP in all caps. You should see gibberish characters come across. This is the weather data being sent. Exit the command with Ctrl-C.
You have now verified that the console is sending data to the Ubuntu PC.
WeeWx can decode the data and generate useful graphs and HTML pages with it. It also stores the data in a MySQL database, and can post the data to internet sites.
I downloaded the latest version using wget, which was weewx-2.0.2.tar.gz:
wget __http://sourceforge.net/projects/weewx/files/weewx-2.0.2.tar.gz/download__
Open the quick guide setup steps here. It's titled for Debian but works on Ubuntu:
__http://www.weewx.com/docs/debian.htm__
Follow the Prerequisite install steps as is.
Follow the Installing section as is.
For the “Configure” section: Edit the configuration file (I use vi, use what you like):
sudo chmod 777 /home/weewx/weewx.conf
vi /home/weewx/weewx.conf
Here are the changes I made to work with the SLOWeather serial cable and mysql:
Enable debugging. You may need it, so it doesn't hurt. You can turn it back to 0 after everything is working.
debug = 1
In the [Station] section:
location = (enter any text you want to describe your location)
latitude = (your stations latitude)
longitude = (your stations longitude)
altitude = (your stations altitude, foot) ( Example: altitude=654,foot )
station_type = Vantage (I think this was the default, but it's important to verify)
In the [Vantage] section:
port = (Use the /dev/ttyS0 entry you found when testing with mini com)
Ex: port = /dev/ttyS0
In the [StdReport] section:
HTML_ROOT = public_html
(Since I run a web server on the same Ubuntu box, I changed this from public_html to a path like /var/www/myserver/myweather. You can just keep it at public_html for initial testing and change it later if it needs to go to another directory.)
In the [StdArchive] section:
Change the entries so it uses mysql:
archive_database = archive_mysql
stats_database = stats_mysql
record_generation = software
I needed to change record_generation to software in order for it to work with the SLOweather serial cable. I think it's because the cable doesn't store records itself.
Nothing else needs to change in the config file. I used the default username and password listed in the archive_mysql and stats_mysql sections of weewx / weewx.
This didn't exist on my installation, so create it:
sudo mkdir /home/weewx/public_html
sudo chmod 777 /home/weewx/public_html
Start the mysql client:
mysql -u root -p
(Enter your root password for mysql. Can't help you here)
CREATE USER 'weewx'@'localhost' IDENTIFIED BY 'weewx.;
GRANT select, update, create, insert, delete on weewx.* to weewx@localhost;
GRANT select, update, create, insert, delete on stats.* to weewx@localhost;
quit
sudo /home/weewx/bin/weewxd.py /home/weewx/weewx.conf
If things are working, you'll see data being printed to your window.
If nothing shows after 15 seconds or so, exit using Ctrl-C and then check the weewx debug output in the syslog:
grep weewx /var/log/syslog | more
If it's working ok too, do Ctrl-C to stop weewx.
Run this command again, but as the weewx user instead of root:
mysql -u weewx -p
(Enter password of weewx, which you probably created above as 'weewx')
use stats;
select * from outTemp;
You should see a record or two in the tables here, like this:
+————+——+————+——+————+——————+——-+
| dateTime | min | mintime | max | maxtime | sum | count |
+————+——+————+——+————+——————+——-+
| 1353736800 | 27.2 | 1353819100 | 28.8 | 1353822986 | 986.258918640156 | 35 |
| 1353823200 | 27.5 | 1353862112 | 30.6 | 1353830478 | 4726.0591897815 | 164 |
+————+——+————+——+————+——————+——-+
2 rows in set (0.00 sec)
If you don't see aything, then something isn't set up right with the mysql logging. Type quit and check the weewx syslog with:
grep weewx /var/log/syslog | more
If you saw a record, chances are the archive database is working too. From still in mysql:
use weewx;
select * from archive;
You should see one or more records listed. If you don.t, it may just be that weewx wasn.t running for 5 minutes before we stopped the initial test. If weewx is running later for 15+ minutes and you still see nothing in here, check the weewx debug syslog:
grep weewx /var/log/syslog | more
type quit to exit mysql
You should also be seeing files generated in the public_html directory. Open a few of the .html files with your web browser to check.
Now that it.s all working, let.s set it up so weewx starts on system startup, and that it uses the familiar init.d start and stop functions.
sudo cp /home/weewx/start_scripts/Debian/weewx /etc/init.d/
sudo chmod +x /etc/init.d/weewx
sudo update-rc.d weewx defaults 98
Now you can start and stop weewx with:
sudo /etc/init.d/weewx start
sudo /etc/init.d/weewx stop
sudo /etc/init.d/weewx restart
Remember to turn off debugging with debug=0 in the weewx.conf file if you want, and then restart weewx.
To see the generated files on your local computer, use any browser and bring up page
/home/weewx/public_html/index.html
If you want to see it from another machine in your home network, you will have to use a webserver, such as Apache. How to do this is way beyond the purview of weewx, but briefly
sudo apt-get install apache2
Then edit the file /etc/apache2/sites-available/default to include a section:
Alias /weewx /home/weewx/public_html
<Directory “/home/weewx/public_html”>
Order allow,deny
Allow from all
</Directory>
Then restart apache
sudo service apache2 restart
You should then be able to see the generated HTML pages from any machine on your local network at __http://your-machine-name/weewx/index.html__