Serial Protocol of Weatherstations ---------------------------------- Revision: 10/1/2001 From: http://wth.berlios.de/project/station-protocol.txt See also: http://wth.berlios.de/project/SerialSnooping.html Abstract -------- This document wants to collect as complete as possible the serial protocol of weatherstations. At present time the protocol of the following stations have been included: ELV/Conrad WS2000 PC-Interface ELV PC Weather Sensor Receiver WMR918 WX200 Davis weatherstation It is emphasized, that this does _not_ include any new work what serial protocol analyzing is concerned, but is rather a collection of information available either on the internet or in other forms of publication. Introduction ------------ The serial weatherstations can mainly seperated into two different types: Bidirectional communication --------------------------- One type communicates with the computing equipment in a bidirectional mannner ie. data is sent to the computer only upon request. This could be depicted in ASCII art like: request Computer -> PC-Interface response <- The Davis weatherstations operate by bidirectional serial line communication with the WeatherLink, a piece of hardware which allows fast data transfer off the weatherstation. The WeatherLink is connected in between the computer and the weatherstation. Data in the weatherstatoin itself can also be accessed. request request Computer -> Weather -> Weather Station response Link response <- <- Unidirectional operation ------------------------ The other type of weatherstations operates unidirectional, ie. data is sent continuously or in certian periods to the serial line. The data typically consist of packets having a defined format. Computer receives PC-Interface <- data Protocol of ELV / Conrad WS2000 Electronic Weather Station(1) ---------------------------------------------------------- This information is essentially a rewrite of the published protocol for the WS2000 PC interface. Serial line initialization -------------------------- Before any data communication can take place it is necessary to initialize the serial line by toggling the modem lines a bit. Data communication ------------------ Data communication is bidirectional, ie the PC interface will _not_ send any data before not the appropriate command is sent. The PC interface will store data received by the sensors in a ring buffer. There are 8 commands available. Command Description 0 poll DCF time 1 request dataset 2 select next dataset 3 activate 9 temperature sensors 4 activate 16 temperature sensors 5 request status 6 set interval time Received data frames have the following format: Byte 1 STX 2 length ---------------------------------------------- n message ---------------------------------------------- 3 chksum 4 ETX I have tried to keep the format of the wmr918 and wx200 protocol specifications. Command 0 - Poll DCF Time --------------------------------------------------------------------- Byte Nibble Bit(s) Datum Description --------------------------------------------------------------------- sent: 1 W all SOH 2 W all 0 3 W all -sum 4 W all EOT received (7 + 4 bytes): 1' W all STX 2' W all length -------------------------------------------------- 1 Bx 0-2 day of week 1 xB 4 DCF OK 2 DD all Time Hour 0 0deg, 1 -> +/-22.5deg, 3-> +/-67.5deg) 6 BB 0-6 W4 - upper 7 bits of wind direction 7 BB 0-6 W5 - lower 7 bits of wind direction 8 W all ETX, = 03h = end byte W1 and W2 form a 14bit binary value of wind speed in units of 0.1 km/h (i.e. 123 is 12.3 km/h) W4 and W5 form a 14 bit binary value of wind direction in degree. Type 0x40 - 0x47 - indoor sensor V1.1, address 0 to 7 Type 0x48 - 0x4f - indoor sensor V1.2, address 0 to 7 --------------------------------------- Byte Nibble Bits Description --------------------------------------- 1 W all STX, = 02h = start byte 2 W all 0x40-0x47, 0x48-0x4f 3 BB 0-6 W1 - upper 7 bits of temperature 4 BB 0-6 W2 - lower 7 bits of temperature 5 BB 0-6 W3 - humidity 6 BB 0-6 W4 - upper 7 bits of air pressure 7 BB 0-6 W5 - lower 7 bits of air pressure 8 W all ETX, = 03h = end byte W1 and W2 ard added to a signed 14bit binary value W4 and W5 are added to form un unsigned 14 bit binary value of air pressure in hPa Type 0x58 - 0x5f - brightness sensor V1.2, address 0 to 7 --------------------------------------- Byte Nibble Bits Description --------------------------------------- 1 W all STX, = 02h = start byte 2 W all 0x40-0x47, 0x48-0x4f 3 BB 0-6 W1 - upper 7 bits of brightness 4 BB 0-6 W2 - lower 7 bits of brightness 5 xB 0-1 W3 - multiplication factor, (x1, x10, x100, x1000) 6 xx W4 - unused 7 xx W5 - unused 8 W all ETX, = 03h = end byte W1 and W2 ard added to a unsigned 14bit binary value, which multiplicated by W3, give an equivalent of brightness Type 0x68 - 0x6f - pyranometer sensor V1.2, address 0 to 7 --------------------------------------- Byte Nibble Bits Description --------------------------------------- 1 W all STX, = 02h = start byte 2 W all 0x40-0x47, 0x48-0x4f 3 BB 0-6 W1 - upper 7 bits of solar radiation power 4 BB 0-6 W2 - lower 7 bits of solar radiation power 5 xB 0-1 W3 - multiplication factor, (x1, x10, x100, x1000) 6 xx W4 - unused 7 xx W5 - unused 8 W all ETX, = 03h = end byte W1 and W2 ard added to a unsigned 14bit binary value, which multiplicated by W3, give an equivalent of solar radiation power. Protocol of Radio Shack WX200 Electronic Weather Station(3) ----------------------------------------------------------- Blank entries indicate undefined or unknown data. This information may be freely distributed. The Radio Shack WX200 sends data unidirectional, i.e. w/o request from an external source data are put onto the serial line. Each data frame has a 1 byte header to identy its type. There are 5 different serial dataframes, which are grouped as follows: Group Info Group Length Report Contents Number (Bytes) Intervl Summary 8F 35 10 Sec Time, Humidity 9F 34 10 Sec Temperature AF 31 10 Sec Barometer, Dew Point BF 14 10 Sec Rain CF 27 5 Sec Wind, Wind Chill, General Group 8 - Time and Humidity received 35 bytes ------------------------------------------------------------------------------------ Byte Nibble Bit(s) Datum Description 'part' of lo % 10 DD all Humid Indoor Hi: Minute 11 DD all Humid Indoor Hi: Hour 12 DD all Humid Indoor Hi: Day 13 Dx all Humid Indoor Lo: 'b' % 13 xH all Humid Indoor Hi: Month 14 Dx all Humid Indoor Lo: Minute 'b' of 14 xD all Humid Indoor Lo: 'a' of % 15 Dx all Humid Indoor Lo: Hour 'b' of 15 xD all Humid Indoor Lo: Minute 'a' of 16 Dx all Humid Indoor Lo: Day 'b' of 16 xD all Humid Indoor Lo: Hour 'a' of 17 Hx all Humid Indoor Lo: Month 17 xD all Humid Indoor Lo: Day 'a' of 18 DD all Humid Indoor Alarm Hi: % 19 DD all Humid Indoor Alarm Lo: % 20 DD all Humid Outdoor: 10 % 22 DD all Humid Outdoor Hi: Minute 23 DD all Humid Outdoor Hi: Hour 24 DD all Humid Outdoor Hi: Day 25 Dx all Humid Outdoor Lo: 'b' of % 25 xH all Humid Outdoor Hi: Month 26 Dx all Humid Outdoor Lo: Minute 'b' of 26 xD all Humid Outdoor Lo: 'a' of % 27 Dx all Humid Outdoor Lo: Hour 'b' of 27 xD all Humid Outdoor Lo: Minute 'a' of 28 Dx all Humid Outdoor Lo: Day 'b' of 28 xD all Humid Outdoor Lo: Hour 'a' of 29 Hx all Humid Outdoor Lo: Month 29 xD all Humid Outdoor Lo: Day 'a' of 30 DD all Humid Outdoor Alarm Hi: % 31 DD all Humid Outdoor Alarm Lo: % 32 Bx 0 Humid Outdoor: O.R. (out of range) = 1 32 Bx 1 32 Bx 2 Humid Indoor Hi: O.R. = 1 32 Bx 3 Humid Indoor: O.R. = 1 32 xB 0-2 32 xB 3 Humid Outdoor Hi: O.R. = 1 33 Bx 0,1 Humid Humidity Outdoors Alarm Set when both bits = 1 33 Bx 2,3 Humid Humidity Indoors Alarm Set when both bits = 1 33 xB 0-2 33 xB 3 Time Alarm Set = 1 34 HH all Cksum Unsigned sum of first 34 bytes Group 9 - Temperature received: 34 Bytes ------------------------------------------------------------------------------------ Byte Nibble Bit(s) Datum Description 'part' of lo C 2 xB 0-2 Temp Indoor: 'a' of C 2 xB 3 Temp Indoor: Sign 0=+, 1=- 3 BD 0-2,all Temp Indoor Hi: 'ab' of C 3 Bx 3 Temp Indoor Hi: Sign 0=+, 1=- 4 DD all Temp Indoor Hi: Minute 5 DD all Temp Indoor Hi: Hour 6 DD all Temp Indoor Hi: Day 7 Dx all Temp Indoor Lo: 'c' of C 7 xH all Temp Indoor Hi: Month 8 BD 0-2,all Temp Indoor Lo: 'ab' of C 8 Bx 3 Temp Indoor Lo: Sign 0=+, 1=- 9 DD all Temp Indoor Lo: Minute 10 DD all Temp Indoor Lo: Hour 11 DD all Temp Indoor Lo: Day 12 Dx all Temp Indoor Alarm Hi: 'c' of 32 F 13 Bx 1-3 14 DD all Temp Indoor Alarm Lo: 'bc' of 32 F 15 xB 1-3 16 DD all Temp Outdoor: 'bc' of -40 C 17 xB 0-2 Temp Outdoor: 'a' of C 17 xB 3 Temp Outdoor: Sign 0=+, 1=- 18 BD 0-2,all Temp Outdoor Hi: 'ab' of C 18 Bx 3 Temp Outdoor Hi: Sign 0=+, 1=- 19 DD all Temp Outdoor Hi: Minute 20 DD all Temp Outdoor Hi: Hour 21 DD all Temp Outdoor Hi: Day 22 Dx all Temp Outdoor Lo: 'c' of C 22 xH all Temp Outdoor Hi: Month 23 BD 0-2,all Temp Outdoor Lo: 'ab' of C 23 Bx 3 Temp Outdoor Lo: Sign 0=+, 1=- 24 DD all Temp Outdoor Lo: Minute 25 DD all Temp Outdoor Lo: Hour 26 DD all Temp Outdoor Lo: Day 27 Dx all Temp Outdoor Alarm Hi: 'c' of -40 F 28 Bx 1,2 28 Bx 3 Temp Outdoor Alarm Hi: Sign 0=+, 1=- 29 DD all Temp Outdoor Alarm Lo: 'bc' of F 30 Bx all 30 xB 0 Temp Outdoor Alarm Lo: 'a' of F 30 xB 1,2 30 xB 3 Temp Outdoor Alarm Lo: Sign 0=+ 1=- 31 BB all 32 Bx 0,1 Temp Temp Outdoors Alarm Set when both bits=1 32 Bx 2,3 Temp Temp Indoors Alarm Set when both bits=1 32 xB all 33 HH all Cksum unsigned sum of first 33 bytes Group A - Barometer, Dew Point received: 31 Bytes ------------------------------------------------------------------------------------ Byte Nibble Bit(s) Datum Description 'part' of lo mb 3 DD all Barom SeaLevel: 'de' of 795 mb 5 Bx 0,1 Barom Format: 0=inches, 1=mm, 2=mb, 3=hpa 5 Bx 2,3 5 xD all Barom SeaLevel: 'a' of mb 6 Bx 0-2 Barom Trend: 1=Raising, 2=Steady, 4=Falling 6 Bx 3 6 xB all Barom Prediction: 1=Sunny, 2=Cloudy, 4=Partly, 8=Rain 7 DD all Dewpt Indoor: 0 C 9 DD all Dewpt Indoor Hi: Minute 10 DD all Dewpt Indoor Hi: Hour 11 DD all Dewpt Indoor Hi: Day 12 Dx all Dewpt Indoor Lo: 'b' of C 12 xH all Dewpt Indoor Hi: Month 13 Dx all Dewpt Indoor Lo: Minute 'b' of 13 xD all Dewpt Indoor Lo: 'a' of C 14 Dx all Dewpt Indoor Lo: Hour 'b' of 14 xD all Dewpt Indoor Lo: Minute 'a' of 15 Dx all Dewpt Indoor Lo: Day 'b' of 15 xD all Dewpt Indoor Lo: Hour 'a' of 16 Hx all Dewpt Indoor Lo: Month 16 xD all Dewpt Indoor Lo: Day 'a' of 17 Hx all Dewpt Outdoor Alarm: 0=1 C ... F=16 C 17 xH all Dewpt Indoor Alarm: 0=1 C ... F=16 C 18 DD all Dewpt Outdoor: 0 C 20 DD all Dewpt Outdoor Hi: Minute 21 DD all Dewpt Outdoor Hi: Hour 22 DD all Dewpt Outdoor Hi: Day 23 Dx all Dewpt Outdoor Lo: 'b' of C 23 xH all Dewpt Outdoor Hi: Month 24 Dx all Dewpt Outdoor Lo: Minute 'b' of 24 xD all Dewpt Outdoor Lo: 'a' of C 25 Dx all Dewpt Outdoor Lo: Hour 'b' of 25 xD all Dewpt Outdoor Lo: Minute 'a' of 26 Dx all Dewpt Outdoor Lo: Day 'b' of 26 xD all Dewpt Outdoor Lo: Hour 'a' of 27 Hx all Dewpt Outdoor Lo: Month 27 xD all Dewpt Outdoor Lo: Day 'a' of 28 Bx 0 Dewpt Outdoor Lo: O.R. = 1 28 Bx 1 28 Bx 2 Dewpt Outdoor: O.R. = 1 28 Bx 3 Dewpt Indoor Lo: O.R. = 1 28 Bx 0 28 Bx 1 Dewpt Indoor: O.R. = 1 28 Bx 2,3 29 Bx 0 29 Bx 1,2 Dewpt In and Out Alarm Set when both bits=1 29 Bx 3 Barom Alarm Set = 1 29 xH all Barom Alarm: 0=1mb ... F=16mb 30 HH all Cksum unsigned sum of first 30 bytes Group B - Rain Received: 14 Bytes ------------------------------------------------------------------------------------ Byte Nibble Bit(s) Datum Description 'part' of lo mm/hr 3 DD all Rain Yesterday: 'cd' of 0 mm 5 DD all Rain Total: 'cd' of mm 6 DD all Rain Total: 'ab' of mm 7 DD all Rain Reset: Minute 8 DD all Rain Reset: Hour 9 DD all Rain Reset: Day 10 Bx 0 10 Bx 1 Rain Format: 0=mm, 1=inches 10 Bx 2,3 10 xH all Rain Reset: Month 11 DD all Rain Alarm: 'bc' of 0 in/hr 13 HH all Cksum Unsigned sum of first 13 bytes Group C - Wind, Wind chill received: 27 Bytes ------------------------------------------------------------------------------------ Byte Nibble Bit(s) Datum Description 'part' of lo m/s 3 DD all Wind Gust Dir: 'ab' of 4 DD all Wind Avg Speed: 'bc' of 0 5 xD all Wind Avg Speed: 'a' of m/s 6 DD all Wind Avg Dir: 'ab' of 7 DD all Wind Hi Speed: 'bc' of m/s 8 Dx all Wind Hi Dir: 'c' of 8 xD all Wind Hi Speed: 'a' of m/s 9 DD all Wind Hi Dir: 'ab' of 10 DD all Wind Hi: Minute 11 DD all Wind Hi: Hour 12 DD all Wind Hi: Day 13 Dx all Wind Alarm: 'c' of 0 mph 15 Bx 1 15 Bx 2,3 Wind Format: 0=mph, 1=knots, 2=m/s, 3=kph 15 xB all 16 DD all Chill Temp: -85 C 18 DD all Chill Lo: Minute 19 DD all Chill Lo: Hour 20 DD all Chill Lo: Day 21 Bx 0 Chill Lo: Sign 0=+, 1=- 21 Bx 1 Chill Temp: Sign 0=+, 1=- 21 Bx 2,3 21 xH all Chill Lo: Month 22 DD all Chill Alarm: 'bc' of -121 F 23 Bx 1 23 Bx 2 General Power Source 0=AC, 1=DC 23 Bx 3 General Low Battery Indicator = 1 23 xB 0-2 23 xB 3 Chill Alarm: Sign 0=+, 1=- 24 Bx 0-2 General Display Selected: 0=Time, 1=Temp ... 7=Rain 24 Bx 3 24 xB 0,1 General Display Subscreen: 0=first ... 3=fourth 24 xB 2,3 General Display: 0=main, 1=mem, 2=alarm.in, 3=alarm.out 25 Bx 0 25 Bx 1 Wind Hi Speed: O.R. = 1 25 Bx 2 Wind Avg Speed: O.R. = 1 25 Bx 3 Wind Gust Speed: O.R. = 1 25 xB 0 25 xB 1 Chill Alarm Set = 1 25 xB 2 Wind Alarm Set = 1 25 xB 3 26 HH all Cksum Unsigned sum of first 26 bytes ====================================================================== Nibble Column: D-> 4 bit decimal number Range: 0-9 H-> 4 bit hex number Range: 0-15 B-> Bit encoded value Range: Variable x-> Not defined in this entry Bits Column: Bits within defined Nibbles 0 - Lo order 3 - Hi order General: All data is sent in the units shown and is independent of the units selected. Data is sent 9600 baud 8n1. Sensors that are not functioning or are out of range will return 'EE' as the measurement. Cksum: The last byte in each group is a checksum of that group. It is calculated by performing an unsigned add of all the bytes in the group, including the group number but not the checksum byte. The checksum is the lo-order byte of the sum. Protocol of the WMR918 weather Station(4) ----------------------------------------- Data communication w/ the WMR918 weather station is unidirectional. i.e. the data frames are put on the serial line by the station. Each packet starts with two binary bytes of 0xFF. Each packet ends with a checksum. The type of packet is given by the third byte, and ranges from 0x00 through 0x0f. Each type of packet has a predetermined length. For example, a typical type 5 packet looks like: ff ff 05 00 09 02 47 09 dc 0c 50 79 0f The checksum is the simple addition of each byte in the packet, excluding the checksum byte, keeping only the lowest 8 bits. In all further examples, the leading "ff ff" will be omitted. The .tab output from wmr918d omits the leading "ff ff". The known packet types are: 00 - anemometer and wind related data 01 - rain guage 02 - extra sensors 03 - outside temp, humidity and dewpoint 04 - unknown 05 - inside temp, humidity, dewpoint, and baro. 06 - inside temp, humidity, dewpoint, baro for wmr968 and some wmr918's. 07 - unknown 08 - unknown 09 - unknown 0a - unknown 0b - unknown 0c - unknown 0d - unknown 0e - sequence number 0f - hourly status report The following description will attempt to use the same format as the WX200 listing by Mike Wingstrom. H is a hex digit from 0 to f. D is a decimal digit from 0 through 9. B is bit encoded, bit 3 is the high bit (0x8). Type 00 - anemometer and wind related data Byte Nibble Bit Meaning 1' W all FF 2' W all FF 0 W all 00 Anemometer data packet 1 Bx Battery status. Higher value == lower battery volt 1 xB Unknown 2 DD Gust direction, bc of 0. 9 DD Sea level reference, ab of . Add this to raw bp from byte 6 to get sea level pressure. Example: 05 00 11 02 46 09 dc 0c 50 79 16 Example: 21.1 Celsius, 46% humidity, dew point 9 Celsius BP 1015 mb, sea level pressure 1015 mb. Type 06 - inside temp, humidity, dewpoint baro for wmr968 and some wmr918's Byte Nibble Bit Meaning 1' W all FF 2' W all FF 0 W all 06 : Inside sensor data 1 Bx Battery status. Higher value == lower battery volt 1 xB Unknown 2 DD Inside temp, bc of -?. 9 DD Sea level reference, cd of . 10 DD Sea level reference, ab of Add this to raw bp from byte 6 and 7 to get sea level pressure. Example: 06 00 29 02 41 09 8b 61 90 33 06 2e Example: 22.9 Celsius, 41% humidity, dew point 9 Celsius BP 995 mb, sea level pressure 1028.9 mb. Type E - sequence number Byte Nibble Bit Meaning 1' W all FF 2' W all FF 0 W all 0e : Sequence number packet 1 Bx Status, high bit, battery for main unit 1 DD After removing high bit, minute chime Example: 0e 81 8d Example: status = 1, time is hh:01 Type F - hourly status report Byte Nibble Bit Meaning 1' W all FF 2' W all FF 0 W al 0f : Hour Chime 1 BB Status. High bit == battery low 2 DD Hour 3 DD Day 4 DD Month 5 DD Year Example: 0f 80 07 09 03 00 a0 Example: It's 7AM, 9-March-2000, do you know where your weather station is? Protocol of Davis Weatherstations (5) ------------------------------------- The Davis weatherstations communicate in a bidirectional manner with the computer. The stations are connected thru a WeatherLink interface to the computer. The computer requests data and receives responses of the WeatherLink which contain data stored in the WeatherLink or in the weatherstation. Memory of the Davis WeatherLink and weatherstation -------------------------------------------------- Memory is organized into several distinct areas Memory Description station memory 512 nibbles link memory 512 nibbles archive memory 32K weather data store for PC download sensor image latest sensor data, part of link memory archive image scratch memory for intermediate store of entries of archive memory The following commands are available: Command Description DMP Transfer the contents of the archive memory using the XMODEM CRC protocol. MDMP Dumps an image of Station processor memory to the serial port. This command is only available on the GroWeather, Energy, and Health Links. LOOP 65536-n Send 'n' packets of weather data (sensor image) from the WeatherLink. RRD bank address n-1 Read 'n' (1-8) nibbles from the link memory from 'address' in 'bank'. RWR bank | n-1 address data Write 'n' (1-8) nibbles of 'data' into the link memory at 'address' in 'bank.' SRD address n-1 Read 'n' bytes of archive memory beginning at 'address.' Both 'address' and 'n-1' are 16 bit numbers. SWR address data Write 'data' (one byte) to 'address' (2 bytes) in archive memory. WRD n | bank address Read 'n' (1-8) nibbles of data from the station memory starting at 'address' For a bank 0 use 'bank' = 2, for a bank 1 use 'bank' = 4. WWR n | bank address data Write 'n' (1-8) nibbles of data to the station memory starting at 'address' For bank 0 use 'bank' = 1, for bank 1 use 'bank' = 3. SAP n Set the archive interval to 'n' minutes. 'n' is one byte. SSP 256-n Set the time interval between samples of the sensor image to 'n' seconds. 'n' is one byte. The maximum number of samples in an interval is 255. STOP Tell the WeatherLink to stop updating the sensor image and archiving. START Tell the WeatherLink to begin updating the sensor image and archiving data. This command is only needed if you have previously sent a stop command. ARC Force a write to archive memory. IMG Force a sampling of the sensor image. DBT Disable the archive timer. EBT Enable the archive timer. CRC0 Disable CRC command checking for Rev E links. CRC1 Enable CRC command checking for Rev E links. ====================================================================== Legend ------ Nibble Column: W-> 8 bit byte D-> 4 bit decimal number Range: 0-9 (BCD Format) H-> 4 bit hex number Range: 0-15 B-> Bit encoded value Range: Variable x-> Not used for this data entry Bits Column: Bits within defined Nibbles 0 - Lo order 3 - Hi order Serial line setup ----------------- ws2000 (ELV, CONRAD) Data is sent 9600 baud, 8E2 ELV PC weather sensor receiver Data is sent 19200 Baud, 8O2 wmr918 Data is sent 9600 baud, 8N1 wx200 Data is sent 9600 baud 8N1. Davis WeatherLink data is sent 8N1. Baudrate ? References ---------- (1) available as hardcopy manual with purchase of ELV/Conrad PC Interface downloadable from www.conrad.de website (2) published in ELV Journal 6/2000 (3) Contributors: Mike Wingstrom (Most of the hard work) Glynne Tolar (alarms and misc.) Tim Witham - FES (listing format, fixing of errors and misc.) (4) John Stanley, stanley@peak.org with the help of: John R. Covert Brad and Stephanie Grant Giovanni BOGLIONE Alan K. Jackson Roy (garlic) Krenn Werner Steven Danz Barry Newton (5) available as download from Davis website: refer to document techref.txt