This page logs my efforts at writing software to run under Linux to copy weather data from a Vantage Pro station to my WWW site. I am rather fond of a computer language named Python (as in Monty Python), and had been contemplating buying a Davis Vantage Pro Weather Station in part to offer an excuse to write more Python code. The Vantage Pro turns out to be a fine toy in that regard as I can even turn the screen backlight on and off! Don't laugh - that actually provided some useful information and exposed a couple flaws in my understanding of the protocol.
Those problems are not entirely mine. While Davis provides a document describing their protocol (it took quite a while to get similar information from Garmin about their GPS receiver protocol), their document is not well polished and simply wrong in places.
This page exists to help Davis fix errors in their document and to help other programmers trying to teach their computers to talk to their Vantage Pro.
Both the document and the protocol leave a bit to be desired. The following describe various errors in decreasing importance.
(Note the document has an extra close parenthesis. Or extra open parenthesis if you want consistancy with the time stamp calculator.) In the hex data, 0x06 replaces 0xCE, the value derived from a base year of 1900. The CRC is probably wrong too.vantageDateStamp = day + month*32 + (year-2000)*512;...and later on:-- Send the Date and Time stamp -- ><0xC6><0x06><0xA2><0x03>
With year 2000 as the base, things run much better. I guess that 1900 was the base year once upon a time but it was changed to defer a rollover problem in 66 years.
Section XIII (EEPROM Graph data locations) starts with a block of pointers, e.g. NEXT_DAY_PTR. Unfortunately the document doesn't say that they are important or what they really point to. Each set of graph data is in a 24 cell circular buffer. This is sensible, as it means logging each hour's/day's/etc data is done without copying the previous 23 values. The pointer points to the oldest data, the data next to be overwritten. On each update, the new data is stored using the pointer to index into the circular buffers and then the pointer is incremented modulo 24. To get to yesterday's data, I had to get to the daily data in the slot before the one the pointer refers to.
Once I figured out the pointers, the temperature data was still wrong. However, I quickly realized the data was too high by 90 degrees. Apparently Davis chose that to make negative temperatures fit in an unsigned byte.
In retrospect, I noticed that many of the temperature alarm data is documented as being stored with the 90 degree offset. That's several pages away from Section XIII. Section XIII merely describes the location, number, and size of each data set. Nothing describes the content, though most of it can be inferred. Python code to fetch yesterday's High/Low data is:
class yesterday: "Convert binary string to high/low temp data for yesterday." def int16(self, s): return ord(s) * 256 + ord(s) def __init__(self, arg): ptr = arg s = arg ptr = ptr - 1 if ptr < 0: ptr = ptr + 24 self.day_low_out_temp = ord(s[24*3 + ptr]) - 90 print 'low', self.day_low_out_temp self.day_high_out_temp = ord(s[0 + ptr]) - 90 print 'high', self.day_high_out_temp i = 24*4 + ptr*2 self.day_low_out_temp_time = self.int16(s[i:i+2]) i = 24*1 + ptr*2 self.day_high_out_temp_time = self.int16(s[i:i+2])
Contact Ric Werme or return to his home page.
Last updated 2003 December 27.