WXforum.net

Weather Station Hardware => Davis Instruments Weather Stations => Topic started by: iBangkok24 on January 30, 2013, 10:11:00 AM

Title: DIY "GREEN DOT" Data Logger
Post by: iBangkok24 on January 30, 2013, 10:11:00 AM
I have every thing I need, so I try to program the security registry. The problem is, it seem like I can't program it. Please have a look at my terminal capture below

Quote
SPI>[0x9f r:4]   <<< Check If I have a good SPI communication
/CS ENABLED
WRITE: 0x9F
READ: 0x1F 0x22 0x00 0x00
/CS DISABLED
SPI>[0x77 0 0 0 r:128]   <<< Read in the security register
/CS ENABLED
WRITE: 0x77
WRITE: 0x00
WRITE: 0x00
WRITE: 0x00
READ: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
 0xFF 0x0B 0x02 0x0E 0x05 0x3A 0x30 0x1F 0x22 0x00 0x00 0x5E 0x00 0xFF 0xFF 0xBC
 0xFF 0x30 0x30 0x4D 0x32 0x36 0x36 0x39 0x38 0x07 0x5E 0x2D 0xFF 0xFF 0xFF 0xFF
 0xFF 0x43 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
 0xFF
/CS DISABLED
SPI>[0x9b 0x00 0x00 0x00 0x80 0x2D 0x22 0x6F 0x52 0x6F 0x98 0xA9 0x21 0x25 0x5E
0x2D 0x2D 0x31 0xD2 0x39   <<< Security register write start here
/CS ENABLED
WRITE: 0x9B
WRITE: 0x00
WRITE: 0x00
WRITE: 0x00
WRITE: 0x80
WRITE: 0x2D
WRITE: 0x22
WRITE: 0x6F
WRITE: 0x52
WRITE: 0x6F
WRITE: 0x98
WRITE: 0xA9
WRITE: 0x21
WRITE: 0x25
WRITE: 0x5E
WRITE: 0x2D
WRITE: 0x2D
WRITE: 0x31
WRITE: 0xD2
WRITE: 0x39
SPI>0x18 0x1C 0x63 0x0C 0x31 0x21 0x2D 0x39 0x90 0xDE 0x94 0x6F 0x6B 0x77 0x73 0
x7F 0x63 0x8C 0x88 0x84 <<< I have to break it in to many line because I can't copy/paste the whole data in
WRITE: 0x18
WRITE: 0x1C
WRITE: 0x63
WRITE: 0x0C
WRITE: 0x31
WRITE: 0x21
WRITE: 0x2D
WRITE: 0x39
WRITE: 0x90
WRITE: 0xDE
WRITE: 0x94
WRITE: 0x6F
WRITE: 0x6B
WRITE: 0x77
WRITE: 0x73
WRITE: 0x7F
WRITE: 0x63
WRITE: 0x8C
WRITE: 0x88
WRITE: 0x84
SPI>0x80 0x9C 0x98 0x94 0x90 0xAD 0xA9 0xA5 0xA1 0xBD 0xB9 0xB5 0xB1 0xCA 0xCE 0
xC2 0xC6 0xDA 0xDE 0xD2
WRITE: 0x80
WRITE: 0x9C
WRITE: 0x98
WRITE: 0x94
WRITE: 0x90
WRITE: 0xAD
WRITE: 0xA9
WRITE: 0xA5
WRITE: 0xA1
WRITE: 0xBD
WRITE: 0xB9
WRITE: 0xB5
WRITE: 0xB1
WRITE: 0xCA
WRITE: 0xCE
WRITE: 0xC2
WRITE: 0xC6
WRITE: 0xDA
WRITE: 0xDE
WRITE: 0xD2
SPI>0xD6 0xEB 0xEF 0xE3 0xE7 0xFB 0xFF 0xF3] <<< finish write the security register
WRITE: 0xD6
WRITE: 0xEB
WRITE: 0xEF
WRITE: 0xE3
WRITE: 0xE7
WRITE: 0xFB
WRITE: 0xFF
WRITE: 0xF3
/CS DISABLED
SPI>[0xd7 r]
/CS ENABLED
WRITE: 0xD7
READ: 0x8C
/CS DISABLED
SPI>[0x77 0 0 0 r:128] <<< read it back in.... nothing change!!!
/CS ENABLED
WRITE: 0x77
WRITE: 0x00
WRITE: 0x00
WRITE: 0x00
READ: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
 0xFF 0x0B 0x02 0x0E 0x05 0x3A 0x30 0x1F 0x22 0x00 0x00 0x5E 0x00 0xFF 0xFF 0xBC
 0xFF 0x30 0x30 0x4D 0x32 0x36 0x36 0x39 0x38 0x07 0x5E 0x2D 0xFF 0xFF 0xFF 0xFF
 0xFF 0x43 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
 0xFF
/CS DISABLED
SPI>

Am I doing something wrong?
Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on January 30, 2013, 07:51:26 PM
Am I doing something wrong?


If it isn't working, then you are certainly doing something wrong.  Don't know what though.

Have you tried more than once to program the security register?  You only get one chance to get it right.  If you screw up by not getting it just right the first time, you've got to throw the chip away and try again on a new one. 

I would suggest trying something simpler like a page write (http://dangerousprototypes.com/docs/AT45DB041D_4Mbit_flash_memory#Page_write) and get that working first before trying again on a new chip.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: iBangkok24 on January 30, 2013, 08:16:47 PM
Am I doing something wrong?


If it isn't working, then you are certainly doing something wrong.  Don't know what though.

Have you tried more than once to program the security register?  You only get one chance to get it right.  If you screw up by not getting it just right the first time, you've got to throw the chip away and try again on a new one. 

I would suggest trying something simpler like a page write (http://dangerousprototypes.com/docs/AT45DB041D_4Mbit_flash_memory#Page_write) and get that working first before trying again on a new chip.

I think you right DeKay. I try several thing before programming the security register, but the first time I try to write it I got so many problem, forgot to add 0x before all digit of data, copy/paste without luck. Maybe I just accidentally write nothing in that register in the first attempt. Will try it with a new one.

Thanks,
Title: Re: DIY "GREEN DOT" Data Logger
Post by: iBangkok24 on January 30, 2013, 08:24:51 PM
The Logger sit and working nicely in my "NON Green Dot" VUE console. I will make a new one as soon as I got more PCB in hand.

(http://i903.photobucket.com/albums/ac239/55ting55/2013-01-31080624_zpsfed47102.jpg)

(http://i903.photobucket.com/albums/ac239/55ting55/2013-01-31080609_zps12408cbc.jpg)

(http://www.wxforum.net/index.php?action=dlattach;topic=10721.0;attach=9119;image)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Bushman on January 30, 2013, 09:05:25 PM
So you built your own logger with Xbee communication?  Sweet.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: iBangkok24 on January 30, 2013, 09:37:04 PM
So you built your own logger with Xbee communication?  Sweet.

Actually I just follow af4ex from this link http://www.wxforum.net/index.php?topic=10721.25 and DeKay from his block by this link http://madscientistlabs.blogspot.com/2011/01/davis-weatherlink-software-not-required.html and this link http://madscientistlabs.blogspot.com/2011/10/build-your-own-davis-console-datalogger.html
Title: Re: DIY "GREEN DOT" Data Logger
Post by: iBangkok24 on February 01, 2013, 08:04:28 AM
While I'm waiting for more PCB to arrive. Today I put my bus pirate in SPI Sniffer mode and this is what happen when I power up a "GREEN DOT" Vue console

Quote

SPI>(1)
Sniffer
Any key to exit
[0x6B(0xFF)0x80(0xC6)][0x3B(0x7F)0x80(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0x
FF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0x
FF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0x
FF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0x
FF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0x
FF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0x
FF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0x
FF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0x
FF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0x85)0x00(0x
81)0x00(0x07)0x00(0x02)0x00(0x9D)0x00(0x18)0x00(0x0F)0x00(0x91)0x00(0x00)0x00(0x
00)0x00(0x2F)0x00(0x00)0x00(0x7F)0x00(0xFF)0x00(0xDE)0x00(0x7F)0x00(0x98)0x00(0x
18)0x00(0x26)0x00(0x99)0x00(0x1B)0x00(0x1B)0x00(0x1C)0x00(0x9C)0x00(0x03)0x00(0x
AF)0x00(0x16)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xA1)0x00(0x
FF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0x
FF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0x
FF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0x
FF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)0x00(0xFF)]

As I understand, the console try to wirte 0x6B and 0x80 to the chip. and then 0x3b 0x80 0x00 0x00 then read in 128 byte of data. I try to find out what 0x6B 0x80 command is with no luck, I neither can't find anything with 0x3B 0X80 0X00 0X00.

Any Idea?
Title: Re: DIY "GREEN DOT" Data Logger
Post by: rdsman on February 01, 2013, 01:56:51 PM
I am not familiar with your test equipment, but it looks to me like the trigger point is too slow or the sampling rate is off (or both).  If I take the following sequence:

0x6B(0xFF)0x80(0xC6)

convert it to 32 bits:

0x6BFF80C6

Shifted 1 bit to the left, it becomes:

0xD7FF018C

This comes real close to reading the Status Register and getting a valid response.  On the otherhand, if I take the following sequence:

0x3B(0x7F)0x80(0xFF)0x00

And use just the outgoing portion:

(0x3B80 < 1) = 0x7700

I don't know.................

 

Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on February 01, 2013, 08:59:34 PM
I am not familiar with your test equipment, but it looks to me like the trigger point is too slow or the sampling rate is off (or both).


I had odd results when I used my Bus Pirate as well.  I might play around with this on the weekend and will post here if I figure out the problem.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: kb1pvh on February 02, 2013, 09:11:35 AM
iBangkok24

  I have a dreaded GREEN DOT console and unfortunately it won't allow me to use the setup af4ex did. If you get something to work, I'll buy one from you for sure. I have a pair of XBEEs sitting here waiting for a working solution.


Dave-KB1PVH
Title: Re: DIY "GREEN DOT" Data Logger
Post by: C5250 on February 02, 2013, 11:41:36 AM
I had odd results when I used my Bus Pirate as well.  I might play around with this on the weekend and will post here if I figure out the problem.

Double speed is used when talking to the radio, but not when talking to the logger.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on February 03, 2013, 12:39:52 PM
I am not familiar with your test equipment, but it looks to me like the trigger point is too slow or the sampling rate is off (or both).


I had odd results when I used my Bus Pirate as well.  I might play around with this on the weekend and will post here if I figure out the problem.

I've sorted out my Bus Pirate problem.  I needed to connect the Bus Pirate's Vpu (voltage pullup line) to 3.3V and enable pullups on the Bus Pirate.  I'm also in the middle of writing a Python script that talks to the Bus Pirate using its binary mode interface.  This will make the programming of the security key trivial to anybody who has this cheap and wonderful little device.  Here is a teaser from my DIY logger:

Quote
[dekay@laptop dataflash]$ python2 spi_test.py
Entering binmode:  OK.
Entering raw SPI mode:  OK.
Configuring SPI.
Chip Status: 0x8c
Chip ID: 0x1f 0x22 0x00 0x00
Reading Security Register:
[ 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff ]
[ 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff ]
[ 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff ]
[ 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff ]
[ 0x0b 0x01 0x1e 0x0e 0x13 0x15 0x1f 0x22 0x00 0x00 0x56 0x00 0xff 0xff 0xd8 0xff ]
[ 0x30 0x30 0x4d 0x32 0x35 0x36 0x32 0x36 0x08 0x31 0x34 0xff 0xff 0xff 0xff 0xff ]
[ 0x43 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff ]
[ 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff ]

Title: Re: DIY "GREEN DOT" Data Logger
Post by: rdsman on February 03, 2013, 02:06:51 PM

I've sorted out my Bus Pirate problem.


Nice Work!

Title: Re: DIY "GREEN DOT" Data Logger
Post by: franzz on February 06, 2013, 04:32:14 PM
I think that Davis uses both sections of security register (0..63 and 64..127) for decryption, because it makes no sense to use only a static key in the 1st block of security register to be save. My opinion is that Davis uses the unique ID in the second part for encryption of a view bytes in the first part of security register.
If I empathize me with the part of Davis, I would write some coded product info (serial, revision, production date,...) + encrypted info from 2nd part of security register (unique ID) into this 1st part of security register.
But to prove this theory we need at least a second owner of a green dot datalogger which is able to read out security register to compare the data of the 0..63 byte of security register with data of rdsman. I fear that this 0..63 bytes differ for every green dot datalogger.

BR
franzz
Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on February 06, 2013, 11:12:38 PM
I think that Davis uses both sections of security register (0..63 and 64..127) for decryption, because it makes no sense to use only a static key in the 1st block of security register to be save. My opinion is that Davis uses the unique ID in the second part for encryption of a view bytes in the first part of security register.
If I empathize me with the part of Davis, I would write some coded product info (serial, revision, production date,...) + encrypted info from 2nd part of security register (unique ID) into this 1st part of security register.
But to prove this theory we need at least a second owner of a green dot datalogger which is able to read out security register to compare the data of the 0..63 byte of security register with data of rdsman. I fear that this 0..63 bytes differ for every green dot datalogger.

BR
franzz

I think franzz is correct.  The key rdsman discovered doesn't show up in the new firmware, so there is likely a computation involved rather than a static key.  The good news is that the console has a pretty feeble processor in it so the computation is likely to be simple.  The other good news is that the commands to read the key from the flash are well defined and this should help narrow things down.

So what we need first is for rdsman or somebody else to dump the full 128 bytes in the security register and then figure out how to get from one to the other.

Anybody know when the console reports the incompatible logger error?  After the first beep?  Second beep?

BTW, my attempts to get my Bus Pirate to talk to my DIY logger chip hit a wall when I found I couldn't reliably read a page of data.  I'll look at it a bit again this weekend and see if I can get it going.  Either way, I'll post my code in case anybody else once to give it a shot and get it working.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: franzz on February 07, 2013, 03:20:45 AM

The key rdsman discovered doesn't show up in the new firmware, so there is likely a computation involved rather than a static key. 

Do you have the new firmware (3.0) as a file? I can't find it in Davis download section.


BR
franzz
Title: Re: DIY "GREEN DOT" Data Logger
Post by: iBangkok24 on February 07, 2013, 06:33:01 AM

Anybody know when the console reports the incompatible logger error?  After the first beep?  Second beep?


I have VUE Console, both "GreenDot" and "NonGreenDot".

The "NON Green dot" will display all dot in LCD and send out "LCD OK" after the 3(third) beep, and try out SPI communication with my DIY Logger then report a successful with the 4(fourth) beep.

The "Green DOT" does the same procedure, but not beep out the fourth beep due to unsuccessful verify a Green Dot Logger.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: iBangkok24 on February 07, 2013, 06:40:10 AM
I think that Davis uses both sections of security register (0..63 and 64..127) for decryption, because it makes no sense to use only a static key in the 1st block of security register to be save. My opinion is that Davis uses the unique ID in the second part for encryption of a view bytes in the first part of security register.
If I empathize me with the part of Davis, I would write some coded product info (serial, revision, production date,...) + encrypted info from 2nd part of security register (unique ID) into this 1st part of security register.
But to prove this theory we need at least a second owner of a green dot datalogger which is able to read out security register to compare the data of the 0..63 byte of security register with data of rdsman. I fear that this 0..63 bytes differ for every green dot datalogger.

BR
franzz

I agree with franzz as i mention this in another topic, "Incompatible Logger" and as my SPI sniff shown that the console try to read 128 bytes of data out of the logger, not just 64 butes.

One more concern rdsman, While I'm waiting for my bus pirate I have some feeling that Davis might be using the Security Register from bit 65 to 127, which is unique for every single 45DB to calculate what is to be programmed in the first 64 bit of the Security Register. If my concern becoming true it would be nightmare.

Maybe I just think too much.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: rdsman on February 07, 2013, 04:47:00 PM
Here is the full dump:

Code: [Select]

Status Register (0xD7): 0x8C

Manufacturer and Device ID Information (0x9F): 0x1F 0x22 0x00 0x00

Sector Lockdown Register (0x35): 0x00 0x00 0x00 0x00

Security Register (0x77):

0x80  0x2D  0x22  0x6F  0x52  0x6F  0x98  0xA9  0x21  0x25  0x5E  0x2D  0x2D  0x31  0xD2  0x39
0x18  0x1C  0x63  0x0C  0x31  0x21  0x2D  0x39  0x90  0xDE  0x94  0x6F  0x6B  0x77  0x73  0x7F
0x63  0x8C  0x88  0x84  0x80  0x9C  0x98  0x94  0x90  0xAD  0xA9  0xA5  0xA1  0xBD  0xB9  0xB5
0xB1  0xCA  0xCE  0xC2  0xC6  0xDA  0xDE  0xD2  0xD6  0xEB  0xEF  0xE3  0xE7  0xFB  0xFF  0xF3
0x0B  0x02  0x16  0x17  0x11  0x15  0x1F  0x22  0x00  0x00  0x46  0x00  0xFF  0xFF  0xAC  0xFF
0x30  0x30  0x4D  0x32  0x36  0x39  0x37  0x31  0x0F  0x1C  0x0C  0xFF  0xFF  0xFF  0xFF  0xFF
0x3F  0xFF  0xFF  0xFF  0xFF  0xFF  0xFF  0xFF  0xFF  0xFF  0xFF  0xFF  0xFF  0xFF  0xFF  0xFF
0xFF  0xFF  0xFF  0xFF  0xFF  0xFF  0xFF  0xFF  0xFF  0xFF  0xFF  0xFF  0xFF  0xFF  0xFF  0xFF


Title: Re: DIY "GREEN DOT" Data Logger
Post by: franzz on February 15, 2013, 02:06:56 AM
Does anyone know if the serial interface is also blocked in case of using only the serial to USB converter (FT232) without the Flash(45DB011) with console firmware 3.0?

BR
franzz
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on February 15, 2013, 03:12:20 AM
I beleive that it is. The console looks for a valid liogger on the SPI bus, if it finds one it enable the serial port communications, if it doesn't find one it diasble this function.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: rdsman on February 17, 2013, 06:22:29 PM
It might be possible to just "spoof" the console into enabling the serial port.  This would only interest people that don't need the full logging capability.  You could for example use a setup that provides a USB interface or the XBee footprint.  Write some code and off you go!  Here is just one example:


Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on February 18, 2013, 03:17:51 AM
It might be possible to just "spoof" the console into enabling the serial port.  This would only interest people that don't need the full logging capability.  You could for example use a setup that provides a USB interface or the XBee footprint.  Write some code and off you go!  Here is just one example:
Good point, and thinking about it using the chip select line you could enable logging after the link is opened.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: rdsman on February 18, 2013, 09:03:57 AM
Yes it did occur to me that you could even parallel the SPI bus and just hold the AT45DB011D in reset until the Security Register has been read.

Title: Re: DIY "GREEN DOT" Data Logger
Post by: iBangkok24 on February 20, 2013, 03:55:45 AM
rdsman, Is it possible to plug in the buspirate and spoof the console (in the power on phase), then take off the buspirate and plug in the NON GreenDot logger (never stop the power to the console). Just some thing like tether jailbreak.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: rdsman on February 20, 2013, 01:05:13 PM
rdsman, Is it possible to plug in the buspirate and spoof the console (in the power on phase), then take off the buspirate and plug in the NON GreenDot logger (never stop the power to the console). Just some thing like tether jailbreak.

While this might be possible, I wouldn't recommend doing it!  Plugging/Un-plugging things into live circuits is never a good idea in my opinion.  I would look for an alternative method.

I originally wrote a program that would allow an Arduino to read a "Green Dot" logger.  The code shown below should allow an Arduino to emulate a "Green Dot" logger just long enough for the console to enable the serial port.  It will then effectively remove itself from the circuit.  See a previous post for the schematic.

Code: [Select]
/*
  Arduino program to spoof the Green Dot Logger
  SPI interface.  (Causes the serial interface
  to be enabled?)
    
  by rdsman
    
  20 FEB 2013
  
  YOU MUST USE AN ARDUINO RUNNING ON 3.3 VOLTS
  OR PROVIDE LOGIC LEVEL CONVERSION!
  
  YOU HAVE BEEN WARNED!
*/
#include "Arduino.h"
//
//  Arduino Definitions.
//
#define RX            0    //  The interface pins are defined here.
#define TX            1
#define SS           10
#define MOSI         11
#define MISO         12
#define SCK          13
//
//  45DB011D Definitions.
//
#define STATUS_REGISTER    0xD7
#define STATUS_WORD        0x8C
#define SECURITY_REGISTER  0x77
//
const byte SECURITY_RESPONSE[128] =
{
  0x80, 0x2D, 0x22, 0x6F, 0x52, 0x6F, 0x98, 0xA9, 0x21, 0x25, 0x5E, 0x2D, 0x2D, 0x31, 0xD2, 0x39,
  0x18, 0x1C, 0x63, 0x0C, 0x31, 0x21, 0x2D, 0x39, 0x90, 0xDE, 0x94, 0x6F, 0x6B, 0x77, 0x73, 0x7F,
  0x63, 0x8C, 0x88, 0x84, 0x80, 0x9C, 0x98, 0x94, 0x90, 0xAD, 0xA9, 0xA5, 0xA1, 0xBD, 0xB9, 0xB5,
  0xB1, 0xCA, 0xCE, 0xC2, 0xC6, 0xDA, 0xDE, 0xD2, 0xD6, 0xEB, 0xEF, 0xE3, 0xE7, 0xFB, 0xFF, 0xF3,
  0x0B, 0x02, 0x16, 0x17, 0x11, 0x15, 0x1F, 0x22, 0x00, 0x00, 0x46, 0x00, 0xFF, 0xFF, 0xAC, 0xFF,
  0x30, 0x30, 0x4D, 0x32, 0x36, 0x39, 0x37, 0x31, 0x0F, 0x1C, 0x0C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
};  
//
//  Setup Loop.
//
void setup()
{
  delay(100);
  initialize();
  delay(100);
}  
//
//  Main Loop.
//
void loop() // run over and over
{
    
}
//
//  Setup the microprocessor.
//
void initialize()
{
  byte temp;
  byte sreg = SREG;
  
  cli();                       //  Disable global interrupts while we make our changes.
    
  pinMode(RX, INPUT);          //  Set up the Serial data pins.  (Not used by the processor,
  pinMode(TX, INPUT);          //  simply passed through to the USB interface.)
  pinMode(SS, INPUT);          //  Set up the SPI pins.
  pinMode(MOSI, INPUT);
  pinMode(MISO, OUTPUT);
  pinMode(SCK, INPUT);
                               //  Turn off everything that might interfere!
  ADCSRA = 0x00;               //  Disable the analog comparator.
  TCCR1B = 0x00;               //  Disable Timer 1.
  TCCR2B = 0x00;               //  Disable Timer 2.
  
  SPCR = (1 << SPIE | 1 << SPE);  //  Initialize the SPI in Slave Mode.
  
  temp = SPSR;                 //  Clear SPSR.
  temp = SPDR;                 //  Flush SPDR.
  
  SREG = sreg;                 //  Enable global interrupts.
}
//
//  SPI Interrupt Service Routine.
//
ISR(SPI_STC_vect)
{
  volatile byte temp = SPDR;
  
  if (temp == STATUS_REGISTER)       //  Is it reading the Status Register?
    {
      SPDR = STATUS_WORD;            //  If so, send the Status Word.
      while(!(SPSR & (1 << SPIF)));
      temp = SPSR;                   //  Clear SPIF.
      temp = SPDR;                   //  Flush SPDR.
      return;
    }  
  
  if (temp == SECURITY_REGISTER)     //  Is it reading the Security Register?
    {
      for (int i = 0; i < 3; i++)    //  If so, rx/tx three dummy bytes.
        {
          SPDR = 0x00;
          while(!(SPSR & (1 << SPIF)));
          temp = SPSR;
          temp = SPDR;
          if (temp != 0x00)          // Check for all 0x00's.
            return;
        }
      
      for (int i = 0; i < 128; i++)  //  Dump the Security Register.
        {
          SPDR = SECURITY_RESPONSE[i];
          while(!(SPSR & (1 << SPIF)));
          temp = SPSR;
          temp = SPDR;
        }  
      
      SPCR == 0x00;                 //  Disable the SPI.
    }
}    
//
//  The End.
//


It needs to be tried out by someone!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on February 21, 2013, 03:11:33 AM
I shall give it a go as soon as I get a chance.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: franzz on February 21, 2013, 04:29:21 PM
This sounds great.
If it is possible to emulate eeprom access to enable serial line, it could be possible to downgrade FW to 1.9.

It gives us also the possibility to play with different values in security table.
I've analyzed the hex codes from security region bytes 1-64 and the connection to unique ID in bytes 65-128:
Due to the fact that most of unique ID bytes have the value 0xFF I have determined that the corresponding byte in area 1-64 is encrypted with this byte value and the position of the byte, but there is no cross encryption to other bytes.
If you take all the 0xFF and put it into the table below, you can see that there is a pattern. Other values than 0xFF will also take place in this pattern. (see attached table).
Only 64 bytes of 256 possibilities will be used and each value will be used 1 time for a specific unique ID byte depending on the position. All used bytes are highlighted in picture. For all 0xFF and the known position it is very easy to get the right value with this table. For all other byte values the Arduino software from rdsman could be extended to change one byte of know unique ID and make a try which encrypted byte will be used for decryption (it could be only one of 64 bytes)
E.g. change byte 65 from 0x0B to 0x00 and try to change byte 1 to one of the 64 possible bytes. I assume that this procedure could be done automatically by arduino because the RESET of Davis console is also available on the datalogger plug. If encrypted byte was found for 0x00 on the first position let's change the 66th byte to 0x00. Now there are only 63 possibilities left for this position. After finding out 2nd position let's go to byte 67 and do the same try with 3rd byte and 62 left bytes.
If you have any questions please let me know to explain it more detailed.

BR
franzz




Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on February 22, 2013, 05:38:22 PM
Due to the fact that most of unique ID bytes have the value 0xFF I have determined that the corresponding byte in area 1-64 is encrypted with this byte value and the position of the byte, but there is no cross encryption to other bytes.
If you take all the 0xFF and put it into the table below, you can see that there is a pattern. Other values than 0xFF will also take place in this pattern. (see attached table).
Only 64 bytes of 256 possibilities will be used and each value will be used 1 time for a specific unique ID byte depending on the position. All used bytes are highlighted in picture. For all 0xFF and the known position it is very easy to get the right value with this table. For all other byte values the Arduino software from rdsman could be extended to change one byte of know unique ID and make a try which encrypted byte will be used for decryption (it could be only one of 64 bytes)

 =D&gt;

Knowing there is no cross-encryption between bytes is a great find.  I also have a feeling this sequence could be useful:

0x00  0x00  0x46  0x00  0xFF

maps to

0x21  0x25  0x5E  0x2D  0x2D

The 0x00 values increment by four * the offset from the first zero.  Note that the last 0x00 immediately followed by a 0xff doesn't change  but retains the same value as last time.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: iBangkok24 on February 23, 2013, 10:09:06 AM
This sounds great.
If it is possible to emulate eeprom access to enable serial line, it could be possible to downgrade FW to 1.9.

It gives us also the possibility to play with different values in security table.
I've analyzed the hex codes from security region bytes 1-64 and the connection to unique ID in bytes 65-128:
Due to the fact that most of unique ID bytes have the value 0xFF I have determined that the corresponding byte in area 1-64 is encrypted with this byte value and the position of the byte, but there is no cross encryption to other bytes.
If you take all the 0xFF and put it into the table below, you can see that there is a pattern. Other values than 0xFF will also take place in this pattern. (see attached table).
Only 64 bytes of 256 possibilities will be used and each value will be used 1 time for a specific unique ID byte depending on the position. All used bytes are highlighted in picture. For all 0xFF and the known position it is very easy to get the right value with this table. For all other byte values the Arduino software from rdsman could be extended to change one byte of know unique ID and make a try which encrypted byte will be used for decryption (it could be only one of 64 bytes)
E.g. change byte 65 from 0x0B to 0x00 and try to change byte 1 to one of the 64 possible bytes. I assume that this procedure could be done automatically by arduino because the RESET of Davis console is also available on the datalogger plug. If encrypted byte was found for 0x00 on the first position let's change the 66th byte to 0x00. Now there are only 63 possibilities left for this position. After finding out 2nd position let's go to byte 67 and do the same try with 3rd byte and 62 left bytes.
If you have any questions please let me know to explain it more detailed.

BR
franzz


 =D&gt; Thanks franzz,

As I understand If I have a 45DB that have the unique ID of all 0x00 the 128 byte security register should be look like this


00 04 08 0C 10 14 18 1C 21 25 29 2D 31 35 39 3D 42 45 4A 4E 52 56 5A 5E 63 67 6B 6F 73 77 7B 7F 
80 84 88 8C 90 94 98 9C A1 A5 A9 AD B1 B5 B9 BD C2 C6 CA CE D2 D6 DA DE E3 E7 EB EF F3 F7 FB FF
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Am I correct?
Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on February 23, 2013, 10:53:28 AM
For all 0xFF and the known position it is very easy to get the right value with this table. For all other byte values the Arduino software from rdsman could be extended to change one byte of know unique ID and make a try which encrypted byte will be used for decryption (it could be only one of 64 bytes)

Franz

I put together a table in Excel from 0x0 to 0xff and highlighted in yellow the actual values mapping to 0xff.  These hex values are left justified in the attached image.  Like your picture, there is clearly a pattern.  Then I show numbers right justified representing the index in the 64 byte factory written key where the 0xff values appear.  The indexes don't increment regularly from one row to the other.  Instead, there are differences between rows.  Do you understand how to predict the next index?

e.g. Row 21: the index into the factory key is 44, 43, 42, 41.
      Row 29: the index into the factory key is 59, 60, 57, 58.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: franzz on February 23, 2013, 11:07:23 AM


 =D&gt; Thanks franzz,

As I understand If I have a 45DB that have the unique ID of all 0x00 the 128 byte security register should be look like this


00 04 08 0C 10 14 18 1C 21 25 29 2D 31 35 39 3D 42 45 4A 4E 52 56 5A 5E 63 67 6B 6F 73 77 7B 7F 
80 84 88 8C 90 94 98 9C A1 A5 A9 AD B1 B5 B9 BD C2 C6 CA CE D2 D6 DA DE E3 E7 EB EF F3 F7 FB FF
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Am I correct?


Not sure, because if you compare it with the 0xFFs the order is not always increasing.
If you consider the sequence  0x6B, 0x77, 0x73, 0x7F (Byte 29-32) = 0xFF in unique ID, it could be that there are small jumps. It could be that the order of 0x00 in unique Id is the same as for 0xFFs but with a constant shift. One fact is that only 64 bytes will be used for encoding of bytes (see highlighted values in table). If it is able to emulate the EEPROM with the software of RDSMan and Arduino, single bytes of unique ID could be changed and it could be checked by changing according encoded byte in the first region.

BR
franzz
Title: Re: DIY "GREEN DOT" Data Logger
Post by: franzz on February 23, 2013, 11:18:49 AM

Franz

I put together a table in Excel from 0x0 to 0xff and highlighted in yellow the actual values mapping to 0xff.  These hex values are left justified in the attached image.  Like your picture, there is clearly a pattern.  Then I show numbers right justified representing the index in the 64 byte factory written key where the 0xff values appear.  The indexes don't increment regularly from one row to the other.  Instead, there are differences between rows.  Do you understand how to predict the next index?

e.g. Row 21: the index into the factory key is 44, 43, 42, 41.
      Row 29: the index into the factory key is 59, 60, 57, 58.

I did the same in my analysis last week. Try to connect the numbers with lines and arrows and you will see that there are 2 changings in direction (from left to right and vice versa) of the arrows. I've tried to fill the left entries in this table. If emulation of RDSMan works well all FFs could be checked.

BR franzz
Title: Re: DIY "GREEN DOT" Data Logger
Post by: iBangkok24 on February 24, 2013, 04:56:29 AM
I'm not sure if this be useful. I compare my Unique ID, Dekay ID with RDSMAN and found out that only some position is change while most of it remain the same

 0x0B 0x02 0x0E 0x05 0x3A 0x30 0x1F 0x22 0x00 0x00 0x5E 0x00 0xFF 0xFF 0xBC 0xFF
 0x30 0x30 0x4D 0x32 0x36 0x36 0x39 0x38 0x07 0x5E 0x2D 0xFF 0xFF 0xFF 0xFF 0xFF
 0x43 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
 
Title: Re: DIY "GREEN DOT" Data Logger
Post by: kashima on May 19, 2013, 01:48:53 AM
I have ported a rdsman's program to an 8pin PIC.
serial interface has been worked.

thankyou rdsman!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on May 19, 2013, 02:36:18 AM
That's great, what is Manf. Code of the console? Also what firmware is running.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on May 19, 2013, 04:12:13 AM
As the cat seems to be skinned... happy to report good results here as well, using an AVR microcontroller.

Thanks to Davis Instruments Corp. for not using a proper authorization scheme (ATMEL cryptochip et al) but rather keeping the costs down by passively reading from and writing to the "dumb" memory chip.

Now, again, the official Davis reply of "hardware changes required a firmware upgrade" when asked about the "incompatible logger" problem - gets even harder to accept. While there may have been some minor changes, nothing required the serial line to be tucked away by a less-than-optimal authorization scheme.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: kashima on May 19, 2013, 07:06:28 AM
hi,
My Vue is #6250 and Mfg code of ME18041xxxx.  'VER' returns May 1 2012. 'NVER' returns 3.0.

this is C source code for a funny experiments.
Code: [Select]
/*
 * compiler: Microchip XC8
 *
 *    PIC12F1822
 *     +--+ +--+
 * VCC |1  ~  8| GND
 *     |2     7| SDO
 *     |3     6| SCK
 *  SS |4     5| SDI
 *     +-------+
 */
#include <pic.h>
#pragma config FOSC=INTOSC,PLLEN=ON,BOREN=ON,BORV=HI,WDTE=OFF,MCLRE=OFF,LVP=OFF

//
//  45DB011D Definitions.
//
#define STATUS_REGISTER 0xD7
#define STATUS_WORD 0x8C
#define SECURITY_REGISTER 0x77
//
const unsigned char SECURITY_RESPONSE[128] =
{
  0x80, 0x2D, 0x22, 0x6F, 0x52, 0x6F, 0x98, 0xA9, 0x21, 0x25, 0x5E, 0x2D, 0x2D, 0x31, 0xD2, 0x39,
  0x18, 0x1C, 0x63, 0x0C, 0x31, 0x21, 0x2D, 0x39, 0x90, 0xDE, 0x94, 0x6F, 0x6B, 0x77, 0x73, 0x7F,
  0x63, 0x8C, 0x88, 0x84, 0x80, 0x9C, 0x98, 0x94, 0x90, 0xAD, 0xA9, 0xA5, 0xA1, 0xBD, 0xB9, 0xB5,
  0xB1, 0xCA, 0xCE, 0xC2, 0xC6, 0xDA, 0xDE, 0xD2, 0xD6, 0xEB, 0xEF, 0xE3, 0xE7, 0xFB, 0xFF, 0xF3,
  0x0B, 0x02, 0x16, 0x17, 0x11, 0x15, 0x1F, 0x22, 0x00, 0x00, 0x46, 0x00, 0xFF, 0xFF, 0xAC, 0xFF,
  0x30, 0x30, 0x4D, 0x32, 0x36, 0x39, 0x37, 0x31, 0x0F, 0x1C, 0x0C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
};

void main()
{
unsigned char i;
unsigned char cmd, tmp;

OSCCON = 0b11110000; // set a system clock 8MHz x4PLL = 32MHz
ANSELA = 0; // all digital I/O
TRISA = 0b11111110; // SDO pin set to output
SSP1STAT = 0b00000000; // initialize MSSP module
SSP1CON1 = 0b00110100;
SSP1BUF = 0;

while(1){
reset:
while(!BF); // wait a command
if(RA3) goto reset;
cmd = SSP1BUF;

switch( cmd ){
case STATUS_REGISTER:
SSP1BUF = STATUS_WORD; // response word
SSP1IF = 0;
while(!BF); // wait a sending
if(RA3) goto reset;
tmp = SSP1BUF;
SSP1IF = 0;
break;

case SECURITY_REGISTER:
for(i = 0; i < 3; i++){ // put a dummy word
SSP1BUF = 0;
SSP1IF = 0;

while(!BF);
if(RA3) goto reset;
tmp = SSP1BUF;
}
for(i = 0; i < 128; i++){ // put a security response
SSP1BUF = SECURITY_RESPONSE[i];
SSP1IF = 0;
while(!BF);
if(RA3) goto reset;
tmp = SSP1BUF;
}
SSP1IF = 0;
break;
default:
break;
}
}
}
Title: Re: DIY "GREEN DOT" Data Logger
Post by: rdsman on May 19, 2013, 01:33:20 PM
kashima & torkelmj:

The fact that you have it working is good news.  It would also be nice to know if it reads the entire Security Register or perhaps just the first 10 bytes.  Just a guess!

Since it now appears to confirm that Davis is only using the Security Register, it gets those who desire back to building their own logger.  Just take a blank 45DB011D and program the Security Register with an Arduino, Bus Pirate, etc.

Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on May 19, 2013, 09:25:01 PM
kashima & torkelmj:

The fact that you have it working is good news.  It would also be nice to know if it reads the entire Security Register or perhaps just the first 10 bytes.  Just a guess!

Since it now appears to confirm that Davis is only using the Security Register, it gets those who desire back to building their own logger.  Just take a blank 45DB011D and program the Security Register with an Arduino, Bus Pirate, etc.


Kashima.  This is indeed excellent news.  Well done, Sir!   =D&gt;
 
rdsman, your suggestion won't work, I think.  Of the 128 bytes in the security register, 64 are one-time-programmed at the factory with a unique code.  Kashima's solution works because he has the known key to a known code.

It would be easier for us if we could break the code for the EEPROM, but not much easier.  It doesn't seem worth the effort anymore   :-) 
Title: Re: DIY "GREEN DOT" Data Logger
Post by: dmurphydrtc on May 20, 2013, 03:20:06 AM
Folks,

Does this mean we are close to getting the RS-232 comms. port working on the newer green dot Vantage products? That
indeed would be great news. I have my ISS working via 3DR as per Andrew Tridge solution but their are a few readings from the Console
are not available...have the rs-232 port working would be magic.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on May 20, 2013, 04:01:00 AM
Folks,

Does this mean we are close to getting the RS-232 comms. port working on the newer green dot Vantage products? That
indeed would be great news. I have my ISS working via 3DR as per Andrew Tridge solution but their are a few readings from the Console
are not available...have the rs-232 port working would be magic.

I am working on this as I type....
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on May 20, 2013, 05:22:30 AM
Quote from: DeKay link=topic=18110.msg183220#msg183220
It would be easier for us if we could break the code for the EEPROM, but not much easier.  It doesn't seem worth the effort anymore   :-)  

The problem with the current approach is that known "public" chip IDs and/or keys could be blocked in subsequent FW releases (up to a certain limit, taking into account the memory limitations of the ATmega128). Just a thought.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on May 20, 2013, 05:32:16 AM
It would also be nice to know if it reads the entire Security Register or perhaps just the first 10 bytes.  Just a guess!

Will check on that later today. I've just been dumping the full 128 bytes to the console.

Now, another thought: all the 45DB dataflash chips come with a manufacturer ID and a device ID as well as a unique chip ID. The first two values appear as expected (standard, that is) but does the FW require a certain range of chip IDs in order to work? Could anyone please provide me with a chip ID for a non-Davis-supplied 45DB dataflash chip? I still haven't received mine (public holidays here...)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on May 20, 2013, 01:56:46 PM
It would also be nice to know if it reads the entire Security Register or perhaps just the first 10 bytes. 

I may misunderstand your question here; as you can see from the attached SPI bus dump file, the entire security register of 128 bytes is returned, but whether the entire thing is actually *processed* by the console, I haven't yet checked. This far I've been quite happy returning some values which the console accepts. FWIW, the entire 128-byte (programmed) security register is listed in the attached dump file. If anyone needs it in a more readable format in their quest to find the "key", please let me know.

--- start relevant stuff ---
@ 5.87493098: console issues 0xD7 to read status register from dataflash chip
@ 5.87495648: chip replies with 0x8C (10001100), ref. 45DB011 documentation
@ 5.87505848: console issues 0x77 plus three dummy bytes to read security register from chip
@ 5.87517078: chip dumps the 128-byte (programmed) security register, in this case starting with 0x9A
--- end relevant stuff ---
@ 6.33447974: console issues 0xD2 for a page read
@ 6.33577918: console issues 0xD7 (as above)
@ 6.33587902: console issues 0x53 plus three address bytes for "main memory page to buffer transfer"

BTW, last week's visit to Hayward proved that not everybody at a certain manufacturer was too happy about the new "features" introduced in FW version 3.xx. On the good side, don't be surprised if a better-resolution rain gauge turns up pretty soon.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: rdsman on May 20, 2013, 06:24:36 PM
Quote
I may misunderstand your question here;

Nope, not at all.  The fact that it dumps all 128 bytes is what I wanted to know!

Thanks
Title: Re: DIY "GREEN DOT" Data Logger
Post by: dmurphydrtc on May 28, 2013, 08:59:31 AM
Folks,

Any further progress with this problem?  Feedback would be much appreciated.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on May 28, 2013, 11:46:14 AM
To a certain (sufficient?) extent, I guess most of the work has been done and documented by the fine folks in here. Arduino, AVR-Atmega/Attiny, PIC, ... won't be long until fully working 3rd party data loggers will be available again.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: dmurphydrtc on June 20, 2013, 09:54:23 PM
Any further progress with this problem?
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on June 21, 2013, 03:12:57 AM
Yes. There's a fine solution mentioned a few posts further up. It's adequate for disabling the serial-line lockdown, which was *my* main goal. Adding a few nuts and bolts will yield a fully capable data logger.

The above code snipet/implementation is for a PIC12F1822, but the same logic can be applied to other microcontrollers capable of SPI communication or SPI-like communication. I'm presently running some stability checks for an implementation using an ATtiny microcontroller priced at $1, which means that the console connector remains the most expensive part of the setup.

As for a 3rd party data logger, my bet is that we'll see one very soon.

Apart from that - what do you want to know? Specific questions have a tendency to yield specific answers.  ;)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: dmurphydrtc on June 21, 2013, 11:00:27 AM
Great news.  The information you provided is specific enough ie a total solution is close at hand. 
My technical skills are limited, not much to add other than thanks and admiration.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on July 02, 2013, 06:07:53 PM
Building on the work already presented by others here, my own pre-Christmas tinkering, handwritten notes and experiences from running 15+ VP2 stations at different locations utilizing non-Davis equipment to gather, forward and store data (including the troubles we started running into when we found ourselves in need of a replacement console which happened to have FW v. 3.00 installed) - I've gathered what I believe is the essential stuff into a single document. For anyone with an interest in gaining access to the console's serial line using simple equipment and techniques, http://meteo.annoyingdesigns.com/DavisSPI.pdf may be just what you need to get started. Having run the "ATtiny-variant" for half a year now, concurrently at 15+ different sites, I'm confident that it works as it should.

As I at no time have been in need of the "data logger" functionality, I haven't cared to document the work required to assemble a "data logger" with functionality equal to the original Davis equipment. The solution already discussed in this thread works fine, though. I may get around to include a section with the required details, but that won't happen this summer.

Wishing you all a wonderful summer season.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on July 02, 2013, 10:31:13 PM
Building on the work already presented by others here, my own pre-Christmas tinkering, handwritten notes and experiences from running 15+ VP2 stations at different locations utilizing non-Davis equipment to gather, forward and store data (including the troubles we started running into when we found ourselves in need of a replacement console which happened to have FW v. 3.00 installed) - I've gathered what I believe is the essential stuff into a single document. For anyone with an interest in gaining access to the console's serial line using simple equipment and techniques, http://meteo.annoyingdesigns.com/DavisSPI.pdf may be just what you need to get started. Having run the "ATtiny-variant" for half a year now, concurrently at 15+ different sites, I'm confident that it works as it should.

I'm not sure what impresses me the most about this writeup:
Outstanding!!!   =D&gt;
Title: Re: DIY "GREEN DOT" Data Logger
Post by: docbee on July 03, 2013, 03:37:00 AM
@torkelmj: thanks for sharing this in such brilliant quality! a true masterpiece!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on July 03, 2013, 03:39:08 AM
  • the absurdly excessive yet well-placed vitriol dripping from every page   \:D/

There may be an unintended and excessive leak from the vitriol line, caused by English not being my primary language.
Having said that, I was truly disappointed by the limitations imposed in FW v. 3 just as we had started rolling out our monitoring system.
 ](*,)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: dmurphydrtc on July 03, 2013, 09:13:58 AM
Torkel,

To say this was worth the wait would be a total understatement. A brilliant piece of technical writing and hats off to you for
sharing this wonderful work. Thanks once again. Now off to build me a unit........
Title: Re: DIY "GREEN DOT" Data Logger
Post by: rdsman on July 03, 2013, 05:39:00 PM
torkelmj:

Excellent!  The WXForum should award you the PhDD!  (Doctor of Documentation)


Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on July 09, 2013, 03:25:49 AM
Thanks. Good to know that a number of users have already started out with their own ATtiny projects. Best of luck to you all.

Title: Re: DIY "GREEN DOT" Data Logger
Post by: Haku on July 28, 2013, 03:24:58 PM
Hi,
First big thanks to all who have contributed to this! I see that many of you have invested a large amount of time to figure this out.  I received a Davis Vantage Vue with the dreaded firmware V3.0, which (given the incredibly ugly looking console) has no other function than to stream the data to some place where it can be processed. I currently use a Kindle PW and an old Oregon Scientific 200A to display the readings in my living room and I upload it to a web-page. I’m happy to share this project if someone is interested.

I’m an open source guy and I would never have purchased any Davis products had I known that it cannot be used with any third-party (i.e. useful) software – not to speak of the locking down an otherwise perfectly good serial port for no other reason than to sell a useless piece of software with a $10 serial dongle.
Davis: You really don’t have to sell your products if you don’t want anyone to use them! (My 2cents).

Anyway, I tried to port Kashima’s code to a TI MSP430 Launchpad (I picked it up for $4.30 about a year ago from MOUSER. It came with two 16 bit MCUs and a USB to serial converter. How handy!). But still no success to date. I would assume that all that has been discussed here should also work with a Vantage Vue console as these seem to use the same dataloggers. Is that assumption correct?

What puzzles me is that the Vue again and again spits out something like 0xF5 (or 0x75, I cannot quite see the first bit on the analog scope) followed by a zero, which should essentially pump the response from the MCU to the console. (Please see the MOSI picture on my trusty analog scope). The code then essentially replies the same byte, as 0xF5 is not a recognized as a command. Hence the case in ‘default’ is taken, which does not change the serial register but just reloads the SPI counter. This also seems to tell me that the MCU is actually receiving and replying the data correctly. (Nothing seems to change if I enable pullups on the inputs, so I assume the outputs on the console are not open collector.)

Other things I have observed is that the slave select (SS, pin 1 on the console) goes to high when I power up the console, but then it stays high even during the SPI transmission. That’s unexpected! The SPI clock line initially idles high, but after the first byte it seems to idle low (again, please see the pictures: top trace is SPI clock (pin 2 on the console) and the bottom is either MISO or MOSI (as defined on the console side). All signals are measured directly at the pins of the MCU to make sure that the signals arrive undistorted, which seems to be the case. I use 2-3 inch wires between the console and the MCU.

I’m at a loss :oops: Does anyone have some suggestions?

Many thanks,
Haku
Title: Re: DIY "GREEN DOT" Data Logger
Post by: rdsman on July 28, 2013, 07:01:32 PM
At some point during the power-up sequence, the Vue reads the Status Register of the logger.  It then reads the Security Register.  If any of this fails, it never tries again unless you remove power.  You will have to sync on Slave Select or none of the commands will make any sense.



Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on July 28, 2013, 08:02:29 PM
Hi,
First big thanks to all who have contributed to this! I see that many of you have invested a large amount of time to figure this out.  I received a Davis Vantage Vue with the dreaded firmware V3.0, which (given the incredibly ugly looking console) has no other function than to stream the data to some place where it can be processed. I currently use a Kindle PW and an old Oregon Scientific 200A to display the readings in my living room and I upload it to a web-page. I’m happy to share this project if someone is interested.

Please do!

Other things I have observed is that the slave select (SS, pin 1 on the console) goes to high when I power up the console, but then it stays high even during the SPI transmission. That’s unexpected! The SPI clock line initially idles high, but after the first byte it seems to idle low (again, please see the pictures: top trace is SPI clock (pin 2 on the console) and the bottom is either MISO or MOSI (as defined on the console side). All signals are measured directly at the pins of the MCU to make sure that the signals arrive undistorted, which seems to be the case. I use 2-3 inch wires between the console and the MCU.

The console also uses SPI to talk to the radio chip, but it uses a different pin off the MCU for SS that is not brought out to the rear connector.  The unexpected is actually very expected   :-)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Haku on July 28, 2013, 09:33:25 PM
Thank you all for the very fast replies! I'll try harder.

Please do!
I will as soon as I figure this one out  ](*,)

The console also uses SPI to talk to the radio chip, but it uses a different pin off the MCU for SS that is not brought out to the rear connector.  The unexpected is actually very expected   :-)
Does that mean that the Vue would need another datalogger than the VP? I would think that the flash chip would not respond without the /CS pulled low. Or maybe there are redundant lines on the data logger board. Would you happen to know which pin on the ATMega would be used for the SS in the Vue? I could solder a line directly on the chip inside the console. I am planning to put the MCU inside anyway so I get an unlocked console without the extra board hanging off the back.

Or should I try to sync on the first falling edge of the SPI clock? It is peculiar that it first idles high and later it seems to idle low. But again, I don't have a digital scope that would let me trigger on the very first events so I'm flying pretty much blind here. Maybe I should use another MCU as a logic analyzer.

Again, many thanks to all your help!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on July 29, 2013, 12:04:52 AM
The console also uses SPI to talk to the radio chip, but it uses a different pin off the MCU for SS that is not brought out to the rear connector.  The unexpected is actually very expected   :-)
Does that mean that the Vue would need another datalogger than the VP? I would think that the flash chip would not respond without the /CS pulled low. Or maybe there are redundant lines on the data logger board. Would you happen to know which pin on the ATMega would be used for the SS in the Vue? I could solder a line directly on the chip inside the console. I am planning to put the MCU inside anyway so I get an unlocked console without the extra board hanging off the back.
[/quote]

I think I've confused you.  My mistake.  When I said MCU, I meant the processor in the console (an Atmega 128L).  The radio chip and the expansion port are connected to the same SPI MOSI and MISO lines.  The "native" SS pin on the Atmega is what comes out on the expansion port and this is the /CS to the flash chip.  The other activity you see is the Atmega talking to the radio.  Because it uses a different pin off the Atmega as the radio's /CS, the flash does not respond when the Atmega is talking to the radio.

When a compatible datalogger is connected, the console recognizes this and will now and then write data to the flash on the logger.  You would then see SS go low at these times.

To make a long story short, just use the pins brought out to the expansion connector and you'll be golden.

Title: Re: DIY "GREEN DOT" Data Logger
Post by: Haku on July 29, 2013, 09:53:14 AM
Thank you very much for clarifying this. It makes perfect sense!

I see now that the SS goes low occasionally and I got the MCU to detect both, the status register and the security register command. However, sending the response has to date never unlocked the serial port. At best I occasionally get the 'incompatible datalogger' message - but since I only get it occasionally (after power-cycling the console), I think the timing of my MCU is still off by a bit. I'll try some more and report back.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: rdsman on July 29, 2013, 12:17:59 PM
Quote
Maybe I should use another MCU as a logic analyzer.

Brilliant idea!  Use the MSP430 to capture the SPI data and then print it to the serial port.  This way you can find out if your timing is off.

Title: Re: DIY "GREEN DOT" Data Logger
Post by: Haku on August 04, 2013, 01:10:07 PM
Hi everyone.

Unfortunately, still no success with the MSP430G2231. Below one of the many versions the code segment I used. I tried all possible combinations for the SPI timing and for some I see that the console requests the status byte but nothing happens after that. Once in a few dozen tries I get an 'incompatible datalogger'. There are some extra variables in the code for debugging but else it should do about the same as Kashima's code. I checked the signals on the MCU with a scope and all looks clean. Does anyone see where I go wrong here?

Is it neccessary to switch to a MCU that allows true 4-whire (plus ground) instead of this 'emulated' 4-wire using the GPIO 'SS' pin below? (The smallest MCU I have here with true 4 wire SPI is a STM32F407, which seems a huge overkill for this simple task, and it might skew the temperature readings on the console due to its pretty hefty power consumption.)

Best,
Haku

Code: [Select]
//***************************************************************************************
//  MSP430 Unlock Davis
//
//  Description: Unlock the Davis Vantage Vue/Pro(TM) Serial Port
// This code was based on the PIC version from kashima
//
//                Slave                      Master
//               MSP430G2231              Davis Weather Station Console
//             -----------------          -----------------
//            |                 |        |                 |
//            |                 |        |                 |
//            |                 |        |                 |
//            |                 | /|\    |                 |
//            |          RST/NMI|---     |                 |
//      LED <-|P1.0             |        |                 |
//            |                 |        |                 |
//            |         SDI/P1.7|<-------|3/MOSI           |
//            |         SDO/P1.6|------->|4/MISO           |
//            |        SCLK/P1.5|<-------|2/SCLK           |
//            |          SS/P1.1|<-------|1/SS             |
//            |                |         |                 |
//             -----------------          -----------------
//
//
//  Special thanks to (in no particular order): DeKay, rdsman, kashima, iBangkok24, franzz, belfryboy, and all the other nice folks over at WXForum.net
//
//  Built with Code Composer Studio v5
//***************************************************************************************

#include <msp430.h>

#define STATUS_REGISTER 0xD7  //215
#define STATUS_WORD 0x8C  //140
#define SECURITY_REGISTER 0x77  //119

#define SS (P1IN&0x02) //Slave Select pin: Slave is addressed if SS reads zero

const unsigned char SECURITY_RESPONSE[128] =
{
  0x80, 0x2D, 0x22, 0x6F, 0x52, 0x6F, 0x98, 0xA9, 0x21, 0x25, 0x5E, 0x2D, 0x2D, 0x31, 0xD2, 0x39,
  0x18, 0x1C, 0x63, 0x0C, 0x31, 0x21, 0x2D, 0x39, 0x90, 0xDE, 0x94, 0x6F, 0x6B, 0x77, 0x73, 0x7F,
  0x63, 0x8C, 0x88, 0x84, 0x80, 0x9C, 0x98, 0x94, 0x90, 0xAD, 0xA9, 0xA5, 0xA1, 0xBD, 0xB9, 0xB5,
  0xB1, 0xCA, 0xCE, 0xC2, 0xC6, 0xDA, 0xDE, 0xD2, 0xD6, 0xEB, 0xEF, 0xE3, 0xE7, 0xFB, 0xFF, 0xF3,
  0x0B, 0x02, 0x16, 0x17, 0x11, 0x15, 0x1F, 0x22, 0x00, 0x00, 0x46, 0x00, 0xFF, 0xFF, 0xAC, 0xFF,
  0x30, 0x30, 0x4D, 0x32, 0x36, 0x39, 0x37, 0x31, 0x0F, 0x1C, 0x0C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
};

volatile unsigned char i;
volatile unsigned char dbg_cnt,statcnt,seccnt; //for debugging
volatile unsigned char cmd;


int main(void)
{
  WDTCTL = WDTPW + WDTHOLD;             // Stop watchdog timer

  BCSCTL1 = 0x8f; //16 MHz
  DCOCTL = 0x60;

  P1OUT =  0x10;  //0x10                // P1.4 set
  P1REN |= 0x10; //0x30;                // pull-up. P1.4 must be pulled up
  P1DIR = 0x01; //0x01;                 // P1.0 output, else input. MISO will be controlled below
//just to save power:
  P2OUT =  0x00; //all low
  P2REN |= 0xff; //pull-downs
  P2DIR = 0x00;  //all in

  dbg_cnt=statcnt=seccnt=0;  //just for debugging

  P1OUT &= ~0x01;


  USICTL0 |=  USIPE7 + USIPE6 + USIPE5 + USIOE + USIGE; // Port, SPI slave
//  USICTL1 |= USICKPH; //clockphase
//  USICKCTL |= USICKPL; //clock inactive state is high
// (I tried all the combinations of USICKPH, USICKPL, and USIGE a few dozen times.)

  USICTL0 &= ~USISWRST;                 // USI released for operation

  P1OUT |= 0x01;
  while(SS==0); //wait until ss goes high (idle). This ensures that we wait until the console is powered up

  USISRL = 0x00;                       // init-load data
  USICNT = 8; // ready SPI for 8 bit reception
  P1OUT &= ~0x01;

while(1){
reset:
USICTL0 &= ~USIOE; //release MISO line
USICNT = 8;
USISRL = 0;
while(USICNT){if(SS)USICNT = 8;} // wait for a command
cmd = USISRL;
dbg_cnt++;

if(cmd==215)  //status byte
{
    USICTL0 |= USIOE; //turn on MISO (output)
USISRL = STATUS_WORD; // response word
USICNT = 8;
statcnt++;  //for debugging
while(USICNT); // wait a sending
if(SS) goto reset;
statcnt++;
}
else
if(cmd==119)  //status register
{
  USICTL0 |= USIOE;
for(i = 0; i < 3; i++) // put a dummy word
{
USISRL = 0;
USICNT = 8;
seccnt++;  //for debugging
while(USICNT);
if(SS) goto reset;
}
for(i = 0; i < 128; i++) // put a security response
{
USISRL = SECURITY_RESPONSE[i];
USICNT = 8;
seccnt++;  //for debugging
while(USICNT);
  if(SS) goto reset;
}
}
  }
}
Title: Re: DIY "GREEN DOT" Data Logger
Post by: travisc on August 04, 2013, 08:06:44 PM
Hi Everyone,

I'm new to the weather station community, but not so new to electronics.  I'm hoping I can help out a little with this green dot logger problem.  I just finished the layout of a new PCB.  I'm hoping it will be a tidy solution that combines a lot of progress the other members have already achieved.  I've combined an FTDI USB-Serial chip with a PIC and 1Mb Flash chip.  The board is the same size as the one belfryboy used for his logger, so it should fit nicely inside the console.

The idea is the PIC and the Flash chip sit on the SPI bus together.  The PIC holds the Flash chip in reset while it chats it up with the console to spoof the verification process.  Once that's done, the PIC will effectively remove itself from the bus and release the flash chip from reset.  From that point on the logger should have all the features of a standard 1Mb memory Davis logger.  Except with a much more reliable USB interface.

I haven't had a chance to test this yet as I just finished the design, but I'll be surprised if it doesn't work.  I should have a few proto boards in hand later this week.  About the same time my first weather station arrives.  :)

The schematic and a picture of the board is attached.  I intended to use Eagle for the board layout so it could be easily modified by others, but my patience got the best of me, sorry.  I'm much more familiar with other software.  Once the design is proven I'll be more than happy to share the gerbers and source code.

Special thanks goes out to torkelmj, DeKay, belfryboy, and rdsman, as this is mostly their work.  :-)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: SlowModem on August 04, 2013, 08:41:50 PM
Welcome and enjoy your stay!  :D  I'm sure your input will be well received.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on August 04, 2013, 11:07:14 PM
Well done, travisc!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: schaffer970 on August 05, 2013, 10:43:25 AM
travisc, if you are looking for guinea pig (tester) let me know.  I just got my brand new 6153 up and running this weekend.  Would love to try out your solution.  PM me.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: rdsman on August 05, 2013, 11:02:04 AM
Quote
Well done, travisc!

I'll second that!

Title: Re: DIY "GREEN DOT" Data Logger
Post by: travisc on August 08, 2013, 04:05:29 PM
I received the proto board today.  The VP2 arrived the other day so I should be all set to test this tonight.  I've already made the changes to the source code and tested it on a little console simulator I made.  Everything looks great on the logic analyzer.  I'll post again tonight with some more pics and results.

(http://www.frightideas.com/hobbies/logger/proto_board.jpg)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on August 08, 2013, 08:24:06 PM
I received the proto board today.  The VP2 arrived the other day so I should be all set to test this tonight.  I've already made the changes to the source code and tested it on a little console simulator I made.  Everything looks great on the logic analyzer.  I'll post again tonight with some more pics and results.

(http://www.frightideas.com/hobbies/logger/proto_board.jpg)

Epic!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: travisc on August 08, 2013, 09:52:13 PM
Looks like we're good to go!  I haven't hooked up the USB cable to test the serial port, but I know that'll work as that's already been proven by DeKay.  What I can confirm for certain is that the console is spoofed by the logger and then starts talking to the flash chip.

Here's how it works:
1. The console asks the flash chip for its status.
2. The flash chip (actual flash chip, not PIC) responds.
3. The console asks for the security register.  This is where the PIC barges in.  It immediately puts the flash into reset and takes control of the SPI MISO line.
4. The PIC sends the spoofed security register contents.  Then shuts down it's MISO line and releases the flash from reset.
5. A little while later the console checks the flash's status again, then sends a 0x53 command (Main memory page to buffer transfer) to transfer page 0 to the buffer.

That's as far as I've gotten.  I'm assuming next the console would read the buffer and determine the contents of the flash so it knows where to start logging.  But I have to setup my console and weather station to get any further.   :-|

Though this does look like it's been a success, I may make one small change.  After the PIC releases the flash from reset, it appears the flash needs some pulses of the CLK line before it's status is ready.  This can be seen on the logic analyzer.  So what you see before the 0x53 command is about 22 reads of the status register.  After that the flash responds as ready and the console sends the 0x53 command.  While this it totally valid, I'm sure it's different behaviour than a standard logger, which may give Davis a method of detecting this logger in a future version of firmware.  I may hack this board to control the flash's CS line instead of the RESET line to prevent this.

@DeKay:
You don't happen to have a Logic capture session saved from a valid green dot logger do you?  I'd love to see the timing on a valid logger so I could make sure this setup emulates it as closely as possible.  

Here's a few pics for those interested ...

The PCB after SMT components installed.
(http://www.frightideas.com/hobbies/logger/logger_smt.jpg)

Now from the side with the connectors and test points.
(http://www.frightideas.com/hobbies/logger/logger_th.jpg)

In the console while also connected to the logic analyzer.
(http://www.frightideas.com/hobbies/logger/logger_console.jpg)

If anyone wants to see the saleae logic capture session you can download below.  The action starts at 4536ms, then the 0x53 command is sent at 4808ms.
Saleae Logic File.zip (http://www.frightideas.com/hobbies/logger/PIC_Spoof_Capture.zip)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: dmurphydrtc on August 08, 2013, 10:22:43 PM
Travisc...great work. Are u a son of Torkel ???
Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on August 08, 2013, 11:54:34 PM
@DeKay:
You don't happen to have a Logic capture session saved from a valid green dot logger do you?  I'd love to see the timing on a valid logger so I could make sure this setup emulates it as closely as possible.  

Awesome work here, travisc.  I'm happy to try and help out.  However, I don't have a green dot logger.  My console predates all this stuff, and I've never owned a real Davis logger.  So what I'm about to provide here probably isn't useful.

I'm shooting a bit in the dark here.  My openbench logic sniffer program is crashing with a weird Java exception right now so I'm just going by filename.  Grab the OLS software from here (http://www.lxtreme.nl/ols/) and see if you can't import one of the files in the attached zip.  As the name implies, I think this capture is a data write to the flash chip.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on August 09, 2013, 03:17:02 AM
Travisc...great work. Are u a son of Torkel ???

I'd rather say like-minded. FWIW, apart from the PIC used here - I used the same approach when I assembled a data logger. Didn't turn out as appealing as this one, though - just wanted a proof-of-concept. Travisc has done a great job with this project! Now, what will be the next move from Hayward?
Title: Re: DIY "GREEN DOT" Data Logger
Post by: travisc on August 09, 2013, 02:37:57 PM
Awesome work here, travisc.  I'm happy to try and help out.  However, I don't have a green dot logger.  My console predates all this stuff, and I've never owned a real Davis logger.  So what I'm about to provide here probably isn't useful.
Thanks DeKay!  I think I confused myself there.  I remembered seeing a green dot logger in a screen shot, but that must have been in torkelmj's PDF.  Sorry, still getting familiar with the users here.  :)  In any case, the data you sent is useful to compare timing.  Thank you.

Quote from: torkelmj
I'd rather say like-minded. FWIW, apart from the PIC used here - I used the same approach when I assembled a data logger. Didn't turn out as appealing as this one, though - just wanted a proof-of-concept. Travisc has done a great job with this project! Now, what will be the next move from Hayward?
Thanks torkelmj!  Your excellent research on this topic made this possible.   :grin:

Now for a progress update.  In an attempt to eliminate the busy state on the flash chip after the reset, I spent the morning re-jiggering the prototype to control the CS line of the flash chip instead of the reset line.  After comparing the new captures with last night's, I realized that last night the flash wasn't responding as busy at all.  When I saw a command starting with D being sent to the chip, I assumed it was the status check command D7.   I should have paid closer attention, the console was actually sending the D2 command, which is a main memory page read.   So everything was working just fine as it was!  :oops:

That said, I'm glad I made this mistake.  It forced me to look into the flash chip's reset timing a little closer.  After being released from reset, the flash needs 1ms to wake up.  If I stuck with that technique, it could be a way for Davis to detect this was an invalid logger in future firmware.  If they did a read within 1ms of reading the security register it would likely return busy or nothing at all.  That'd be a tell for sure.

Next I'll get the USB cable attached so I can confirm the console is indeed logging data to the flash.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: travisc on August 09, 2013, 10:12:18 PM
Mission Accomplished.   :grin:

I tested the serial port using belfryboy's serial utility, then enabled logging...
(http://www.frightideas.com/hobbies/logger/serial_test.jpg)

Launched Cumulus for a second time after letting it sit for a while so the logger would have some data waiting.  The tiny text in the corner shows it downloaded 5 records from the flash ...
(http://www.frightideas.com/hobbies/logger/cumulus.jpg)

I'll make the final changes to the gerbers, clean up the code, then share it here tomorrow.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on August 10, 2013, 12:54:07 AM
Mission Accomplished.   :grin:

<snip>

I'll make the final changes to the gerbers, clean up the code, then share it here tomorrow.

Very impressive!  You must have been pretty psyched the first time you saw Cumulus was able to grab archive data.  I know I was.  And thanks for sharing your work for others to learn from, use, and build upon.

Just curious: what additional power draw does the PIC add?  Does it remain feasible to power the console by battery?
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Weather Display on August 10, 2013, 01:06:11 AM
good work!
kudos!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: travisc on August 10, 2013, 08:33:00 AM
Thanks guys.  This was only possible because of all the research and progress everyone here already made.  What I did was pretty easy in comparison.  That said, it did indeed feel good to see Cumulus pull in that data.  I just started it up again this morning and it downloaded another 500 or so records.  :)

As for power usage, I just tested the PIC.  It takes 2.36mA.  I've got it topped out right now since it has to control the flash's SS line in response to the console.  I wanted the timing to be as close as possible.  My original approach would have taken way less power as I could have put the processor to sleep in between bytes.  I guess I could have put it to sleep for good after the spoof, but I was trying to program it in such a way that it would still work if the console authorized more than once.

I've got some ideas for a version 2 if I can get some time.  I want to bump up to the next PIC chip, one of the PIC16LF1823 series.  It's only 50 cents or so more.  It has 6 more pins available that would allow us to connect directly to the serial lines of the USB chip.  Then we could implement a boot loader so the code could be easily updated in the future should Davis try to thwart our efforts again.  Users would just need to run a small program on their PC to update it, no PIC programmers or crazy stuff.  I could also design it in such a way that we have control over both the SS and reset line of the flash.  Then we could choose between either of my methods as needed.

I can definitely lay out the board.  The programming on that one would be more involved.  Anyone else here capable of implementing a boot loader on a PIC?  I've done it before a few times but I'm much more proficient with the CCS compiler.  If I use that then there's no free option for others to play.  MicroChip has some boot loader examples, we'd probably just have to modify one of those.


Title: Re: DIY "GREEN DOT" Data Logger
Post by: The pen is blue on August 12, 2013, 08:47:01 AM
Awesome. I feel a bit more comfortable looking at actually buying a Vantage Pro now I know that I have a chance at not having to fork out for an expensive logger too.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: travisc on August 12, 2013, 09:09:18 AM
Awesome. I feel a bit more comfortable looking at actually buying a Vantage Pro now I know that I have a chance at not having to fork out for an expensive logger too.
I agree.  I wouldn't have just bought one if I had to shell out $150 for a logger either.

I'm just about finished the second rev of the board.  I bumped up to the slightly larger chip so it can be firmware upgraded over USB.  It's cheap insurance if Davis blacklists the key or changes their approach.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Haku on August 13, 2013, 10:57:07 PM
After the mild disappointment with my experiments with the MSP430 I decided to give it another try with a more familiar MCU. But be warned, this is by far not as elegant as any of the solutions shown here (especially travisc's nice approach) but it might be OK if you don't want to solder much. I got a STM32F4Discovery board for $15. It comes with all you need except the USB cord and, of course, the 20pin connector for the console and a bunch of hook-up wires. The programmer is on the same circuit board but you might have to download the IDE. (I used Keil uVision4, which you can get for free with a 32kB code size limit. I guess you should not make commercial products with the evaluation version.)

OK. First the bad: the board is too big to fit on the back of the console. It likely consumes a bit too much power to be powered from batteries alone - I measured 21mA including the serial to USB converter - but that should be OK as you would be able to use the USB power anyway.

Now the not so bad: You don't need anything else as the board can be programmed to act as an UART to USB converter. The chip offers 1MB (i.e. 8Mbit) of flash and 192kB (1.5Mbit) of ram. So you could easily use this as your logger storage as well. I currently have the SPI unlock part running, which has been the main topics in this thread (again many thanks to all who have contributed to this!!) and the UART to USB converter, which allows you to connect the console to the PC. Latter comes from ST and other folks who have implemented a working VCP (see the Readme.txt for more info). The attached code should compile in Keil uVision 4 without modifications. It would likely be easy to add the logging part as well (look in the app.c file for starters), but I currently have no need for the logging part, as I have a linux box to fetch the data.

In any case, please note that this is only derivative work from what others have done – none of which is my achievement.
-Haku

btw: The attached files are split to comply with the 128kB attachment limit. They should be extracted into the same directory.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: samueltc on August 16, 2013, 03:43:09 PM
Code: [Select]
/*
  Arduino program to spoof the Green Dot Logger
  SPI interface.  (Causes the serial interface
  to be enabled?)
    
  by rdsman
    
  20 FEB 2013
  [...]

It needs to be tried out by someone!

Hi,

I tried the code with an Envoy without success. I tried a couple of things (I'm putting a lot of detail because I'm new to the microcontroller/electronic world and maybe I'm missing something obvious):

- Tested the spoofer with a Bus Pirate, I get the Status and Security register right when I query them (so it seem to works!).
- I thought that the delay in the Arduino bootloader could cause a problem, so I disabled the part in the Arduino bootloader code that check for an UART connection. It boot straight to the spoofer. (uploaded the bootloader and application via the ISP header using the buspirate as a programmer)
- The cable between the Arduino and the Envoy is 5cm long.
- I got 3.04v from the VCC of the Envoy.
- I tried to sniff the SPI bus without success, I see some data, but wrong value. (first time I sniff an spi bus, so maybe my settings/wiring are wrong?, I'm wiring MOSI/MISO/CLK/SS/GND in parallel, between the Envoy and Arduino)
- Using an FTDI Basic, I wired the TX to RX and RX to TX and GND to GND. I only get the "NO" whatever I type.
- No SIM is connected at the moment to my Envoy.
- The Arduino is a MEGA328P, 8hmz, 3.3v.

Thanks for your help!

Sam
Title: Re: DIY "GREEN DOT" Data Logger
Post by: travisc on August 16, 2013, 04:01:27 PM
Quote
I tried the code with an Envoy without success.

You may have the SPI mode set wrong on the Arduino's SPI hardware.  I'd try sniffing the Envoy by itself using the Bus Pirate to confirm the settings on the Bus Pirate are setup correctly.  You'll see the status request (0xD7), followed by the security register request (0x77).  On a console, those commands aren't sent until about 4 seconds after powers up.

Once you confirm that you see those commands correctly on the Bus Pirate, test your Arduino spoofer again using those same settings.  Only when you have both working should you connect them together.

Also make sure when the Bus Pirate is connected to the Envoy that it is a slave mode and not controlling the SDO line.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: rdsman on August 16, 2013, 05:47:56 PM
Quote
I'd try sniffing the Envoy by itself using the Bus Pirate to confirm the settings on the Bus Pirate are setup correctly.

I second that opinion!  Let us know when you have this working.  DeKay can most likely help you with this...........

Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on August 17, 2013, 07:54:20 PM
Quote
I'd try sniffing the Envoy by itself using the Bus Pirate to confirm the settings on the Bus Pirate are setup correctly.

I second that opinion!  Let us know when you have this working.  DeKay can most likely help you with this...........

Bad advice!  I've had issues with my Bus Pirate and SPI that I've never been able to sort out.  All the SPI stuff I've done has been with my logic analyzer.  I have heard that one of the keys to success though with the Bus Pirate and SPI is keeping the wires as short as you can.  Good luck.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: rdsman on August 18, 2013, 10:14:36 AM
Quote
Bad advice!  I've had issues with my Bus Pirate and SPI that I've never been able to sort out.

DeKay:

You did help - Don't use the Bus Pirate!

Title: Re: DIY "GREEN DOT" Data Logger
Post by: travisc on August 19, 2013, 10:31:40 PM
I finished the latest design for a green dot USB logger.  This design includes a slightly larger PIC chip.

This design has the following advantages over my previous design:
- Bootloading new PIC code over USB.
- Overriding flash chip control using either the CS or reset line.
- Debugging PIC code while the board is running in the logger.

I've ordered prototype boards from http://oshpark.com (http://oshpark.com).  The cost is $6.75 for 3 boards, free shipping.  At that price there's no sense trying to make your own.

The schematic and gerbers are attached.  I'll have source code available once I prove this design actually works. :)

Top:
(http://www.frightideas.com/hobbies/logger/v2_render_top.png)

Bottom:
(http://www.frightideas.com/hobbies/logger/v2_render_bot.png)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: TomOmniSmith on August 22, 2013, 09:53:14 AM
Hey sorry this might be a daft question but what's the specific components you are using? As there are a few versions of each?

Am planning to purchase from digikey.

Thanks
Title: Re: DIY "GREEN DOT" Data Logger
Post by: travisc on August 22, 2013, 05:01:09 PM
I updated the schematic above with part numbers.  Keep in mind I have not tested this design yet and I won't have any source code for a few weeks.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: JohnA on August 22, 2013, 05:26:35 PM
Travisc,

Two questions...

- Is it possible that you also publish the Gerbers of the first version of the board that was working?
- Is it possible that you can provide me with a programmed PIC for that version 1 board?

John
Title: Re: DIY "GREEN DOT" Data Logger
Post by: travisc on August 22, 2013, 05:36:53 PM
Two questions...

- Is it possible that you also publish the Gerbers of the first version of the board that was working?
- Is it possible that you can provide me with a programmed PIC for that version 1 board?

The gerbers are in this thread somewhere, but I don't have code for you.  I modified the code when I hacked the board to use the SS line instead of the reset line. I don't have a version of the code before I made all those changes.  Even if I did, I can't program a PIC for you.  I don't have sockets to program surface mount PICs out of circuit.  All my PIC programming is done using the in-circuit programming header, after the PIC is installed on the PCB.

The best I can do is sell you one of the new ones.  I'm not looking to start a side-business or anything, but I may sell a few of the extra prototype boards to users if they are interested.


Title: Re: DIY "GREEN DOT" Data Logger
Post by: JohnA on August 22, 2013, 05:44:38 PM
I'm absolutely interested if I can buy a board from you.

John
Title: Re: DIY "GREEN DOT" Data Logger
Post by: schaffer970 on August 22, 2013, 06:01:27 PM
I would also be interested in purchasing one.  Just got my 6153 up and running a couple of weeks ago and would like to communicate with it so I can put data online.

Thanks so much for the work you have done on getting a logger to work with the green dot stations!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: frozen on September 17, 2013, 06:48:37 PM
Hi all !

Just a few words first to thank all of you guys' who did a fantastic job helping screwed customers circumvent the Davis "green dot" data logger problem/scandal ! I read this forum since several weeks, in fact since I got my Vantage Vue.

I'm new in the weather stations hobby, except for some basic Oregon stuff, and recently decided that I wanted a "real" weather station capable of sharing it's data to wunderground.com (etc).

A good friend of mine, a real pro tech head, also purchased a wired Vantage pro ISS without even buying the console (on purpose)  :shock: ...

He needs weather data for a heating system management software that he's currently developing/writing (from scratch). He may join the discussion here soon, so I'll let him tell you more about his system if he wants/can/has time left... So, for now consider me as his authorized "spokesman" :lol:

The new approach
Now, about the "green dot" problem : He decided to take another approach : I told you that he purchased a wired Vantage pro "ISS", and now he has successfully managed to "listen" to the wired ISS data "stream", without having a console, and "decode" and log (etc) the not so raw data that's transmitted by it !

The idea was to "simply" hack the wired raw data (wireless is next step), and feed it to a Raspberry PI that will easily be able to make good use of it, probably much better than any crazy expensive so called logger sold by Davis (log, publish, analyze, graph etc).

He, and one of his techs employees, are now at work to get their hands on the same data from the wireless radio output from another ISS (868 - 868.6 MHz), a wireless one, apparently this "stream" is not encrypted in any way (they may also try with my Vue ISS). He will gladly accept any suggestions from you guys' !

Why bother to hack the "green dot" console if we can get, log and use the weather data from the ISS ?

Even better, if the radio feed is successfully hacked and fed to a Raspberry, those who own a wireless console would still be able to use both the Raspberry and the console at the same time. Isn't it a good approach that could solve the green dot problem for many of us ?

If successful he will use the system for his commercial heating management software but he's also absolutely 100% positive about sharing/posting the code, methods and hardware components he used to hack the ISS to the open source community.

Any thoughts ? Anyone interested ? Should I open an new thread about his approach ?
Title: Re: DIY "GREEN DOT" Data Logger
Post by: dmurphydrtc on September 17, 2013, 11:57:17 PM
Frozen,

Wireless hack of ISS already done and dusted...check this out, it works I've implemented the solution.

http://www.wxforum.net/index.php?topic=18718.0
Title: Re: DIY "GREEN DOT" Data Logger
Post by: samueltc on September 22, 2013, 06:11:15 PM
Frozen,

IIRC communication between ISS and Console/Envoy are over RS-422. Hope it help.

All the best,

Sam
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Banshee on September 22, 2013, 10:14:06 PM
Frozen,

Really like your concept.

I just rec'd my Davis 6152 (wireless) the other day. I want to be able solve the "Green Dot" problem so as to feed data log info to Weather Display (or similar program) via my RaspberryPi, thus eliminating the requirement for a hard wired link from the console to my iMac and freeing up the console to be used in a different room than the iMac.

I have the 3dr radio and antenna recommended from Tridge's post  http://www.wxforum.net/index.php?topic=18718.msg180492#msg180492 (http://www.wxforum.net/index.php?topic=18718.msg180492#msg180492) on order.

Thinking a version of Tridge's code, the 3dr radio, and USB RPi interface along with with Weather Display (as it supports the RPi) would do the trick.

Looking forward to any suggestions on the above setup or similar approaches.

Regards,
Banshee
Title: Re: DIY "GREEN DOT" Data Logger
Post by: travisc on October 26, 2013, 02:14:05 PM
I finally got some time to get back to this project.  I've got my rev B logger up and running in the console now.  I had to make one small change to get it working.  It's a very simple mod for anyone that's built some boards already (at least two have  :-)) .

Here's a pic of the assembled rev B board.  There's a bunch of extra headers on there for developing so ignore those.  It's got a little pull-cord on the top for easy removal.  Note the jumper in the centre where the diode should be.  That's the only change to get this working.
(http://www.frightideas.com/hobbies/logger/rev_c_dev.jpg)

I've already modified the schematic and gerbers with the final change.  There's a physical jumper instead of the diode.  The jumper only needs to be installed to power the PIC if the logger is out of the console.  This is for future use should we ever need to write a bootloader so the PIC can be updated over USB.  As of right now I haven't done that yet.

Here's the renders of the final gerbers...
(http://www.frightideas.com/hobbies/logger/rev_c_render_top.png)
(http://www.frightideas.com/hobbies/logger/rev_c_render_bot.png)

Attached is a zip file that contains the PIC source code, PIC hex file, updated schematic and gerbers.  The gerbers are ready to be uploaded to OSH Park should anyone else be interested in assembling their own.

Enjoy,
Travis

Title: Re: DIY "GREEN DOT" Data Logger
Post by: JohnA on October 26, 2013, 02:28:43 PM
Travis,

I only can say...thank you...thank you. Respect for this high quality solution  =D&gt;

I already have 3 PBC's from OSH Park laying around that I will change as mentioned in your'e update

John
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on October 26, 2013, 06:00:28 PM
Travis, congratulations on an excellent piece of work. Thanks for sharing.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: franzz on October 28, 2013, 05:29:09 PM
@travisc: Great Work!

I've one suggestion for implementation in PIC controler: If you want to use security registers for emulation which are not a dump of an existing Green Dot Logger but which are working with Console FW versions >= 3.0, you can use this security register content:

0xF7 , 0x00 , 0x04 , 0x08 , 0x0C , 0x10 , 0x14 , 0x18 , 0x1C , 0x21 , 0x25 , 0x29 , 0x2D , 0x31 , 0x35 , 0x39 ,
0x3D , 0x46 , 0x42 , 0x4E , 0x4A , 0x56 , 0x52 , 0x5E , 0x5A , 0x67 , 0x63 , 0x6F , 0x6B , 0x77 , 0x73 , 0x7F ,
0x7B , 0x8C , 0x88 , 0x84 , 0x80 , 0x9C , 0x98 , 0x94 , 0x90 , 0xAD , 0xA9 , 0xA5 , 0xA1 , 0xBD , 0xB9 , 0xB5 ,
0xB1 , 0xCA , 0xCE , 0xC2 , 0xC6 , 0xDA , 0xDE , 0xD2 , 0xD6 , 0xEB , 0xEF , 0xE3 , 0xE7 , 0xFB , 0xFF , 0xF3 ,
0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ,
0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ,
0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ,
0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF


As you can see the unique ID range (byte 64-123) is 0xFF which is for sure not implemented in any davis flash memory. The first range of the security registers (byte 0-63) is tuned to work with security checks of Davis Console. I've tested this configuration with Console FW 3.0 and Attiny85 (emulation software from torkelmj)

BR
franzz
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on October 28, 2013, 05:34:37 PM
Very interesting. Thanks!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on October 29, 2013, 06:45:21 AM
@travisc: Great Work!

I've one suggestion for implementation in PIC controler: If you want to use security registers for emulation which are not a dump of an existing Green Dot Logger but which are working with Console FW versions >= 3.0, you can use this security register content:

0xF7 , 0x00 , 0x04 , 0x08 , 0x0C , 0x10 , 0x14 , 0x18 , 0x1C , 0x21 , 0x25 , 0x29 , 0x2D , 0x31 , 0x35 , 0x39 ,
0x3D , 0x46 , 0x42 , 0x4E , 0x4A , 0x56 , 0x52 , 0x5E , 0x5A , 0x67 , 0x63 , 0x6F , 0x6B , 0x77 , 0x73 , 0x7F ,
0x7B , 0x8C , 0x88 , 0x84 , 0x80 , 0x9C , 0x98 , 0x94 , 0x90 , 0xAD , 0xA9 , 0xA5 , 0xA1 , 0xBD , 0xB9 , 0xB5 ,
0xB1 , 0xCA , 0xCE , 0xC2 , 0xC6 , 0xDA , 0xDE , 0xD2 , 0xD6 , 0xEB , 0xEF , 0xE3 , 0xE7 , 0xFB , 0xFF , 0xF3 ,
0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ,
0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ,
0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ,
0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF


As you can see the unique ID range (byte 64-123) is 0xFF which is for sure not implemented in any davis flash memory. The first range of the security registers (byte 0-63) is tuned to work with security checks of Davis Console. I've tested this configuration with Console FW 3.0 and Attiny85 (emulation software from torkelmj)

BR
franzz

@Franzz: could you share how you figured this out?  Have you determined the algorithm Davis uses to determine the security register?
Title: Re: DIY "GREEN DOT" Data Logger
Post by: franzz on October 29, 2013, 02:17:08 PM
@Franzz: could you share how you figured this out?  Have you determined the algorithm Davis uses to determine the security register?

I've just used my pattern which I've mentioned on the second page of this thread. I don't have determined the full algorithm Davis uses. I've tried many things based on my "0xFF" table, but I can't decode all secrets of Davis. One try was to shift the corresponding security register based on the 0xFF table with the value of unique ID register and so on. But this gives only success on about half of the registers.
I haven't spend any time into further decoding because of too less time and I'm still satisfied with torkelmj solution (emulation with attiny85) to get access to the serial interface. My next step regarding Davis Vantage Console will be to program a gateway (Raspberry PI) between the Davis world and my home automation system. I'm not sure if I should interface Davis with my datalogger emulation hardware or if I should take the smart way by using 3DR Radio hardware. (The 2nd one is the smarter one but I'm sure it needs much more time because of porting the software of tridge to 868Mhz band and using of 2nd transmitter).

BR
franzz
Title: Re: DIY "GREEN DOT" Data Logger
Post by: JohnA on October 29, 2013, 03:53:48 PM
Franzz,

I'm using the Torkel solution on a Vantage Vue in combination with a RaspberryPi, it is working perfectly.
There was a minor issue in the programming, the Vantage Vue didn't work with the code Torkel supplied, but I solved that and Torkel confirmed that this solution worked also on his Pro2.
I asked myself...If the serial solution that Torkel supplied is working fine (without memory) and also the solution that Travs supplied is working, why do I need the extra sucurity registers?


John
Title: Re: DIY "GREEN DOT" Data Logger
Post by: franzz on October 29, 2013, 04:16:16 PM
Franzz,

I'm using the Torkel solution on a Vantage Vue in combination with a RaspberryPi, it is working perfectly.
There was a minor issue in the programming, the Vantage Vue didn't work with the code Torkel supplied, but I solved that and Torkel confirmed that this solution worked also on his Pro2.
I asked myself...If the serial solution that Torkel supplied is working fine (without memory) and also the solution that Travs supplied is working, why do I need the extra sucurity registers?


John


@JohnA: I think there's a misunderstanding. What I proposed was that travisc could change the security register settings from his PIC program to my published secrity register table, because security register emulation of travisc is just a dump of an existing Davis logger (= copy of). ...nevertheless both will work. :-)

BR
franzz
Title: Re: DIY "GREEN DOT" Data Logger
Post by: JohnA on October 29, 2013, 04:34:42 PM
Ahh, that's it  :idea:

I'm still waiting for my new PicKit programmer.. After arrival I'll try your suggestion.

John
Title: Re: DIY "GREEN DOT" Data Logger
Post by: travisc on November 25, 2013, 03:12:28 PM
I've got one more logger available if anyone is interested.  They've been tested to work on Vantage Vue and VP2.  If anyone's interested send me a PM.  The price is $40 plus $9.50 shipping to anywhere in the USA.

A pic of the finished product is attached.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: watson on November 25, 2013, 04:39:03 PM
Hi guys.

I found the algorithm to get the "Davis programmed" 64 bytes starting from the Adesto chip "Factory Programmed" 64 bytes.
Do you want to know it?  8-)

To show you that I'm not kidding, if you give me any combination of 64 bytes I can post the corresponding 64 bytes obtained by the algorithm.

Cheers  ;)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on November 25, 2013, 07:03:30 PM
Awesome. Awaiting a description of the algorithm. And just as interesting: how you found it.

Cheers,

T.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on November 26, 2013, 06:10:26 AM
To show you that I'm not kidding, if you give me any combination of 64 bytes I can post the corresponding 64 bytes obtained by the algorithm.

0x01 , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ,
0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ,
0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ,
0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF

…and…

0xFF , 0x01 , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ,
0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ,
0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ,
0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF

…and…

0x01 , 0x01 , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ,
0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ,
0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ,
0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF

…and…

0x01 , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ,
0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ,
0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ,
0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0x01

…?
Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on November 26, 2013, 08:11:26 AM
Awesome. Awaiting a description of the algorithm. And just as interesting: how you found it.

Cheers,

T.

Ditto.  Please share!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on November 27, 2013, 05:54:18 PM
...the audience is waiting...
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Bushman on November 27, 2013, 08:08:45 PM
Maybe he's a OPW?
Title: Re: DIY "GREEN DOT" Data Logger
Post by: JohnA on November 28, 2013, 03:28:15 AM
For some kind of reason I expected this... :roll:

Title: Re: DIY "GREEN DOT" Data Logger
Post by: watson on November 28, 2013, 06:42:59 AM
@ torkelmj:

Well, your first three 64 bytes patterns works with this one:

0xHH, 0xHH, 0xHH, 0x08, 0x0C, 0x10, 0x14, 0x18, 0x1C, 0x21, 0x25, 0x29, 0x2D, 0x31, 0x35, 0x39,
0x3D, 0x46, 0x42, 0x4E, 0x4A, 0x56, 0x52, 0x5E, 0x5A, 0x67, 0x63, 0x6F, 0x6B, 0x77, 0x73, 0x7F,
0x7B, 0x8C, 0x88, 0x84, 0x80, 0x9C, 0x98, 0x94, 0x90, 0xAD, 0xA9, 0xA5, 0xA1, 0xBD, 0xB9, 0xB5,
0xB1, 0xCA, 0xCE, 0xC2, 0xC6, 0xDA, 0xDE, 0xD2, 0xD6, 0xEB, 0xEF, 0xE3, 0xE7, 0xFB, 0xFF, 0xF3

Last pattern works with this one:

0xHH, 0xHH, 0xHH, 0x08, 0x0C, 0x10, 0x14, 0x18, 0x1C, 0x21, 0x25, 0x29, 0x2D, 0x31, 0x35, 0x39,
0x3D, 0x46, 0x42, 0x4E, 0x4A, 0x56, 0x52, 0x5E, 0x5A, 0x67, 0x63, 0x6F, 0x6B, 0x77, 0x73, 0x7F,
0x7B, 0x8C, 0x88, 0x84, 0x80, 0x9C, 0x98, 0x94, 0x90, 0xAD, 0xA9, 0xA5, 0xA1, 0xBD, 0xB9, 0xB5,
0xB1, 0xCA, 0xCE, 0xC2, 0xC6, 0xDA, 0xDE, 0xD2, 0xD6, 0xEB, 0xEF, 0xE3, 0xE7, 0xFB, 0xFF, 0x18

NOTE:  "0xHH" means "whatever you want".
Davis places a serial num at the first three bytes, which are not relevant at auth stage.

Title: Re: DIY "GREEN DOT" Data Logger
Post by: JohnA on November 28, 2013, 07:03:39 AM
So this pattern should be working with the pattern Torkel supplied.
But is there also a universal pattern that we can always use or do I not understand this matter
Title: Re: DIY "GREEN DOT" Data Logger
Post by: watson on November 28, 2013, 07:20:00 AM
Quote
is there also a universal pattern that we can always use

No. The "Davis programmed" 64 bytes (first 64 bytes of Adesto Chip "Security Register") are always obtained from the Adesto chip "Factory Programmed" 64 bytes.

Accordingly to this, a sequence of universally valid "Davis programmed" 64 bytes can not exist.

Of course you can use any valid 128 bytes pattern (made of Davis algorithm-matched 64+64 bytes).
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on November 28, 2013, 07:39:09 AM
This is interesting. May I ask how you figured out the algorithm? ...and when the world will actually get to see it?  :roll:
Title: Re: DIY "GREEN DOT" Data Logger
Post by: JohnA on November 28, 2013, 08:08:19 AM
I'm also interested in how you figured this out.

If I understand it right... every Davis console comes out of the factory with a predefined algorithm that is different fore every device.
We now have one algorithm and programmed it in either the Torkel or Travis solution. It is working on the devices we've tested but it could also happen that this algorihm will not work on many other devices or if they change the firmware again, right ?
 
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on November 28, 2013, 08:11:20 AM
JohnA, how do you conclude there's a different algorithm involved for each console unit?
With all respect, I find that *totally* unlikely.

Also, why would a certain company want to risk rendering a large number of green dot-loggers useless by changing the authentication algorithm once again?  :shock:
Title: Re: DIY "GREEN DOT" Data Logger
Post by: watson on November 28, 2013, 08:15:52 AM
Quote
May I ask how you figured out the algorithm?

I spent a huge time looking at several valid "green dot" 128bytes patterns (looking for recurrences, cross-correlations, etc.)
Last week I finally had the right intuition :) I checked it immediately and It worked  =D&gt;

Quote
...and when the world will actually get to see it?

For me it is not a problem to share with you my work. I would do it gladly.
What I wonder is whether it can be "a problem" for us that the world may know that the algorithm has been really broken, since... Davis is part of this world  :???:

I manage hundreds of weather stations (vp2). In the current economic difficulties, for me it is essential to have the opportunity to use my own hardware to directly interface with the console. My doubt is that the public dissemination of this algorithm could push Davis to change it (probably reinforcing it). This would mean more months of work to break it again  ](*,)

Am I wrong? What do you think about this?
Title: Re: DIY "GREEN DOT" Data Logger
Post by: JohnA on November 28, 2013, 08:16:40 AM
Torkel

I thought that I read that in the reply from Watson

Quote
No. The "Davis programmed" 64 bytes (first 64 bytes of Adesto Chip "Security Register") are always obtained from the Adesto chip "Factory Programmed" 64 bytes

But I could read it all wrong  :roll:
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on November 28, 2013, 08:49:17 AM
Am I wrong? What do you think about this?

I had the pleasure of an informal lunch with an employee of a certain company when visiting CA and the Bay Area earlier this year. Having certain ...interests and helding associated memberships tend to open up some interesting communication channels. Now, what I learned was that (a) the "green dot"-policy wasn't too popular internally and (b) there's been a significant negative market feedback. Now, why would they risk even more negative PR and a lot of support fuzz by establishing *yet* another authentication scheme?

The VUE/VP2 product lines work quite OK. Surely - sooner or later - there will be a significant product upgrade, utilizing far more sophisticated technology than what's found in the present VUE/VP2 series. Two possibilities from there: open interface/API (fingers crossed, would be a huge benefit and a great selling point) or a *very* closed interface making use of some cheap, industry-standard encryption chip (read: as in a number of original printer ink cartridges).

I'll add that the present technology in the data logger units severely limits the authentication options.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on November 28, 2013, 08:54:50 AM
Quote
No. The "Davis programmed" 64 bytes (first 64 bytes of Adesto Chip "Security Register") are always obtained from the Adesto chip "Factory Programmed" 64 bytes

But I could read it all wrong  :roll:

The mentioned bytes reside on the memory chip in the data logger.
As long as *anything* can pretend to be a valid data logger, the authentication scheme isn't worth more than yesterday's newspapers. #-o

(And, sorry - I forgot: Happy Thanksgiving to our US friends).
Title: Re: DIY "GREEN DOT" Data Logger
Post by: chief-david on November 28, 2013, 08:56:55 AM
It is times like this where I have to say

its over my head.

Happy Thanksgiving
Title: Re: DIY "GREEN DOT" Data Logger
Post by: JohnA on November 28, 2013, 09:08:25 AM
Torkel

Thank you for explaining this  8-)
I thought the code was in the console.
So with the solution you and also Travis supplied every console can be used
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on November 28, 2013, 09:10:31 AM
So with the solution you and also Travis supplied every console can be used

Yes. In these solutions, we're just replying by sending already-known accepted values back to the console. 
Title: Re: DIY "GREEN DOT" Data Logger
Post by: JohnA on November 28, 2013, 09:19:04 AM
Check  ;)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: watson on November 28, 2013, 09:59:51 AM
@Torkel:

I basically agree with your beliefs.
So, let's bare it all.
Have fun guys.


Code: [Select]

u8 const GreenDot_Table[256] =
{
0x00, 0x04, 0x08, 0x0C, 0x10, 0x14, 0x18, 0x1C, 0x21, 0x25, 0x29, 0x2D, 0x31, 0x35, 0x39, 0x3D,
0x46, 0x42, 0x4E, 0x4A, 0x56, 0x52, 0x5E, 0x5A, 0x67, 0x63, 0x6F, 0x6B, 0x77, 0x73, 0x7F, 0x7B,
0x8C, 0x88, 0x84, 0x80, 0x9C, 0x98, 0x94, 0x90, 0xAD, 0xA9, 0xA5, 0xA1, 0xBD, 0xB9, 0xB5, 0xB1,
0xCA, 0xCE, 0xC2, 0xC6, 0xDA, 0xDE, 0xD2, 0xD6, 0xEB, 0xEF, 0xE3, 0xE7, 0xFB, 0xFF, 0xF3, 0xF7,
0x18, 0x1C, 0x10, 0x14, 0x08, 0x0C, 0x00, 0x04, 0x39, 0x3D, 0x31, 0x35, 0x29, 0x2D, 0x21, 0x25,
0x5E, 0x5A, 0x56, 0x52, 0x4E, 0x4A, 0x46, 0x42, 0x7F, 0x7B, 0x77, 0x73, 0x6F, 0x6B, 0x67, 0x63,
0x94, 0x90, 0x9C, 0x98, 0x84, 0x80, 0x8C, 0x88, 0xB5, 0xB1, 0xBD, 0xB9, 0xA5, 0xA1, 0xAD, 0xA9,
0xD2, 0xD6, 0xDA, 0xDE, 0xC2, 0xC6, 0xCA, 0xCE, 0xF3, 0xF7, 0xFB, 0xFF, 0xE3, 0xE7, 0xEB, 0xEF,
0x31, 0x35, 0x39, 0x3D, 0x21, 0x25, 0x29, 0x2D, 0x10, 0x14, 0x18, 0x1C, 0x00, 0x04, 0x08, 0x0C,
0x77, 0x73, 0x7F, 0x7B, 0x67, 0x63, 0x6F, 0x6B, 0x56, 0x52, 0x5E, 0x5A, 0x46, 0x42, 0x4E, 0x4A,
0xBD, 0xB9, 0xB5, 0xB1, 0xAD, 0xA9, 0xA5, 0xA1, 0x9C, 0x98, 0x94, 0x90, 0x8C, 0x88, 0x84, 0x80,
0xFB, 0xFF, 0xF3, 0xF7, 0xEB, 0xEF, 0xE3, 0xE7, 0xDA, 0xDE, 0xD2, 0xD6, 0xCA, 0xCE, 0xC2, 0xC6,
0x29, 0x2D, 0x21, 0x25, 0x39, 0x3D, 0x31, 0x35, 0x08, 0x0C, 0x00, 0x04, 0x18, 0x1C, 0x10, 0x14,
0x6F, 0x6B, 0x67, 0x63, 0x7F, 0x7B, 0x77, 0x73, 0x4E, 0x4A, 0x46, 0x42, 0x5E, 0x5A, 0x56, 0x52,
0xA5, 0xA1, 0xAD, 0xA9, 0xB5, 0xB1, 0xBD, 0xB9, 0x84, 0x80, 0x8C, 0x88, 0x94, 0x90, 0x9C, 0x98,
0xE3, 0xE7, 0xEB, 0xEF, 0xF3, 0xF7, 0xFB, 0xFF, 0xC2, 0xC6, 0xCA, 0xCE, 0xD2, 0xD6, 0xDA, 0xDE
};

u8 const Adesto_Factory_Programmed[64] =
{
  // put here AT45DB011D Security Register from byte 64 to 127
};

u8 OneTime_User_Programmable[64];

OneTime_User_Programmable[0] = 0x00; // or whatever you want
OneTime_User_Programmable[1] = 0x00; // or whatever you want
OneTime_User_Programmable[2] = 0x00; // or whatever you want

u8 n, value;

for(n=3;n<64;n++)
{
value = (u8)(Adesto_Factory_Programmed[n] + n);
OneTime_User_Programmable[n] = GreenDot_Table[value];
}

Title: Re: DIY "GREEN DOT" Data Logger
Post by: Bushman on November 28, 2013, 10:15:57 AM
I retract my OPW comment.  Brilliant! 

You know, I don't know why Davis just does not build in the interface (USB/serial) to the console and just up the price.  In these everything connected days I suspect most eventually hook the wx stn to the net.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Beaudog on November 28, 2013, 10:52:13 AM
And I don't understand why they keep the different setup for USB loggers.   It would save a lot of confusion and probably  support calls it they would just have everyone setup in serial mode.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on November 28, 2013, 10:58:00 AM
Very nice. Thanks for sharing. And for the effort put into figuring this out. Yes, some of the values in that 256-byte table look very ...familiar. ;)

A few interesting evenings ahead...
Title: Re: DIY "GREEN DOT" Data Logger
Post by: JohnA on November 28, 2013, 11:06:11 AM
Torkel,

Is it possible that this code can be used in the already made programming?
Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on November 28, 2013, 02:01:03 PM
@Torkel:

I basically agree with your beliefs.
So, let's bare it all.
Have fun guys.


Code: [Select]

u8 const GreenDot_Table[256] =
{
0x00, 0x04, 0x08, 0x0C, 0x10, 0x14, 0x18, 0x1C, 0x21, 0x25, 0x29, 0x2D, 0x31, 0x35, 0x39, 0x3D,
0x46, 0x42, 0x4E, 0x4A, 0x56, 0x52, 0x5E, 0x5A, 0x67, 0x63, 0x6F, 0x6B, 0x77, 0x73, 0x7F, 0x7B,
0x8C, 0x88, 0x84, 0x80, 0x9C, 0x98, 0x94, 0x90, 0xAD, 0xA9, 0xA5, 0xA1, 0xBD, 0xB9, 0xB5, 0xB1,
0xCA, 0xCE, 0xC2, 0xC6, 0xDA, 0xDE, 0xD2, 0xD6, 0xEB, 0xEF, 0xE3, 0xE7, 0xFB, 0xFF, 0xF3, 0xF7,
0x18, 0x1C, 0x10, 0x14, 0x08, 0x0C, 0x00, 0x04, 0x39, 0x3D, 0x31, 0x35, 0x29, 0x2D, 0x21, 0x25,
0x5E, 0x5A, 0x56, 0x52, 0x4E, 0x4A, 0x46, 0x42, 0x7F, 0x7B, 0x77, 0x73, 0x6F, 0x6B, 0x67, 0x63,
0x94, 0x90, 0x9C, 0x98, 0x84, 0x80, 0x8C, 0x88, 0xB5, 0xB1, 0xBD, 0xB9, 0xA5, 0xA1, 0xAD, 0xA9,
0xD2, 0xD6, 0xDA, 0xDE, 0xC2, 0xC6, 0xCA, 0xCE, 0xF3, 0xF7, 0xFB, 0xFF, 0xE3, 0xE7, 0xEB, 0xEF,
0x31, 0x35, 0x39, 0x3D, 0x21, 0x25, 0x29, 0x2D, 0x10, 0x14, 0x18, 0x1C, 0x00, 0x04, 0x08, 0x0C,
0x77, 0x73, 0x7F, 0x7B, 0x67, 0x63, 0x6F, 0x6B, 0x56, 0x52, 0x5E, 0x5A, 0x46, 0x42, 0x4E, 0x4A,
0xBD, 0xB9, 0xB5, 0xB1, 0xAD, 0xA9, 0xA5, 0xA1, 0x9C, 0x98, 0x94, 0x90, 0x8C, 0x88, 0x84, 0x80,
0xFB, 0xFF, 0xF3, 0xF7, 0xEB, 0xEF, 0xE3, 0xE7, 0xDA, 0xDE, 0xD2, 0xD6, 0xCA, 0xCE, 0xC2, 0xC6,
0x29, 0x2D, 0x21, 0x25, 0x39, 0x3D, 0x31, 0x35, 0x08, 0x0C, 0x00, 0x04, 0x18, 0x1C, 0x10, 0x14,
0x6F, 0x6B, 0x67, 0x63, 0x7F, 0x7B, 0x77, 0x73, 0x4E, 0x4A, 0x46, 0x42, 0x5E, 0x5A, 0x56, 0x52,
0xA5, 0xA1, 0xAD, 0xA9, 0xB5, 0xB1, 0xBD, 0xB9, 0x84, 0x80, 0x8C, 0x88, 0x94, 0x90, 0x9C, 0x98,
0xE3, 0xE7, 0xEB, 0xEF, 0xF3, 0xF7, 0xFB, 0xFF, 0xC2, 0xC6, 0xCA, 0xCE, 0xD2, 0xD6, 0xDA, 0xDE
};

u8 const Adesto_Factory_Programmed[64] =
{
  // put here AT45DB011D Security Register from byte 64 to 127
};

u8 OneTime_User_Programmable[64];

OneTime_User_Programmable[0] = 0x00; // or whatever you want
OneTime_User_Programmable[1] = 0x00; // or whatever you want
OneTime_User_Programmable[2] = 0x00; // or whatever you want

u8 n, value;

for(n=3;n<64;n++)
{
value = (u8)(Adesto_Factory_Programmed[n] + n);
OneTime_User_Programmable[n] = GreenDot_Table[value];
}



I will admit I was getting skeptical after we hadn't heard from you for a bit, and am glad you proved me wrong.  You've just re-enabled the cottage industry for third-party dataloggers that was temporarily shut down in a short-sighted act by Davis that screwed their own customers.  So let me just say...

THANK YOU!    \:D/
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on November 28, 2013, 07:27:57 PM
It all seems to verify OK. :)

If it hadn't been for the necessary evil called work, maybe - MAYBE - I'd gotten there myself, at least a bit further than what I actually did. Leaving out the first three numbers - I didn't get that far. I made a blind guess at variants of the CCITT-16 algorithm already implemented in the console FW. Once a few more details were revealed in this forum - the same number in the same index in two different IDs, yielding the same number at the same index in the security register - that's a strong hint and I worked on a matrix containing 128 values. :)

I bet you've got a number of data loggers available, to fill the entire matrix with the missing values ... here's what I'm getting, based on three different known original IDs and security register values.


I'll repeat myself and say thank you for sharing - and for devoting your time to digging into this.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on November 28, 2013, 07:43:30 PM
Is it possible that this code can be used in the already made programming?

It's of *significantly* more value to those who'd like to build data loggers themselves - using the same dataflash chips as Davis does, now being able to program them with security register values which will validate with the green dot consoles.

Also, I wouldn't be surprised if ANY random 64-byte device ID now can have corresponding, validating security register values. In that case, maintaining a "blacklist" of device IDs used to spoof the green dot consoles becomes a no-can-do.   \:D/
Title: Re: DIY "GREEN DOT" Data Logger
Post by: watson on November 28, 2013, 08:17:24 PM
Glad to have provided you a nice stuff  ;)

Quote
I bet you've got a number of data loggers available, to fill the entire matrix with the missing values

Uhm... well.. you do not need so many valid patterns to guess it ;) Look carefully at the matrix (my GreenDot_Table).
All you need is to get first 64 bytes (and you almost ALREADY got it! It's the 64 bytes answer to all "0xFF", left shifted by 1 pos).
The other 192 bytes of the GreenDot_Table is a stupid "copy and paste" of the first 64 bytes, with very poor permutations.
I show the first 4 coloumn (I do not think you'll struggle to find other..):

(http://95.141.37.21/temp/dp.png)

It was relatively simple. Much simpler than I feared.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: JohnA on November 29, 2013, 05:01:46 AM
Torkel,

Looking to what is found so far...

Do we have to change the programming with the new information ?

Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on November 29, 2013, 05:06:14 AM
Do we have to change the programming with the new information ?

No. No need to fix something which already works.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on November 30, 2013, 01:25:05 PM
Just a quick follow-up. Burning some midnight oil, I couldn't resist using the watson-provided algorithm to see if one of my VP2 consoles would accept just about any device ID and associated security register values. It seems that it does.  =D&gt;

A certain document has been updated to include a working BASCOM-AVR (AVR Studio is a bit too heavy for the PC used for fun stuff) implementation of a random device ID and corresponding security register values. I'm presently on my 56th console boot process, each one having been successful so far - with a different device ID being used at each boot.

Thanks to all of you, for your contributions. Now I'll walk the dog.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: JohnA on November 30, 2013, 03:03:13 PM
Thanks  \:D/
Title: Re: DIY "GREEN DOT" Data Logger
Post by: weatheroz on December 01, 2013, 08:08:53 PM
You know, I don't know why Davis just does not build in the interface (USB/serial) to the console and just up the price.  In these everything connected days I suspect most eventually hook the wx stn to the net.

Very late in to this thread, and disgusted that Davis has done this to their very loyal customers.

I'm about to replace my old and sun aged VP2 6162AU to a 6163, and was horrified to think that I wouldn't be able to use my old serial data logger with it.


But whilst you have a good idea of building in the USB/Serial interface, I think it would make the IP interface problematic.


With this green dot rubbish, I'm now thinking of going the IP datalogger, and just run a ethernet cable from the station in to my network, and have Weather Display grab the data from their instead of the serial interface.


Very well done to those who have gone the extra mile to create your own dataloggers for your Davis stations !!  :grin:
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on December 05, 2013, 04:18:08 AM
I have been playing with this for a few days and have just successfully programed the security register on one of my clone loggers \:D/ . I need a guinea pig to try out the interface, any volunteers?
Title: Re: DIY "GREEN DOT" Data Logger
Post by: JohnA on December 05, 2013, 04:49:44 AM
Can you be a little more specific?
Do you mean to test it in a logger that Travis designed?

John
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on December 05, 2013, 05:00:19 AM
Nope, if you trawl the forum you'll find that I was one of the first to supply 3rd party loggers, based on Dekays design. I have programmed the register on one of my clone loggers that uses the same chip as a davis logger, but i do not have a console to test it with.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on December 05, 2013, 06:10:02 AM
I have been playing with this for a few days and have just successfully programed the security register on one of my clone loggers \:D/ . I need a guinea pig to try out the interface, any volunteers?

I'd love to.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: JohnA on December 05, 2013, 06:34:07 AM
Nope, if you trawl the forum you'll find that I was one of the first to supply 3rd party loggers, based on Dekays design. I have programmed the register on one of my clone loggers that uses the same chip as a davis logger, but i do not have a console to test it with.


I have a logger from the Travis design. So if I can help and test you're programming on a Vantage Vue, I can help
I also can test with a logger from Torkel
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on December 05, 2013, 07:23:44 AM
JohnA,

I think you may still be misunderstanding. I physically have a clone logger with a programmed dataflash chip on it, just not a Davis console with the firmware that previously made my logger incompatible. I would like to post it to someone in the UK (or europe) to verify that it works.

torkelmj

where are you based?
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on December 05, 2013, 07:38:08 AM
below is the data from the security register, I would be great if someone could try it as an alternative to me send a logger by post

this has been calculated from the look up table (bytes 1-64)
0x2D 0x10 0x5E 0x1C 0x67 0xD6 0x98 0xA9 0x21 0x25 0xFB 0x2D 0x2D 0x31 0x4E 0x39
0x18 0x1C 0x63 0x0C 0x31 0x21 0x35 0x25 0xAD 0x94 0x6F 0x6F 0x6B 0x77 0x73 0x7F
0x98 0x8C 0x88 0x84 0x80 0x9C 0x98 0x94 0x90 0xAD 0xA9 0xA5 0xA1 0xBD 0xB9 0xB5
0xB1 0xCA 0xCE 0xC2 0xC6 0xDA 0xDE 0xD2 0xD6 0xEB 0xEF 0xE3 0xE7 0xFB 0xFF 0xF3

this was the pre-programmed part of the logger (bytes 65-128)
0x0B 0x03 0x14 0x04 0x14 0x32 0x1F 0x22 0x00 0x00 0x32 0x00 0xFF 0xFF 0x46 0xFF
0x30 0x30 0x4D 0x32 0x36 0x39 0x35 0x38 0x10 0x0D 0x42 0xFF 0xFF 0xFF 0xFF 0xFF
0x43 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
Title: Re: DIY "GREEN DOT" Data Logger
Post by: mcrossley on December 05, 2013, 07:48:29 AM
That is what I get from my spread sheet too :grin: Though I am not 100% sure what you should do with the first three bytes, translate them, or leave them 'as-is'?
Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on December 05, 2013, 08:34:36 PM
That is what I get from my spread sheet too :grin: Though I am not 100% sure what you should do with the first three bytes, translate them, or leave them 'as-is'?

It doesn't seem to matter.  Watson's (awesome) code just sets them to zero.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: JohnA on December 06, 2013, 03:07:17 AM
Minor question...

I have a friend with a Vantage Pro2 that also like to use the logger. So I'm going to build a 2nd logger, the Travis model, because I still have 2 of his PCB's laying around.
My question is, can I still use the programming Travis supplied with the v3 version or must I use the new supplied information.

John
 
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on December 06, 2013, 04:23:11 AM
I don't see any reason why the old data wouldn't work. The console do not talk to each other to see if another unit is using the same security details. Besides other are also using this data and not reporting problems.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: JohnA on December 06, 2013, 05:32:11 AM
You have a point... thanks
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on December 10, 2013, 06:14:10 AM
Well it looks like I may be back in the game! new set of boards coming from oshpark.com (http://oshpark.com) thanks to all those that have worked hard on this. I beleive the Dataflash option to be the least hassle and most cost effective, and now I have found a way to program the security register I should be able to produce clone loggers and wireless interfaces again!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on December 10, 2013, 07:12:00 AM
That's most welcome news. The wireless interfaces which were previously available look great!  =D&gt;
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Bushman on December 10, 2013, 09:12:18 AM
Since this is sorted, anyone considering adding an SD card to the DIY logger?
Title: Re: DIY "GREEN DOT" Data Logger
Post by: fcanete on December 10, 2013, 01:38:43 PM
Interesting post. I own a Vantage Vue UK model, and I'll made some test with an arduino uno...

Keep connected.

Thanks to all for this great work.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on December 10, 2013, 01:46:29 PM
Well it looks like I may be back in the game! new set of boards coming from oshpark.com (http://oshpark.com) thanks to all those that have worked hard on this. I beleive the Dataflash option to be the least hassle and most cost effective, and now I have found a way to program the security register I should be able to produce clone loggers and wireless interfaces again!

Good to see you back in business!  I was hoping it wouldn't take that long after watson's awesome discovery.  Somebody buy that guy a drink!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: watson on December 10, 2013, 04:25:07 PM
Quote
I was hoping it wouldn't take that long after watson's awesome discovery.  Somebody buy that guy a drink!

Well, if someone really wants to thank me.. he could send me some of his compatible loggers for free :)
I would gladly accept that gift, testing them on my network stations.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on December 10, 2013, 04:47:27 PM
Quote
I was hoping it wouldn't take that long after watson's awesome discovery.  Somebody buy that guy a drink!

Well, if someone really wants to thank me.. he could send me some of his compatible loggers for free :)
I would gladly accept that gift, testing them on my network stations.

no worries, send me a pm with your address and I'll get one in the mail, gratis.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: watson on December 10, 2013, 05:12:18 PM
Thank you a lot (ps.: just sent to your @hotmail.com)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on December 11, 2013, 09:54:18 AM
And for fun today I built a programming fixture that will enable me to read and program the dataflash chips before I solder them to the board.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on December 16, 2013, 01:50:31 PM
My boards are shipping from oshpark.com (http://oshpark.com) later this week, and I hope to have a few loggers available early in the new year. It feels just like Christmas with all this anticipation......
Title: Re: DIY "GREEN DOT" Data Logger
Post by: snapper on December 27, 2013, 01:15:16 PM
Hi

Just got a UK Vantage Vue  :grin: with firmware 3.0 and serial number starting MF.
Is this module available prebuilt in the UK? If so, how much is it and how do I order one?

I'm assuming it functions the same as the genuine version (i.e. USB output to PC and will log data ok)

Cheers!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on December 27, 2013, 01:49:45 PM
I will send you a personal message as soon as i get a chance to be near a pc. I hope to have these available early in the new year.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: duke666 on December 27, 2013, 02:33:11 PM
Quote
I should be able to produce clone loggers and wireless interfaces

I have totally missed any mention of 'wireless interfaces' and fail to find any mention of them in this thread. Could some one post a link with further information please?
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on December 27, 2013, 03:35:16 PM
belfryboy wireless pc data link (http://www.wxforum.net/index.php?topic=14653.0)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: fcanete on December 29, 2013, 09:20:11 AM
Hi

Just got a UK Vantage Vue  :grin: with firmware 3.0 and serial number starting MF.
Is this module available prebuilt in the UK? If so, how much is it and how do I order one?

I'm assuming it functions the same as the genuine version (i.e. USB output to PC and will log data ok)

Cheers!

I'm in the same boat, interested too...

Belfryboy, do you sell any of these loggers to Spain?

Thanks in advance, and have a very good new year 2014!!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: duke666 on January 08, 2014, 01:02:11 PM
Quote
belfryboy wireless pc data link (http://belfryboy wireless pc data link)

Thank you :-)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: ukwoody on January 11, 2014, 02:23:19 PM
Belfryboy.  Hi, just wanted to say my datalogger you supplied sometime back now (the original vue one) is still working great!  Good luck on the new updated version mate.

woody
Title: Re: DIY "GREEN DOT" Data Logger
Post by: snapper on January 11, 2014, 05:32:36 PM
And I got the new version of the logger in the post this morning.
Works great with my Vue with v3.0 firmware

Thanks Rob  :grin:
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on January 12, 2014, 11:13:03 AM
And I got the new version of the logger in the post this morning.
Works great with my Vue with v3.0 firmware

Thanks Rob  :grin:

Excellent news! this really does pave the way for more loggers to be produced. I am awaiting some boards from OSHpark, and I have uploaded the boards to the shared project area so that anyone that wants the bare PCB can order it direct from them.

clone datlogger pcb order (http://oshpark.com/shared_projects/XrOiaET6)

alternatively if anyone would like me to build one for them I am willing to do so. Price remains unchanged at £55 including free tracked postage worldwide. Just send me a Personal Message (http://www.wxforum.net/index.php?action=pm;sa=send;u=6969) and send you more information.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: schaffer970 on January 12, 2014, 11:14:11 PM
Also wanted to add that I received on of the loggers that travisc made.  Got it up and running this last week.  I am using 3.12 firmware on my 6153 and everything is working great. 

Thanks! to everyone that have made this possible.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: LittletonCOwx on January 15, 2014, 02:39:37 AM
Hello, new guy here.

I've recently been upgraded to a Davis Vantage Vue, and I've been spending a LOT of time here researching my options to get my WX data online, and just signed up.  First, I want to say thanks to some of you guys here for some of the EXCELLENT information on that front.  DeKay (Awesome blog!), torkelmj (VERY good job on the technical papers!), rdsman, SLOWeather, and belfryboy have been especially helpful.  Thanks guys!  =D&gt;

Anyway, the last time I looked at upgrading to a Davis was before the dreaded v3.0 firmware, and now that I have one, I see what has happened.  I think it is total bull that Davis would stick it to their customers like they have with 3.0.  For that reason alone, I WILL NOT buy any of the Davis datalogger options, which led me to this post here.

I just need a little bit of clarification though.  Is the datalogger linked above in belfryboy's post the USB or Serial version?  I'm not 100% sure and both have been discussed at times in this thread.

I'm looking at going with Meteobridge and that logger for ease and portability.  I have a Raspberry Pi I had been thinking about trying to use, but in the end the two solutions are about the same cost, and I like the idea of keeping the weather station stuff separate from everything else on my network.  Thanks in advance! :D
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on January 15, 2014, 03:25:27 AM
The belfryboy logger is USB but using the FTDI chipset so appears as a virtual serial port. 2 recent sales were to RaspberryPi users running Weewx.

I do also make a serial version as well for the same price.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: LittletonCOwx on January 15, 2014, 04:04:56 AM
The belfryboy logger is USB but using the FTDI chipset so appears as a virtual serial port. 2 recent sales were to RaspberryPi users running Weewx.

I do also make a serial version as well for the same price.

Thank you for the reply Rob! The part I don't personally like about using the RPi is that I'd have to set up some kind of wireless solution between the RPi and the Vue (XBee's or other), plus integrate it with some of the other stuff my RPi is doing on my network.  (That is, until such a time that the RPi can emulate the Vue console directly listening to the ISS, which sounds like it might not be too far off.)  I'd like to try and keep the weather stuff "isolated" from everything else if possible, for a few reasons.

The Meteobridge solution makes all of that pretty easy, and has the side benefit of a reasonable one-time payment for the upload/distro software, and an easy-to-use GUI (I despise programming).  A virtual serial port via USB is exactly what the TL-MR3020 wifi router is expecting too (based on my current understanding of what I've read so far).

Thanks again folks!  With any luck, I'll have my station up on the 'net soon!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: LittletonCOwx on January 15, 2014, 09:36:04 PM
Maybe another dumb question for belfryboy - Is your current logger design USB 2.0?  I've assumed it wasn't, but have been reading in my Meteobridge research that some of the newer Davis USB loggers are now USB 2.0.  TIA.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: akkasoglu on January 28, 2014, 12:59:16 PM
Hi guys, does this belfryboy data logger works with Davis Vue us version with 3.0 firmware? if it works what is this cables main advantage or disadvantage to the original Davis one?can it be used with Weatherlink and can it be used with meteobridge router?
Title: Re: DIY "GREEN DOT" Data Logger
Post by: LittletonCOwx on January 29, 2014, 05:04:44 PM
akkasoglu, take a look at my signature right above (and now below) your post.  It answers almost all of the questions you asked.  ;)

The logger/cable does everything the Davis one does, but is a bit less expensive, and you're not supporting Davis' price gouging of their customers for peripherals.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on February 03, 2014, 05:25:24 PM
Well that's the first 9 built and bagged to be shipped tomorrow! Thanks to all those that ordered early for all your patience  :grin: , I appreciate in the internet world that purchases usually turn up within a day or so. I will supply tracking details for each order as soon as I post them.

Next batch of boards have been ordered, I expect they'll arrive in a fortnight or so.

Title: Re: DIY "GREEN DOT" Data Logger
Post by: SlowModem on February 03, 2014, 08:07:29 PM
Next batch of boards have been ordered, I expect they'll arrive in a fortnight or so.

You'll have a factory in China cranking them out before you know it!   :roll:
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Bushman on February 03, 2014, 10:22:26 PM
Next batch of boards have been ordered, I expect they'll arrive in a fortnight or so.

You'll have a factory in China cranking them out before you know it!   :roll:
Then they would cost about 1/3 or less.   Take a  look at radio control aircraft receivers to see what I mean.
Title: Re: DIY "GREEN DOT" Data Logger - world class rip-off
Post by: Carnot on February 10, 2014, 08:09:24 AM
I have just joined WX. I bought a VP2 several years ago but for various reasons it was only commissioned in last year. My primary aim was to log the local weather as we have suffered a number of weather related floods in the past 10 years. I have been having a dialogue with the local authorities who have designed a flood defence based on a 1 in 100 year event. Total crap as their models suggest we would not flood. Our problem is the peak rainfall intensity which matters more that a 1 1n 100 event. We had two consecutive years of flooding which was a flash flood event  with the water gone in a matter of hours. I escaped but some neighbours got water in their properties.

I have now 2 VP2's operational. One in a field that I own and another on the house roof. My efforts with the data logger have been a disaster. I think WL is an abomination, and Davis a real disgrace the way the support the software for Mac users. I have done all the fixes, 32 bit, Sillabs driver, etc. I have tried Weathercat as well. I have a functioning meteobridge to transmit the data to wunderground. The only thing that works is the meteobridge. Wundergoround is connecting with meteobrdige (another story) but there is no data being transmitted . This also applies to WL and Weathercat. Both cannot connect to the weatherstation data logger and receive data. The Firmware on the first VP2 is 1.9 and the data logger is 2010 vintage with no green dot.

Meteobridge has a useful message log. It is trying to connect with the logger  but eventually times out. Boris at Meteobridge and myself think the data logger is kaput ( fantastic quality). Does anyone else have any ideas?

Needless to say I have been in contact with Belfryboy. Davis are not exactly top of my favourites with their crappy support.

Last but not least my field of work is a long way from weather. I am a petroleum chemist and I specialise on oil and gas matters, refining and petchems. If I can help someone I will do my best, but it is a bit off base.

Carnot
Title: Re: DIY "GREEN DOT" Data Logger
Post by: rdsman on February 10, 2014, 01:16:28 PM
You didn't specify which logger that your have.  Did you try sending "TEST" at the appropriate comm settings?

Title: Re: DIY "GREEN DOT" Data Logger
Post by: Carnot on February 10, 2014, 01:34:43 PM
Sorry, usb.logger and I downloaded the latest silicon labs driver. I tried the Test function on WL but nothing happened. It was not clear if this was for the USB serial or the dial up.

Thanks for the reply.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Beaudog on February 10, 2014, 01:43:52 PM
Do you have the logger set to serial mode. If not it will not work with any software except WL.

Did you try tcp mode?  If you initially set the logger up in USB mode you must run the special utility to reset it to serial mode.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Carnot on February 10, 2014, 05:22:47 PM
Beau dog, thanks for the reply. I am now travelling untilthe end of the week, so I cannot look or do anything until then. From recollection when I went through WL setup there was not a serial usb choice. Maybe I am looking in the wrong place. The options for connection were Bluetooth? And the slab uart usb. I do not think there was a tcp mode in the menu.

I usually can sort these things out, but this has stumped me. The mac WL is pretty poor in terms of instructions and help. Davis are not up to date with the drivers and finding the 32 bit fix was down to Google. If you can point me in the right direction I will have a go.

It is certainly possible it might be in serial mode but how do I check and fix it.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Beaudog on February 10, 2014, 06:37:20 PM
In the Wl folder>support>utilities is a program called CP210X USB to Serial Converter.

If you run this program it will set the logger to serial mode.

I am not a MAC user so I have no knowledge of MAC specific programs. But my WL has a setup page like this where I can choose serial, USB or TCP.   

This particular WL is running in TCP mode across my network.   

Hmm I just read the WL instructions for a MAC and I can't tell which mode you need to be in so I may be way off here.

Title: Re: DIY "GREEN DOT" Data Logger - world class rip-off
Post by: dalecoy on February 10, 2014, 07:35:10 PM
. Boris at Meteobridge and myself think the data logger is kaput ( fantastic quality). Does anyone else have any ideas?

I would normally ask about the source, etc. of this logger - and also ask if you followed the book procedure for installing/reinstalling -- and wonder why you put this discussion in a topic about DIY loggers -- but....

Isn't the logical first step to verify whether the logger is "kaput"?

Two reasonable ways would be: (1) take it to a friend who has a Windows computer and is willing to download the Windows version of WeatherLink, to see if that connects; and/or (2) take/send it to your nearest dealer for testing.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Carnot on February 11, 2014, 01:40:44 PM
Dale coy, thanks for the reply. In retrospect it might have been better for me to start a new thread. But, when I started trying to solve my problem I came across this thread and some earlier ones on the DIY solution. As week as the list of problems and others who feel Davis are taking advantage with the logger.

Firstly the dodgy logger is a genuine Davis installed with their instructions and the wrong driver to start with. Correct driver now installed and the 32 bit solution applied to WL.

The dodgy logger has been posted to belfry boy for testing  and I have purchased a belfry boy logger which will connect with the meteobridge to WU.

For me this was a very informative link. I did not understand everything but I really appreciate your efforts, and most of all your help.

I am just mad as hell at the cost of the logger and the woeful Davis back-up. If it worked out of the box, as it should it would not have been so bad.

By the way the original supplier went bust. I imported my second VP2 from the US at a massive  saving even with the freight and duties.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: dalecoy on February 11, 2014, 01:50:33 PM

The dodgy logger has been posted to belfry boy for testing  and I have purchased a belfry boy logger which will connect with the meteobridge to WU.


Excellent solutions.

By the way the original supplier went bust.

So, perhaps a bit of your anger might be directed at that supplier who didn't provide support?  [Yes, ultimately the manufacturer has responsibility, too].

I imported my second VP2 from the US at a massive  saving even with the freight and duties.

Understandable.  And hopefully that supplier will provide timely and responsive support if you need it.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: LittletonCOwx on February 11, 2014, 03:26:49 PM
Belfryboy,
My USB interface/logger from you should be here tomorrow! Yay! :D

In preparation for the last step in my setup, I have been doing some further reading, which led me to another question.  Do I have to go into the logger via a terminal editor like Realterm to set up the logging capability for your logger?  Is that something that is stored in non-volatile memory? (I would have to set it up via my laptop, then unplug and connect the logger to my Meteobridge.)

TIA!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on February 11, 2014, 04:39:51 PM
In preparation for the last step in my setup, I have been doing some further reading, which led me to another question.  Do I have to go into the logger via a terminal editor like Realterm to set up the logging capability for your logger?

That's right,

or you could use the logger setup facility that I had written, which can be found in my google drive folder here

Belfryboy logger setup (https://drive.google.com/folderview?id=0BxWPDCRn6BMXRGtxcXBDUGdNdnc&usp=sharing)

there is quite a lot of useful info there, but it was written some time ago, so please feel free to make suggestions as to how it could be improved.

Title: Re: DIY "GREEN DOT" Data Logger
Post by: LittletonCOwx on February 11, 2014, 04:44:56 PM
Excellent, thank you mate!  :cool: Will go have a look at it once I get home from work.  Really looking forward to finally getting this last piece of the puzzle into place!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: LittletonCOwx on February 13, 2014, 12:00:15 AM
WOOHOO!!!   :grin:  \:D/  :grin:  \:D/  :grin:  \:D/

I'm online!  :cool:  Installing the Belfryboy logger went smoothly, and the instructions he provided worked great!  =D&gt;  I had already set up my Meteobridge, so all I had to do was plug everything in (after powering down the console, of course).

I had hoped that since the FTDI chipset that Belfryboy uses in his logger is USB 2.0 compliant, I wouldn't need a USB hub to convert for the TP-LINK TL-MR3020 (which only accepts USB 2.0), but alas, no dice.   #-o  However, as soon as I plugged in the Belkin USB 2.0 4-port mini hub (F5U407) between the logger and the MR3020 Meteobridge router, everything started working immediately!

Here's my Wunderground page! (http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=KCOLITTL100)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: column5 on February 19, 2014, 09:23:08 PM
I have been lurking for a while and ordered the parts to build the logger here ( http://oshpark.com/shared_projects/XrOiaET6 ). I assembled it last night and I have a V3.x firmware console that reports "lcd ok.INCOMPATIBLE LOGGER" via the serial utility ( from here (WeatherStation.exe) https://drive.google.com/folderview?id=0BxWPDCRn6BMXRGtxcXBDUGdNdnc&usp=sharing ).

I suspect it might be that I need to program the security register? The PC recognizes the USB serial port, and I am able to see data come across as the console starts. If it is not the security register, I suspect I may of installed the 1MB memory chip incorrectly.

Any guidance/advice would be very helpful. Thank you all so much for the work you have done on this!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: LittletonCOwx on February 20, 2014, 01:12:33 PM
I have been lurking for a while and ordered the parts to build the logger here ( http://oshpark.com/shared_projects/XrOiaET6 ). I assembled it last night and I have a V3.x firmware console that reports "lcd ok.INCOMPATIBLE LOGGER" via the serial utility ( from here (WeatherStation.exe) https://drive.google.com/folderview?id=0BxWPDCRn6BMXRGtxcXBDUGdNdnc&usp=sharing ).

I suspect it might be that I need to program the security register? The PC recognizes the USB serial port, and I am able to see data come across as the console starts. If it is not the security register, I suspect I may of installed the 1MB memory chip incorrectly.

Any guidance/advice would be very helpful. Thank you all so much for the work you have done on this!

Yes, sounds like you are having the firmware v3.0 problem, and will indeed need to find a way to flash the security register.  I have on of Belfryboy's clone loggers with the flashed security register, and it has been working like a clock for the past week.   =D&gt;

I would kindly suggest to carefully re-read through the last 4 or 5 pages of this thread.  That should help you in flashing the Atmega chip (IC1).  Hopefully you have a way to directly interface to the chip, as I'm pretty sure that is the only way to flash the ROM.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on February 20, 2014, 01:43:47 PM
There are a couple references to this in my latest blog post (http://madscientistlabs.blogspot.com/2014/02/build-your-own-davis-weather-station_17.html).  You'll see a reference to Watson's algorithm to determine the bytes you need to program in plus a link to torkelmj's masterwork that has programming code for (IIRC) a PIC-based micro.  Otherwise, you might need to quickly code it up yourself on an Arduino or something unless perhaps Belfryboy has something he could share.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: column5 on February 20, 2014, 02:04:32 PM
Awesome, thank you guys. I have an Arduino that I could likely use, I will read back to page 4-5!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on February 20, 2014, 06:14:06 PM
Sorry for the delay in posting, I fell on my daughter and broke her leg :( so I have been a little preoccupied.

I program the dataflash security register using a Buspirate in SPI mode and the lookup table from Watson. I do all this using hyperterminal and Excel. If I get time I will write up a procedure, but I can't see that happening in the immediate future.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: EA1EF on August 03, 2014, 08:59:36 AM
we are interest in one build (or one to three units with combined shipping)

i send you a MP

edit: purchased one item for test,

thanks for your work
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on September 12, 2014, 06:10:38 AM
For those interested in DIY projects the upcoming winter (or summer, depending on location) - the enclosed schematics should be a good starting point for building your own data logger.  Not my own work, it was handed over to me by another weather station enthusiast who agreed to having it published here.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: HandyGeek on September 27, 2014, 08:39:36 PM
What is the status of the iBangkok24 & BelfryBoy projects, please?

I bought a non-Davis data cable years ago but due to the lack of a buffer could never get it to work properly.

It would be nice to get my older model Davis VantageVue data online.

Thanks! David
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on September 28, 2014, 04:19:12 AM
The belfryboy loggers are still being made, they work with the latest Davis firmware (AFAIK) and I know of forum members that are using them with WeatherDisplay, Cumulus, Meteohub, and Weatherlink.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: snapper on October 01, 2014, 09:33:39 AM
The belfryboy loggers are still being made, they work with the latest Davis firmware (AFAIK) and I know of forum members that are using them with WeatherDisplay, Cumulus, Meteohub, and Weatherlink.

Worked fine with weewx and VWS as well...
Title: Re: DIY "GREEN DOT" Data Logger
Post by: JoeBean on December 02, 2014, 12:47:04 PM
Hi all,
I've benefitted enormously from all the hard work done by everyone in this thread and have built several clone dataloggers successfully following the information here.  To give back in some small way I thought I'd do a quick how-to writeup for those who may read this but are too intimidated by the technical aspects to give it a try.  It's really not too hard!

What You'll Need
Parts:
belfryboy's PCBs from OSH Park (https://oshpark.com/shared_projects/XrOiaET6) (3 for $6.20)
From Mouser you'll need per datalogger: (http://mouser.com)
1 USB Cable (eg. Mouser #538-88738-8200) $2.91 each
1 PCB Header (798-DF11-20DS-2DSA05) $1.71 each
1 AT45DB011 (556-AT45DB011D-SSH-B) $1.05 each
1 10uF tantalum Case 'A' capacitor (647-F931A106MAA) $0.181 each
2 0.1uF ceramic capacitors (581-08055C104K) $0.121 each, $0.242 total)
1 FTDI FT232RL Serial-USB Interface (895-FT232RL) $5.43 each

So in Canadian dollars the total cost for parts is $17.72, assuming you just make the one and order no extras.  If you made all 3 you'd be around $13.58 each.  Quite a bit better than the $165 or so Davis lists the WeatherLink USB at!

I would recommend ordering extra AT45s at a minimum, though, as they're probably the most likely thing to mess up.

Tools & Supplies:
Soldering Iron with fine tip
Decent quality fine solder (eg. 0.031" Kester 60/40 (http://www.amazon.com/gp/product/B00068IJNQ))
Decent flux (eg. SRA #312 Flux Pen (http://www.amazon.com/gp/product/B008OC0E5M))
Arduino (eg. Arduino Uno (http://www.amazon.com/gp/product/B006H06TVG))
Some wire for connecting between AT45s and Arduino
Optional, SOIC8 Breakout Board or SOIC8 to DIP (if using Arduino with breadboard)
Optional, but recommended - an anti-static wrist band (http://www.amazon.com/gp/product/B004N8ZQKY)
Optional, but recommended if your hand is shaky like mine - An SMD rework station
     I use an Aoyue 968A+ rework station/soldering iron with Hakko tips and find it works well

Programming the AT45DB011D
If you are using a breakout board or a SOIC-DIP adapter solder the AT45 to the board. Edit/update Or buy a SOIC8 clip from aliexpress and use that to clip on the chip.  Much easier. End edit Soldering SMDs is a topic of it's own, so if you need help just google it.  I have neural issues and I shake quite a bit so I prefer to flux and tin the pads on the board first, then use an SMD rework heat gun to heat the solder and board while I use a set of tweezers to move the chip in place.
Alternatively, if you are using only wires, you can solder them directly to the pins of the AT45.  You should tin the wire and use the minimum amount of solder possible to attach the wires. Check each one to make sure it's firmly attached (pull gently) and not touching it's neighbour.
Connect the other end of the wires to the Arduino.  The pins of the AT45 are numbered like this:
    1   8
    2   7
    3   6
    4   5
If you look really carefully there'll be a tiny triangle or dimple at the #1 pin side (usually next to #1 pin).  These pins connect to the Arduino as follows:
    AT45DB011D  ------------  ARDUINO
    1 (SI/MOSI)   ------------  Pin 11
    2 (SCK)         ------------  Pin 13
    3 (RESET)      ------------  Pin 8
    4 (CS)          ------------  Pin 10
    5 (WP)         ------------  Pin 7
    6 (VCC)        ------------  3.3V
    7 (GND)        ------------  Ground
    8 (SO)          ------------  Pin 12

Once everything's connected open the Arduino application and open the Davis_Weatherlink_Programmer sketch attached to this post, or copy/paste the following into a blank sketch:
Code: [Select]
#include <SPI.h>
/*  This code by default reads the 64 byte unique Device Identifier on
    the attached AT45DB001D, outputs it to the console, and then calculates
    the 64 bytes to be programmed in the Security Register to match a
    genuine Davis Weatherlink interface, and outputs those 64 bytes
    to the console.  By uncommenting the last section in the setup() loop
    you can choose to program the Security Register. But first make sure that
    the read was successful and the calculated bytes are correct before enabling
    writing.
    *******
    NOTE:  YOU ONLY GET ONE CHANCE TO WRITE THE SECURITY REGISTER!
    So make sure communication with the AT45 is OK or you'll have a dead
    dataflash on your hands!
    *******
*/
   
//DataFlash Commands
#define DATAFLASH_READ_MANUFACTURER_AND_DEVICE_ID 0x9F
#define DATAFLASH_READ_SECURITY_REGISTER 0x77
#define DATAFLASH_STATUS_REGISTER_READ 0xD7
#define DATAFLASH_CHIP_ERASE_0 0xC7
#define DATAFLASH_CHIP_ERASE_1 0x94
#define DATAFLASH_CHIP_ERASE_2 0x80
#define DATAFLASH_CHIP_ERASE_3 0x9A
#define DATAFLASH_READ_SECURITY_REGISTER 0x77
#define DATAFLASH_PROGRAM_SECURITY_REGISTER_0 0x9B
#define DATAFLASH_PROGRAM_SECURITY_REGISTER_1 0x00
#define DATAFLASH_PROGRAM_SECURITY_REGISTER_2 0x00
#define DATAFLASH_PROGRAM_SECURITY_REGISTER_3 0x00


//As per Watson's work described at http://www.wxforum.net/index.php?topic=18110.msg200376
int const GreenDot_Table[256] =
{
0x00, 0x04, 0x08, 0x0C, 0x10, 0x14, 0x18, 0x1C, 0x21, 0x25, 0x29, 0x2D, 0x31, 0x35, 0x39, 0x3D,
0x46, 0x42, 0x4E, 0x4A, 0x56, 0x52, 0x5E, 0x5A, 0x67, 0x63, 0x6F, 0x6B, 0x77, 0x73, 0x7F, 0x7B,
0x8C, 0x88, 0x84, 0x80, 0x9C, 0x98, 0x94, 0x90, 0xAD, 0xA9, 0xA5, 0xA1, 0xBD, 0xB9, 0xB5, 0xB1,
0xCA, 0xCE, 0xC2, 0xC6, 0xDA, 0xDE, 0xD2, 0xD6, 0xEB, 0xEF, 0xE3, 0xE7, 0xFB, 0xFF, 0xF3, 0xF7,
0x18, 0x1C, 0x10, 0x14, 0x08, 0x0C, 0x00, 0x04, 0x39, 0x3D, 0x31, 0x35, 0x29, 0x2D, 0x21, 0x25,
0x5E, 0x5A, 0x56, 0x52, 0x4E, 0x4A, 0x46, 0x42, 0x7F, 0x7B, 0x77, 0x73, 0x6F, 0x6B, 0x67, 0x63,
0x94, 0x90, 0x9C, 0x98, 0x84, 0x80, 0x8C, 0x88, 0xB5, 0xB1, 0xBD, 0xB9, 0xA5, 0xA1, 0xAD, 0xA9,
0xD2, 0xD6, 0xDA, 0xDE, 0xC2, 0xC6, 0xCA, 0xCE, 0xF3, 0xF7, 0xFB, 0xFF, 0xE3, 0xE7, 0xEB, 0xEF,
0x31, 0x35, 0x39, 0x3D, 0x21, 0x25, 0x29, 0x2D, 0x10, 0x14, 0x18, 0x1C, 0x00, 0x04, 0x08, 0x0C,
0x77, 0x73, 0x7F, 0x7B, 0x67, 0x63, 0x6F, 0x6B, 0x56, 0x52, 0x5E, 0x5A, 0x46, 0x42, 0x4E, 0x4A,
0xBD, 0xB9, 0xB5, 0xB1, 0xAD, 0xA9, 0xA5, 0xA1, 0x9C, 0x98, 0x94, 0x90, 0x8C, 0x88, 0x84, 0x80,
0xFB, 0xFF, 0xF3, 0xF7, 0xEB, 0xEF, 0xE3, 0xE7, 0xDA, 0xDE, 0xD2, 0xD6, 0xCA, 0xCE, 0xC2, 0xC6,
0x29, 0x2D, 0x21, 0x25, 0x39, 0x3D, 0x31, 0x35, 0x08, 0x0C, 0x00, 0x04, 0x18, 0x1C, 0x10, 0x14,
0x6F, 0x6B, 0x67, 0x63, 0x7F, 0x7B, 0x77, 0x73, 0x4E, 0x4A, 0x46, 0x42, 0x5E, 0x5A, 0x56, 0x52,
0xA5, 0xA1, 0xAD, 0xA9, 0xB5, 0xB1, 0xBD, 0xB9, 0x84, 0x80, 0x8C, 0x88, 0x94, 0x90, 0x9C, 0x98,
0xE3, 0xE7, 0xEB, 0xEF, 0xF3, 0xF7, 0xFB, 0xFF, 0xC2, 0xC6, 0xCA, 0xCE, 0xD2, 0xD6, 0xDA, 0xDE
};

/*  Pin connection definitions.  Pin connections between Arduino and Dataflash
    should be as follows:
    AT45DB011D  ------------  ARDUINO
    1 (SI/MOSI) ------------  Pin 11
    2 (SCK)     ------------  Pin 13
    3 (RESET)   ------------  Pin 8
    4 (CS)      ------------  Pin 10
    5 (WP)      ------------  Pin 7
    6 (VCC)     ------------  3.3V
    7 (GND)     ------------  Ground
    8 (SO)      ------------  Pin 12
   
    Note that pin #s on AT45DB are as follows:
    1   8
    2   7
    3   6
    4   5
   
    A breakout board for the SOIC package makes connections easier but isn't
    strictly necessary
*/
int csPin = 10;
int resetPin = 8;
int writeProtectPin = 7;

int delayTime = 500; //half-second typical delay

void setup(){
  //Initial setup & SPI Initialization
  pinMode(csPin,OUTPUT);
  SPI.begin();
  SPI.setDataMode(SPI_MODE3);
  SPI.setBitOrder(MSBFIRST);
  SPI.setClockDivider(SPI_CLOCK_DIV2);
  Serial.begin(19200);
  delay(delayTime*4); //wait 2 seconds before continuing

  //Begin communication tests
  Serial.println("Attempting communication with DataFlash...");
 
  //First we get the current status register
  uint8_t STATUS;
  digitalWrite(csPin,LOW);
  SPI.transfer(DATAFLASH_STATUS_REGISTER_READ);
  STATUS=SPI.transfer(0);
  digitalWrite(csPin,HIGH);
  Serial.print("Status Register: 0b");
  Serial.println(STATUS,BIN);
  Serial.println("Format: RDY MEMCOMP 0 0 1 1 SECPROT PAGESZ");
  delay(delayTime);
 
  //Next Manufacturer ID and Device ID
  byte MANUFACTURER_DEVICE_ID[4];
  digitalWrite(csPin,LOW);
  SPI.transfer(DATAFLASH_READ_MANUFACTURER_AND_DEVICE_ID);
  for (int i=0;i<4;i++){
    MANUFACTURER_DEVICE_ID[i]=SPI.transfer(0);
  }
  digitalWrite(csPin,HIGH);
 
  //Output result
  Serial.print("Manufacturer ID (Should be 0x1F): ");
  Serial.println(MANUFACTURER_DEVICE_ID[0],HEX);
  Serial.print("Device ID byte1 (should be 0x22): ");
  Serial.println(MANUFACTURER_DEVICE_ID[1],HEX);
  Serial.print("Device ID byte2 (should be 0x00): ");
  Serial.println(MANUFACTURER_DEVICE_ID[2],HEX);
  Serial.print("Length of Extended Device Info: ");
  Serial.println(MANUFACTURER_DEVICE_ID[3],HEX);
  delay(delayTime); 
 
 
  /*Security Register
  The Security Register consists of two 64-byte parts, composing a total
  of 128 bytes.  Bytes 0-63 are one-time user programmable.  Bytes 64-127
  are programmed at factory and can't be changed.  As outlined at
  http://www.wxforum.net/index.php?topic=18110.0 Davis calculates the first
  64 bytes based on an algorithm that uses the second 64 bytes and the values
  in the GreenDot_Table above.  Here we will read the 64 factory-programmed bytes
  and calculate what should be programmed for the other 64 bytes. 
 
  */
  byte FACTORY_SECURITY_REGISTER[64]; //Factory-programmed
  byte USER_SECURITY_REGISTER[64]; //Calculated by us
 
  //We need to read the entire 128 bytes in one shot. 
  //Start with verifying the first 64 bytes are unwritten
  Serial.println("Reading Security Register...");
  digitalWrite(csPin,LOW);
  SPI.transfer(DATAFLASH_READ_SECURITY_REGISTER);
  SPI.transfer(0x00);//dummy 1
  SPI.transfer(0x00);//dummy 2
  SPI.transfer(0x00);//dummy 3
 
  Serial.println("Checking that Programmable Register is empty (0xFF)...");
  for (int i=0;i<64;i++){
    uint8_t CURRENT_BYTE;
    CURRENT_BYTE=SPI.transfer(0x00);
   if (CURRENT_BYTE != 0xFF){
    Serial.print("Error!  Byte #");
    Serial.print(i);
    Serial.println(" is not 0xFF!!");
   }
  }
   
  // Read Factory programmed 64 Byte security Register
  Serial.println("Reading Factory-programmed Security Register..,.");
  for(int i=0;i<64;i++){
    int byteNumber = i+64;
    Serial.print(byteNumber);
    Serial.print(" - 0x");
    FACTORY_SECURITY_REGISTER[i]=SPI.transfer(0x00);
    Serial.println(FACTORY_SECURITY_REGISTER[i],HEX);
  }
  digitalWrite(csPin,HIGH);
  delay(delayTime);
 
  // Calculate User-programmable security bytes
  Serial.println("Calculating User-Programmable Security Register...");
  // The first 3 bytes can be anything.  Davis uses it as a serial number
  USER_SECURITY_REGISTER[0]=0x01; //I just used 1, 2, 3...  Change as you like
  USER_SECURITY_REGISTER[1]=0x02;
  USER_SECURITY_REGISTER[2]=0x03; 

  /* Calculate the remaining 61 bytes
  This is taken verbatim from Watson's post, above. location is the location
  in the green dot table that the value we need at position i is located. 
  Because we're using an 8-bit unsigned integer when the calculation below for
  location is greater than 255 it loops around and starts at 0 again.
  */
  uint8_t location,i;
  for ( i=3; i<64; i++){
    Serial.print("Byte #");
    Serial.print(i);
    location =  (uint8_t)FACTORY_SECURITY_REGISTER[i]+i;
    Serial.print("   Location in Table: ");
    Serial.print(location,DEC);
    USER_SECURITY_REGISTER[i] = GreenDot_Table[location];
    Serial.print("   Value: 0x");
    Serial.println(USER_SECURITY_REGISTER[i],HEX);
  }
  delay(delayTime);
 
  //Uncomment (remove the /* at the start and */ at the end) the lines
  //below to program the Security Register
/*
  boolean wait = true; //Make sure chip isn't busy
  while (wait == true){
    uint8_t STATUSREG;
    uint8_t NOTBUSY;
    digitalWrite(csPin,LOW);
    SPI.transfer(DATAFLASH_STATUS_REGISTER_READ);
    STATUSREG=SPI.transfer(0);
    digitalWrite(csPin,HIGH);
    NOTBUSY= getBit(STATUSREG, 7);
    if (NOTBUSY == 1){
     wait=false;
    }
  }

  digitalWrite(csPin,LOW);
  Serial.println("Programming security register...");
  SPI.transfer(DATAFLASH_PROGRAM_SECURITY_REGISTER_0);
  SPI.transfer(DATAFLASH_PROGRAM_SECURITY_REGISTER_1);
  SPI.transfer(DATAFLASH_PROGRAM_SECURITY_REGISTER_2);
  SPI.transfer(DATAFLASH_PROGRAM_SECURITY_REGISTER_3);
  for(int i=0;i<64;i++){
   Serial.print("Programming Byte ");
   Serial.println(i);
   SPI.transfer(USER_SECURITY_REGISTER[i]);
  }
  digitalWrite(csPin,HIGH); 
 
  //Verify everything wrote out OK
  wait=true; //Make sure chip isn't busy
  while (wait == true){
    uint8_t STATUSREG;
    uint8_t NOTBUSY;
    digitalWrite(csPin,LOW);
    SPI.transfer(DATAFLASH_STATUS_REGISTER_READ);
    STATUSREG=SPI.transfer(0);
    digitalWrite(csPin,HIGH);
    NOTBUSY= getBit(STATUSREG, 7);
    if (NOTBUSY == 1){
     wait=false;
    }
  }
  delay(delayTime);
 
  Serial.println("Verifying everything went OK...");
  byte VERIFY_SECURITY_REGISTER[128];
  digitalWrite(csPin,LOW);
  SPI.transfer(DATAFLASH_READ_SECURITY_REGISTER);
  SPI.transfer(0x00);//dummy 1
  SPI.transfer(0x00);//dummy 2
  SPI.transfer(0x00);//dummy 3
  for(int i=0;i<128;i++){
    VERIFY_SECURITY_REGISTER[i]=SPI.transfer(0x00);
  }
  digitalWrite(csPin,HIGH);
 
  boolean writeOk = true;
  for (int i=0;i<64;i++){
    if (USER_SECURITY_REGISTER[i]!=VERIFY_SECURITY_REGISTER[i]){
        Serial.print("Error at security register ");
        Serial.print(i);
        Serial.print(": Should be 0x");
        Serial.print(USER_SECURITY_REGISTER[i],HEX);
        Serial.print(".  Is 0x");
        Serial.print(VERIFY_SECURITY_REGISTER[i],HEX);
        Serial.println(".");       
        writeOk = false;
    }
  }
  if (writeOk == true){
      Serial.println("Looks like everything went great!");
   }
   else{
      Serial.println("Oh no!  There was a problem programming the security register!!");
   }

*/
}
void loop(){
}

uint8_t getBit(uint8_t bits, uint8_t pos){
   return (bits >> pos) & 0x01;
}

Upload the sketch to the Arduino, then open the Serial Monitor from the Arduino application.  You should see the results of some tests, including a status read (which would typically output 10001100), a check to make sure that the programmable register is empty/not programmed (should read all 0xFF, if not there's a problem with the chip or your connections),  output of the factory security register, and a calculation of bytes 3-63 that we have to program based on the factory security register (as per Watson's observation bytes 0-2 are a serial number and can be set to anything). 

You should get no errors and the output should be repeatable (ie. if you click the Reset button on top of the Arduino you should get the exact same output every time).  If you get errors check all your connections from the Arduino to the AT45. As per iBangkok24's observation try the other ground on the Arduino board to make sure that's not the problem.

Once everything appears OK you can uncomment (remove the /* and */) the section at the end of the code that deals with programming the security register.  Upload the program again.  This time the security register will be programmed, and afterwards it'll be verified.  Out of 8 chips I programmed one didn't work.  It refused to change one bit from 0xFF, likely due to either a defective chip or me damaging it with overheating or static electricity.

Once the chip is programmed you can remove it from the wires/breakout board.

Assembling everything
Tin the pads on the belfryboy board (EXCEPT the header tabs and possibly the U1 and IC1 pads if using a soldering iron, depending on technique).  Solder the 0.1uF capacitors to the places marked C1 and C2, being careful not to solder them together or solder the pads together.  Solder the 10uF tantalum capacitor to C3, with the grey stripe pointing towards U1's location (make sure this is installed the right way around as tantalum capacitors are polarized and will be destroyed if installed backwards).

Solder the FTDI RS232RL to the U1 location.  Note that on the top of the chip there's a tiny dimple at pin one.  That dimple should be located where the o is silkscreened on the board.  A rework station really comes in handy for soldering this high of a pin density chip unless you're really steady or really patient.  If you don't have a rework station solder just one pin so that the chip is in the proper orientation/location.  Then tack one of the pins on the opposite side.  Once that's done solder the rest of the pins.  Google SMD soldering for more examples of technique.

Solder the AT45 to IC1 location.  Note again that a o is silkscreened at pin 1 location.  Recall that we already identified pin one of the AT45 by the triangle and/or dimple located on the top of the chip.  Align the board and chip correctly and solder into place.

Insert the header from the BACK of the board (where the white rectangular outline is).  Looking at the header from the hole side the pins are numbered like this:
2  4  6  8 etc.
1  3  5  7

A careful look at the long side of the header near the bottom where the pins extend out of it you should see a triangle pointing upward at pin one.  See page 107 of this pdf (http://www.hirose.co.jp/cataloge_hp/en_DF11_20130411.pdf) for more details.

Pin 1 should insert into the hole with the white square outlining it on the PCB.  Push all the way in till it clicks.  Then solder the pins from the other side of the board, taking care not to short any to each other.

Finally, solder the USB cable to USB header.  The red wire goes to Vbus.  White is D-.  Green is D+.  The two black wires (one is actually bare wire with a black sleeve over it) go to Gnd. 

Finishing it up
Once you're done wiring you can pot the board with Techspray or epoxy, or wrap it in electrical tape, or just leave it as-is.  At your Davis console unplug power and remove the batteries.  Insert your new logger all the way into the port and route the wire appropriately.  Re-install the batteries and the cover and plug power back in.  Plug the USB cable into your PC and proceed to set it up as outlined by belfryboy (https://drive.google.com/folderview?id=0BxWPDCRn6BMXRGtxcXBDUGdNdnc&usp=sharing).

If you're using linux, you can use minicom to test communication (as outlined here (http://www.blueskybust.com/homewx.html)), although I never found that worked right for me the first time.  Instead, I installed weewx and ran wee_config_vantage as outlined here (http://www.weewx.com/docs/usersguide.htm#wee_config_vantage) to get things working.

Hopefully that helps someone out.  I realize this isn't new information but after spending several hours figuring things out I thought I'd try to simplify it for the next person who comes along.

Thanks again everyone for the service you've done in helping restart 3rd party dataloggers!!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on December 02, 2014, 01:38:04 PM
That is fantastic! Many thanks for sharing this with us.

And for fun I have knocked up a circuit to program the board. It use the FTDI FT232RL chip, an Arduino ProMini (3.3V 8MHz) and a ZIF socket like this one
(https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcR4P-ME1pjn4UL4liYtyzB2gg2Fo1CA6G7riQljkjVxA2orJFzN)

(https://644db4de3505c40a0444-327723bce298e3ff5813fb42baeefbaa.ssl.cf1.rackcdn.com/uploads/project/top_image/pVWvsZm8/i.png)

(https://644db4de3505c40a0444-327723bce298e3ff5813fb42baeefbaa.ssl.cf1.rackcdn.com/uploads/project/bottom_image/pVWvsZm8/i.png)

Here is the OSH  Park project DataFlash Programmer (https://oshpark.com/shared_projects/pVWvsZm8)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: rdsman on December 02, 2014, 04:33:28 PM
Joe:

Great job!

Ray

Title: Re: DIY "GREEN DOT" Data Logger
Post by: kobuki on December 03, 2014, 07:46:18 AM
JoeBean, very nice project. I'm wondering if it would be possible to simply use the Arduino for all the interfacing and emulate the logger's memory with it, too. Maybe a Moteino (http://lowpowerlab.com/moteino/) with the flash installed would be a possible candidate? One would still need the board from eg. OSHPark to be able to connect to the console, though.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on December 03, 2014, 09:19:59 PM
Hi all,
I've benefitted enormously from all the hard work done by everyone in this thread and have built several clone dataloggers successfully following the information here.  To give back in some small way I thought I'd do a quick how-to writeup for those who may read this but are too intimidated by the technical aspects to give it a try.  It's really not too hard!

THIS IS AWESOME!  Thank you!    =D&gt;
Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on December 03, 2014, 09:34:26 PM
JoeBean, very nice project. I'm wondering if it would be possible to simply use the Arduino for all the interfacing and emulate the logger's memory with it, too. Maybe a Moteino (http://lowpowerlab.com/moteino/) with the flash installed would be a possible candidate? One would still need the board from eg. OSHPark to be able to connect to the console, though.

I got halfway through doing something like this last winter and will hopefully pick it up again this winter.  The incredibly painful part of doing this is the Dataflash's bizarre support for page sizes that are either 256 bytes or 264 bytes.  Davis uses the latter whereas the flash chip on the Moteino is only capable of the former.  So to stay true to the Davis record size expected from any piece of software out there requires a lot of jumping through hoops that I got tired of.  That would then be followed by a bunch of testing to make sure the flash logging worked right for a bunch of different cases (eg. start logging in the right spot after a power loss, handle wraparound in the flash, etc).
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Uksa007 on December 03, 2014, 09:47:57 PM
For anyone that may be interested I had a need for a real RS232 (PC levels) logger, so I put together a solution using a MAX3221E, I also had a need for USB so I made a board that can do both.
I program the AT45DB011 memory in circuit, so it works with the "Green Dot" consoles.
Also flow control is configured so it should work with weatherlink software if you have a licence, e.g. could replace failed hardware.
Works great with Cumulus, and should work with any software that supports Davis Pro/Vue consoles.

Photos show prototypes built as RS232 on the Left and USB on the right.

Thought I might offer them for anyone that needs a RS232 solution or USB, or potentially both on the one board.

USB Version uses genuine FTDI USB chip, includes 2m USB Cable $50 USD order here (https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2P3E5Y7CH6BNW)
RS232 Version uses genuine MAX3221E chip, includes 1.5m DB9 Cable  $50 USD order here (https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MY2MYUXDE5ZGY)
Prices Include Free International Postage!

Send me a PM if you are interested
Title: Re: DIY "GREEN DOT" Data Logger
Post by: mathgui on December 06, 2014, 03:08:16 PM
Thanks Joe, that's a great writeup.  I got a little ahead of myself and soldered the chip on the board first.  Can the programming be done in-circuit, or do I need to desolder and remove before programming?  Thanks.
Ron
Title: Re: DIY "GREEN DOT" Data Logger
Post by: EA1EF on December 28, 2014, 12:14:31 PM
www.meteocampoo.es team

EDIT This problem dissapear by de moment and now it works fine EDIT

Hello, I report a extrange problem with the BelfryBoy green dot datalogger (USB), this problem probably are any thing from CONSOLE.

Resume: I only can receive the datalogger on Disagnostic Mode (pres and hold TEMP+HUM).

Explain: HARDWARE:

- Davis Vantage VUE (US) Console and ISS on 900Mhz (placed in SPAIN), the station came fron second hand buy and repaired by me, I have yhe low battery ISS problem and I replaced the supercap. Original AC and battery sourced. Test only battery sourced without AC power.
- PC with W7 ultimate and weatherlink 6.03.
- BelfryBoy green compatible datalogger USB

Problem:
none function on datalogger, nor plug and play recognized, not data transfer to software, unstable function.
test for reanimation:

- powerdown console (remove bateries). none results
- complete erase data of console (Disagnostic Mode (pres and hold TEMP+HUM then 2ND - CLEAR hold 6 seconds) none results
- unplug datalogger fron console and USB-PC port. (none results).

- casually y go to DIAGNOSTIC MODE then PC sound plug and play music an see as USB plug and play came ON anf port COM8 came back, test fron weather link and IT WORKS completely, download all datalogger, run test console and ISS, etc.

But get out fron diagnostic mode and COM USB disappears and none work.

www.meteocampoo.es team

Title: Re: DIY "GREEN DOT" Data Logger
Post by: djdiaz on February 07, 2015, 06:59:48 PM
Thanks for the great writeup Joe, and to all those who came before to make this possible. 

FWIW, I hand soldered leads onto my first AT45 chip and I think I killed it (arduino said programming failed).  Luckily I ordered 2 extra chips, and the second time I used solder paste and hot air to attach it to an SOIC8 breakout board I ordered from OSHPark at the same time I ordered belfryboy's pcb.  That time it worked like a champ, and I was able to re-heat the chip with hot air, remove it from the breakout board, then used the same method to attach it to the belfryboy board.  Everything else went smoothly and about 30 min later I had a working logger!

In case anyone is put off by the prospect of hand soldering the AT45 or the FTDI chip, solder paste and hot air are the way to go.  I have used the method described here several times with good success: https://www.youtube.com/watch?v=e5QxcKMNAEk (https://www.youtube.com/watch?v=e5QxcKMNAEk) (technique is discussed at 36:22).  I know it's not the right way, but it's a cost effective way to get into this type of work, and like I said, it worked for me on more than one occasion.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: JohnDoe1983 on February 08, 2015, 01:35:28 PM
Hi.

All of you guys impress me with your work. Even though I do not make any electronic hardware, it is a great pleasure to read you.

Wow!!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: andre58 on October 15, 2015, 05:22:21 PM
First post here, so i say hi to you all.
My name is André and i'm from the Netherlands.
I own a Vantage Vue since a couple of months and am working on a datalogger with wifi interface
using a ESP8266 Wifimodule.
The ESP8266 has some firmware loaded to act as a transparent UART and if things work out well
i should get the Vantage Vue data on every computer in my house.

However, i have a problem programming the AT45db011b.
I built an Arduino shield to program the AT45 and I'm 99% sure it's OK but it won't do it's job.
I tried several AT45's, but none of them even reads OK.

Now I realized that even though the AT45 is powered with 3.3V all the other pins still get
5V data from the arduino pins.
Could this possibly be the reason why i can't read or write my AT's and maybe kills them?
Any help is much appreciated.

Title: Re: DIY "GREEN DOT" Data Logger
Post by: Uksa007 on October 15, 2015, 05:50:25 PM
Hi,

Yes you need an arduino that is running on 3.3v.

I use a nano.

Regards.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: kobuki on October 15, 2015, 05:51:11 PM
A few things. In order to get effective help and to better understand what you're trying to do and what doesn't work, you should post the schematics and the complete code or the relevant parts of it. Several people were successful in programming the security chip, they will probably able to help (I care more about the radio protocol). Though, a glance at the AT45db011b DS hints that driving the input with 5V will not kill the part, even if its max Vcc is 3.6V.

OTOH, the console can only serve a single client at a time, if you use the published Davis serial protocol, even if you use a TCP stack to access it. It's the exact same protocol but on a different medium. It's command-based and bi-directional, so unless you roll your own interpreter for the data designed to be transmitted to a single receiver, you can't make use of it in multiple devices on your network. There is one product that is able to serve its own receievr and an original (or another other of the same device) Davis console at the same time, the MeteoBridge and its associated firmware.

Radio packets transmitted by the Vue ISS, however, can be received and fully interpreted anywhere within its range. They provide only the raw sensor data, though. Should yo decide to go on that route, there's plenty of info in the forums on that, as well.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: kobuki on October 15, 2015, 05:56:09 PM
Yes you need an arduino that is running on 3.3v.

I couldn't find anything in the DS to support that. I might have missed it, or it indeed works with 5V I/O and something else is the issue. Should that be the case, a simple resisor divider to drop the voltage from 5V to 3.3V should be able to make it work from the Arduino to the part. In the other direction, 3.3V should trigger the 5V ATMega inputs to HI just fine.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: andre58 on October 20, 2015, 01:06:45 PM
Kobuki, thanks for your reply and usefull information.
I do intent to write my own interpreter and this program will only run on one PC or Mac at the same time,
and that's the one I'm using at that time, so it's not a problem if it can't transmit to multiple computers.

The ESP8266 module I use is loaded with this firmware (https://github.com/beckdac/ESP8266-transparent-bridge).
I've used it succesfull with several other projects and it should be able to work for this project too.
I've attached the schematic and a picture of the PCB (without the AT45DB011 unfortunately).

Today I made another programming shield for this chip and used a CD4050 as a buffer between the 3V3 AT chip and the 5V Arduino ports, but still no succes in reading or writing the chip, so I'm not sure about what to try next. Any help on this is more than welcome.
Picture of the shield is also attached.


Title: Re: DIY "GREEN DOT" Data Logger
Post by: kobuki on October 20, 2015, 02:33:29 PM
An interesting iteration of the "how to connect to the Davis console serial port" project :) You're essentially duplicating the functionality of the WLIP product, but on WiFi. I think it's a pretty good and useful approach. (Do you plan to publish the PCB design sometime in the future?)

Unfortunately I can't help with the chip programming. I've bought a USB adapter from Belfryboy (old forum member here). He even sells just the pre-programmed chip IIRC. You might even be able to work together to add a WiFi-based interface to the repertoire :)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: BCJKiwi on October 20, 2015, 03:28:57 PM
You may not be aware that the VP2 cavity is much shallower than the Vue cavity so the design you have may not fit the VP2. The Vue cavity is ~ 24mm deep where the VP2 cavity is ~ 14mm deep.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: kobuki on October 20, 2015, 03:57:43 PM
Yeah, it would stick out at the back, but there it's not very visible. It also can't support the Envoy like this. There are newer revisions of the ESP8266 wifi chipset that are smd-solderable modules and even have better specs (scroll down on this page (http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family), most variants can be bought online for beans). A different design might be able to accomodate them and be small enough to support all devices...
Title: Re: DIY "GREEN DOT" Data Logger
Post by: DeKay on October 20, 2015, 08:42:17 PM
Kobuki, thanks for your reply and usefull information.
I do intent to write my own interpreter and this program will only run on one PC or Mac at the same time,
and that's the one I'm using at that time, so it's not a problem if it can't transmit to multiple computers.

The ESP8266 module I use is loaded with this firmware (https://github.com/beckdac/ESP8266-transparent-bridge).
I've used it succesfull with several other projects and it should be able to work for this project too.
I've attached the schematic and a picture of the PCB (without the AT45DB011 unfortunately).

Today I made another programming shield for this chip and used a CD4050 as a buffer between the 3V3 AT chip and the 5V Arduino ports, but still no succes in reading or writing the chip, so I'm not sure about what to try next. Any help on this is more than welcome.
Picture of the shield is also attached.

Back up a bit.  When you were running the bridge software with the ESP and the AT chip connected to the console, were you able to establish a comms link with the console?  Were you able to send messages to the console and get useful responses back?

Just asking, because if you have a newer firmware rev on the console, you won't be able to talk to the console, never mind the flash chip, unless the console itself sees a properly programmed flash chip.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: andre58 on October 21, 2015, 03:33:18 AM
I have not tried to contact the console with my PCB yet because I can't get the AT chip programmed.
I tried 3 or 4 of them but without success.
For anyone who want's to have a look I've attached the schematic of my (non working) programmer.
I think it should work, but as it does not I probably made some mistake so again all advice is welcome.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: kwjtm on October 21, 2015, 08:49:55 AM
Does anyone have a copy of the Belfryboy PCB file?  Links are dead to OSH Park.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: kobuki on October 21, 2015, 08:51:11 AM
Here. (https://oshpark.com/shared_projects/Q4pne4fy) --> a modified design for standard RS232

EDIT: Hmm, it's not his original. Maybe he took off his works from OSHPark after someone made and sold them en masse at online places. Too bad. Best to ask him, I guess.

It's still all up, see here (https://oshpark.com/profiles/belfryboy). --> original Belfryboy designs
Title: Re: DIY "GREEN DOT" Data Logger
Post by: rdsman on October 21, 2015, 10:12:59 AM
andre58:

My first question would be can you read a fresh chip?  (Not one that you have tried to program.)

Try reading the Status Register and the Manufacturer and Device ID Information.   
Title: Re: DIY "GREEN DOT" Data Logger
Post by: andre58 on October 21, 2015, 10:29:44 AM
No, I can't read fresh chips.
Status shows nothing and Manufacturer ID returns only zero's.
I bought 5 pieces and probably ruined one trying to program it.
The other ones I only tried to read without success.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: rdsman on October 21, 2015, 11:23:04 AM
andre58:

Can we see the code that you are using to read with?

Title: Re: DIY "GREEN DOT" Data Logger
Post by: andre58 on October 21, 2015, 01:00:09 PM
Of course, it is this code (http://www.wxforum.net/index.php?topic=18110.msg235399#msg235399) that JoeBean posted in this same thread on the previous page.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: rdsman on October 21, 2015, 01:39:25 PM
andre58:

Try inserting this just above SPI.begin();

Code: [Select]
pinMode(resetPin,OUTPUT);
digitalWrite(resetPin,HIGH);
pinMode(writeProtectPin,OUTPUT);
digitalWrite(writeProtectPin,HIGH);



Title: Re: DIY "GREEN DOT" Data Logger
Post by: kwjtm on October 21, 2015, 03:31:00 PM
Thanks.  First one under "here" appears to be the correct one.  Found and ordered the other one but it does not match up with the parts list on page 8 or 9.  Serial to USB chip has too many leads for the first board.

Appreciate the help.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: kobuki on October 21, 2015, 03:42:45 PM
Thanks.  First one under "here" appears to be the correct one.  Found and ordered the other one but it does not match up with the parts list on page 8 or 9.  Serial to USB chip has too many leads for the first board.

Here. (https://oshpark.com/shared_projects/Q4pne4fy)

EDIT: Hmm, it's not his original. Maybe he took off his works from OSHPark after someone made and sold them en masse at online places. Too bad. Best to ask him, I guess.

It's still all up, see here (https://oshpark.com/profiles/belfryboy).

You refer to this post, right? The first link is a modified design for standard RS232 line voltages (description is somewhere in this thread, can't remember the poster, sorry). The second link points to the original Belfryboy designs. Going to add comments so it's clear for later readers.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: andre58 on October 21, 2015, 04:01:36 PM
andre58:

Try inserting this just above SPI.begin();

Code: [Select]
pinMode(resetPin,OUTPUT);
digitalWrite(resetPin,HIGH);
pinMode(writeProtectPin,OUTPUT);
digitalWrite(writeProtectPin,HIGH);

I've added the lines of code you suggested, compiled and uploaded the sketch,
but still no read.

Tomorrow I will check if there's any data traffic between the Arduino and the AT45 with my oscilloscope.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: kwjtm on October 21, 2015, 04:08:31 PM
Thanks.  First one under "here" appears to be the correct one.  Found and ordered the other one but it does not match up with the parts list on page 8 or 9.  Serial to USB chip has too many leads for the first board.

Here. (https://oshpark.com/shared_projects/Q4pne4fy)

EDIT: Hmm, it's not his original. Maybe he took off his works from OSHPark after someone made and sold them en masse at online places. Too bad. Best to ask him, I guess.

It's still all up, see here (https://oshpark.com/profiles/belfryboy).

You refer to this post, right? The first link is a modified design for standard RS232 line voltages (description is somewhere in this thread, can't remember the poster, sorry). The second link points to the original Belfryboy designs. Going to add comments so it's clear for later readers.

Was referring to the first post.  Was referencing JoeBeans instructions and parts list on Page 9.  Looking at both now it appears there is a discrepancy in the parts list versus the boards.  Not sure what board he was referencing in his post as the link is dead but he does not have any resistors in his list.  The Serial to USB chip is larger than what is on the original board and won't fit.  Will have to do some further digging.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: rdsman on October 24, 2015, 12:41:35 PM
andre58:

I compiled the code that you are using with Arduino 1.6.5.  The SPI clock is totally messed up for some reason using:

Code: [Select]
SPI.setClockDivider(SPI_CLOCK_DIV2);

I changed it to:

Code: [Select]
SPI.setClockDivider(SPI_CLOCK_DIV32);

It made a big difference!

 
Title: Re: DIY "GREEN DOT" Data Logger
Post by: andre58 on October 27, 2015, 04:33:26 PM
@rdsman :
Sorry for the slow response.
Thanks very much for your help in this matter.
Unfortunately changing the clockdivider did not solve my problem.
I also removed the CD4050 buffer, but that also did not help, so I'm a bit out of ideas now.
I think I will order some more AT45's from another supplier and see if I get them read or programmed.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: sv2bzq on November 07, 2015, 06:20:51 PM
Hi ....
I recently bought a BelfryBoy logger and search for a driver installation of BelfryBoy logger and Meteobridge .
What should I do simply installed in the console of Davis and connected to Meteobridge the should I make another Regulating first .  ](*,)

George.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Bushman on November 07, 2015, 06:56:23 PM
No drivers are needed for the logger unless you are connecting to a PC.  If you are using  Meteobridge, configure the router with Meteobridge firmware and plug the logger into the USB port of the Meteobridged router.  And start transmitting weather info!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: sv2bzq on November 07, 2015, 07:04:35 PM
Ok thanks for the information .
Ι will be needed Usb Hub 2.0 between Logger and Meteobridge ?
I will try it tomorrow and let you know if everything went well.

George.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Bushman on November 07, 2015, 07:38:19 PM
Some people have reported that you do not need a USB hub in-between the logger and the Meteobridge.  It is recommened for the Davis logger for sure; you can try it both ways.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: kobuki on November 07, 2015, 07:43:29 PM
Ι will be needed Usb Hub 2.0 between Logger and Meteobridge ?

It depends on the router model you use. See here (http://www.meteobridge.com/wiki/index.php/Hardware), particularly text in red.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: sv2bzq on November 08, 2015, 05:38:32 AM
Ok all working fine .  :grin:
Finally allowing it to snap works with a Usb Hub 2.0 and the reason is that the station is in the cottage and do not be easy (if a problem occurs) to come again here .
Thanks for help .  =D&gt;

George.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Bushman on November 08, 2015, 10:12:02 AM
Sounds great! One thing you might consider is having the Meteobridge on a UPS power supply OR having the latest version on a USB stick.  That way if it reboots you don't have to worry about it hanging on loading the  system.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: warrenb on December 30, 2015, 12:15:13 PM
Is Belfryboy still selling his loggers? Just bought a new VP2 thinking the data logger in my Vue would work with it, alas the old "Incompatible logger" error has raised its head.
As I bought the Vue years ago and my VP2 from a different supplier,the original supplier not interested in replacing logger

Thanks
Title: Re: DIY "GREEN DOT" Data Logger
Post by: SLOweather on December 30, 2015, 12:57:41 PM
Is your Vue logger a Davis one? If so, they should swap it out for you.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: warrenb on December 30, 2015, 01:04:17 PM
As I say above, as the new station is from a different supplier to the Vue, neither is interested in swapping the logger. Here in the UK, you have to go through the suppliers to get a swap.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: belfryboy on December 30, 2015, 01:23:52 PM
I do still make them, I'm away from home at the moment, but I'll be knocking up another batch in the next week or so.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: warrenb on January 04, 2016, 05:16:23 AM
Purchase made, thanks very much.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: wylde007 on February 25, 2016, 05:25:09 PM
I have been reading intently the numerous threads on serial "porting" the Vantage Vue/VP2 and the dreaded "green dot" dilemma.  At first I had all of the pieces in my shopping cart for which to noodle about with af4ex's and DeKay's XBee wireless serial connection which I found both fascinating and mind-spiraling.

I have a smidgen of experience with electronics and circuitry, and only a rank amateur's understanding of programming and coding, but I am also blessed as a tinkerer and not afraid to, as some have said, "let the magic smoke out".

But on my review of the component parts I would need to build two XBee breakouts and various sundry other items, I would be spending over $100 at www.sparkfun.com just to get a third-party solution.  So I bit the bullet and picked up the Vue and WeatherLink ($116) from Ambient.

Here's what I am wondering - in future applications I know I can probably generate an XBee transmitter set using the Davis logger, but I have a Raspberry Pi running WEEWX which presently acts as the go-between for my console (Ambient Weather WS-2095) and the web.  Would there be any way - any benefit to the Forum - to read FROM a newer "green dot" Davis logger and break down the line-level or raw data stream for someone to look at?  I can't find where anyone has taken a direct data translation from a new logger and tried to create a facsimile, workaround, or bypass to the native security.

Maybe I missed it somewhere, but if there is interest and someone can give me a little "how to" for sniffing the Logger via the USB port, I could give it a go.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on February 25, 2016, 06:49:42 PM
Respectfully: no.

The Davis serial protocol specification is available for download from http://www.davisnet.com.

The SPI authentication process is well covered in this excellent forum and in a humble PDF document: http://lmgtfy.com/?q=Unlock+Davis+serial+line  ;)

Also, sniffing the logger via USB won't reveal much. That's simply not where the magic happens.

Unless my limited knowledge of the English language makes me miss the finer details of your post, there isn't much to be added.

73
Title: Re: DIY "GREEN DOT" Data Logger
Post by: wylde007 on February 25, 2016, 07:13:46 PM
Respectfully: no.
Well, alrighty then.
Quote
The Davis serial protocol specification is available for download from http://www.davisnet.com.

The SPI authentication process is well covered in this excellent forum and in a humble PDF document: http://lmgtfy.com/?q=Unlock+Davis+serial+line  ;)
LOL.  Humble to a fault, yeah?  :lol:

I read your "dissertation" and it was both thoughtful and humorous.  Unfortunately it is also above my pay grade at present, so I couldn't quite wrap my head around everything you had done, especially without having any of the components right here in front of me.
Quote
Also, sniffing the logger via USB won't reveal much. That's simply not where the magic happens.
I figured, but it didn't seem like a lot of other people had delved into it, at least with the "new" logger.

Since I also don't have unlimited resources OR free time, I try to be as efficient as possible in my creative endeavors.  Maximize my ROI, if you will. ;)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on February 25, 2016, 07:29:35 PM
The logger doesn't really do much - it's merely a level converter between the TTL levels utilized by the console and a traditional serial line (or a USB  interface) plus a bit of storage space. It's more of a pass-thru interface, really. The processing of commands and data all takes place in the console, which in turn talks to the logger's memory chip via the SPI interface.

You can have plenty of fun with an Arduino and the logger, though. Not very expensive, and it will get you started in no time.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: SystemsGuy on February 27, 2016, 06:12:30 PM
You can have plenty of fun with an Arduino and the logger, though. Not very expensive, and it will get you started in no time.

The above is very true - I wasn't able to get torkelmj's attiny to work - most likely due to my ignorance of BASCOM, but I was able to use the information he provided, and what's in the forum to code my own using the Arduino IDE.

The only caveat would be to make sure you have a 3v Arduino. :-)

Speaking of which - big "thanks" to all the brave souls who wandered down this road before, and who shared the knowledge to allow others to follow.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: miguel.nuno.oliveira on February 28, 2016, 06:14:25 PM
Hi.

The the arduino code is working fine with a 3.3V mini pro. The board fits nicely behind the battery cover of the vantage VU.

Regards,

MNO
Title: Re: DIY "GREEN DOT" Data Logger
Post by: djibb on March 31, 2017, 12:32:14 PM
Hi all :)

In my school, I've just bought a VP2 and I have a raspberry. And we're hacking ;)

As I see, I can't use RPI's GPIO directly in order to logs measures cause my VP2 is "protected" by firmware.

I understood I need a modchip (arduino/atmel etc.) to discuss with VP2's SPI bus and make free discussion with GPIOs.

But i really have a noob question... really noob question.

Raspberry have a SPI interface. Why not connect it and program it in order to have GPIO <-> VP2 discussion working ?
On other words : why not wiring SPI+GPIO bus from Raps ? Why another SPI interface is needed ?

Txs a lot for all work present here.

JB


Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on March 31, 2017, 12:58:32 PM
Simply because you can't.

Google SPI MASTER MODE and SPI SLAVE MODE. Then figure out what the RPi supports and whether the VP2 console is a SLAVE or a MASTER.

(Bonus: you learned something from asking that question).
Title: Re: DIY "GREEN DOT" Data Logger
Post by: djibb on April 01, 2017, 08:53:44 AM
Thanks a lot :) Indeed, I've learned something great !

A little piece of code could (with guru abalities) allow us to have a slave mode on raspberry pip : https://github.com/hendric-git/bsc-slave

And something I don't undertstand : I've read SPI Bus can be emulate by GPIO : http://terminal28.blogspot.fr/2015/12/bitbanging-spi-on-raspberry-pi-via-spi.html
http://www.sciencegizmo.com.au/?p=105
Is this a dead end possibility ? Or should we dig more ?


Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on April 01, 2017, 11:58:39 PM
By all means, feel free to try - and then document and share your findings.

A cold shower, though:
The RPi doesn't come with a real-time OS (AFAIK). The SPI communication rate is fast and proper timing is crucial. Wire length is also to be kept at a minimum.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Bushman on April 02, 2017, 12:48:33 AM
Does not come with it, but certainly available:  http://www.stevebate.net/chibios-rpi/GettingStarted.html  Amongst other options.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Mattk on April 02, 2017, 05:43:39 AM
Maybe the heroes producing and selling green dot loggers should also go into their own business and produce their own complete stations as well, like lets face we have to put up with this green dot logger inconvenience because some just had to pirate the hardware which is not a problem for their own use but obviously some don't care about the rest when they then try to profit from it.     
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on April 02, 2017, 08:31:56 AM
Careful now.

"Pirating" is a harsh accusation.

I can't imagine that anyone makes a living or a serious income from selling "pirated" loggers.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Bushman on April 02, 2017, 11:55:02 AM
Pirated?  How exactly?
Title: Re: DIY "GREEN DOT" Data Logger
Post by: johnd on April 02, 2017, 12:41:02 PM
I wouldn't use that word personally, but it seems plausible that the (re)appearance of clone loggers led directly to the green dot changes. Debatable whether that was the right response from Davis - it might have been better to reset the relative prices of station and logger more in proportion to their respective BoM's and remove the implied discount on the stations, but I guess that was more a marketing decision.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Mattk on April 02, 2017, 06:05:50 PM
Well some can call it what they like really, some may even think there is no relationship to the appearance of "cloned" loggers but until somebody can provide a plausible answer then I will continue to call a spade a spade and get quite p$ssed off because half my loggers won't work in the other half of my consoles. Talking double digit units here not just some one off setup. Maybe the minority should think twice next time before creating a headache for the majority, definitely not appreciated.     
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Bushman on April 02, 2017, 07:14:45 PM
The only way Davis will prevent such "piracy" (ha!) of the logger is to modernize the console with built-in connectivity. Imagine - it is 2017 and we have no built-in connection.  Hell, my toaster is connected to the Internet!
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Mattk on April 02, 2017, 07:38:38 PM
The only way Davis will prevent such "piracy" (ha!) of the logger is to modernize the console with built-in connectivity. Imagine - it is 2017 and we have no built-in connection.  Hell, my toaster is connected to the Internet!

And if you have ever spoken to Greg Ashton he would call a toaster connected to the internet as technology gone mad, waste of time, IoT is completely misunderstood by many.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: Bushman on April 02, 2017, 08:37:37 PM
It was a joke, actually.  But, my smoker IS connected to the Internet!  You have no idea how useful that is while waiting for the "stall" on a Boston Butt to end.  I can be out in the fishing boat and the app notifies me to return to the dock to deal with BBQ.  Just because some "guru" says the IoT is not understood by many doe not mean it cannot have value.

regardless, my point on Davis is still valid: the logger is archaic (but it goes nicely with the circa 70's console)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on April 05, 2017, 11:52:01 AM
Maybe the minority should think twice next time before creating a headache for the majority, definitely not appreciated.   

That's one view of the world. I beg to differ.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on July 06, 2017, 11:59:59 AM
hi,
My Vue is #6250 and Mfg code of ME18041xxxx.  'VER' returns May 1 2012. 'NVER' returns 3.0.

this is C source code for a funny experiments.
Code: [Select]
/*
 * compiler: Microchip XC8
 *
 *    PIC12F1822
 *     +--+ +--+
 * VCC |1  ~  8| GND
 *     |2     7| SDO
 *     |3     6| SCK
 *  SS |4     5| SDI
 *     +-------+
 */

// ... ... ...



Did anyone successfully implement & run this program?

I'm attempting to move from the AVR world to the PIC universe but I can't get this simple program to work as expected. While it works as intended when hooked up to a BusPirate, it certainly doesn't unlock the VP2 console (resulting in the "PLL NOT LCK" console message... which I believe refers to the radio/CC1021 configuration which also takes place on the same SPI bus).

I'm making ONE change to the original code, namely the LVP=ON pragma in order to use the Curiosity board programmer.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: kobuki on July 06, 2017, 12:20:26 PM
I'm attempting to move from the AVR world to the PIC universe ...
Well, I'm aware this is not really on topic, but still...

May I ask, why? Isn't the generally accepted approach is to choose the most appropriate tool (chip, vendor, etc.) for a given purpose? Of course, considering other constraints, like available support (which tends to be huge for AVR, thanks mainly to the Arduino), accumulated skill level, ease of use, available compilers and tools, accessibility, etc. In other words, what does the PIC do for you that the AVR doesn't? I'm not defending any, but I must note that accessibility and support makes the AVR(/Arduino) side incomparably easier to use. Also, fun fact: Microchip now owns both the "world" and the "universe" as well ;)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on July 06, 2017, 01:06:01 PM
It seems that the 8-pin ATTinys don't support SPI in mode 3. The VUEs seem to be picky about this.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: kobuki on July 06, 2017, 01:07:18 PM
Ah. Strong argument.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: kashima on July 07, 2017, 12:29:54 AM
Did anyone successfully implement & run this program?

Yes, it is working on my vantage vue.
I have wrote the HEX to the PIC using a PIC Start Plus.

HEX file are follows:

 [ You are not allowed to view attachments ]
Title: Re: DIY "GREEN DOT" Data Logger
Post by: torkelmj on July 07, 2017, 02:55:55 AM
Thanks. I'll just have to keep digging into this.
Again, my only change to the code is enabling low-voltage programming. Somehow the SS line seems to be pulled low way too early.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: night303 on April 18, 2018, 01:56:01 PM
Hello guys, my first post, but not first time I'm on this forum :)

During time I found some valuable information about Davis' v3 interface here, and devised few of my own solutions that I implemented successfuly on 5+ Davis Vantage Vue and Vantage Pro stations that operate 24/7 for years. So let me share that with you.

I read great PDF about Davis v3 protocol (http://meteo.annoyingdesigns.com/DavisSPI.pdf) by torkelmj and decided to make v3 emulator presented in that document. So I bought few ATTiny85 chips, already had programmer, and as base board I used interface board by belfryboy and simplified it. To skip USB->TTL->RS232->TTL conversion I reduced it to USB->TTL, reducing the cost and complexity, while keeping communication in perfect order. Also, since Davis' proprietary software interface costs money, I use Cumulus to stay in free software&hardware domain.

My design uses cheap USB->TTL cable from eBay, it's tested with Windows7 and Windows10 with latest updates and it works fine, it uses Prolific PL2302HX chip, and drivers are available from Prolific site. If it shows exclamation mark in Device Manager just reboot computer and it will work. Also I got info that it works with Raspberry Pi, but didn't tested it myself.
Can be bought here for 1.5 USD (link to specific seller is just for picture reference, you can buy from any seller, there are plenty on eBay offering exactly this same cable) : https://www.ebay.com/itm/USB-To-RS232-TTL-UART-PL2303HX-Auto-Converter-USB-to-COM-Cable-Adapter-Module/201539573206 (https://www.ebay.com/itm/USB-To-RS232-TTL-UART-PL2303HX-Auto-Converter-USB-to-COM-Cable-Adapter-Module/201539573206) My board has three pins that connects to this cable marked with letters on solder mask (G-green, W-white, B-black) for easier connecting.

Boards can be ordered directly from OSHPark or downloaded and made in any PCB factory you like, I designed board and put open-source-hardware mark, feel free to improve it if you like, and hopefully share design with others. If someone wants schematic and board in Eagle format, I can attach them. Just board is here : https://oshpark.com/shared_projects/M0mczaXC (https://oshpark.com/shared_projects/M0mczaXC)

Software in ATTiny is compiled from Bascom sources from above mentioned PDF, they are work of user watson from this forum. I'm attaching HEX files, but important thing is that AVR hex doesn't contain fuse bits information so you will have to specify them while programming chip. They are : Lock : 0xFF, FuseLow : 0xC1, FuseHigh : 0xDF, FuseExtended : 0xFF. It is important to program them correctly, else program won't work. For me both constant and random versions of firmware worked, but to be sure use constant version.

Besides ATTiny85, you will need : 1k or 470R resistor in SMD 0805 format, 0.1uF ceramic capacitor in SMD 1206 format and 3v Zener diode in SMD MINIMELF format. Capacitor is used as bypass cap, actually not needed in this application, but I put it for a good practice. Resistor and Zener are used to clamp 5V from USB->TTL cable to 3V, it worked for me even with 5V, but for a good practice it's better to clamp voltage as microcontroller in Davis operates at 3V. Only remaining part is 2x10 female header with 2mm pitch. Original data logger uses header that is a bit longer than ones I could find, by not pressing it directly to board, but soldering it with 1mm space between header plastic and board will do the trick and header will go firmly into expansion port.

So that's my solution, all for around 10 bucks. Once again, many many thanks to all users from this forum that made this interface possible, especially three mentioned above. Great work guys!

 [ You are not allowed to view attachments ]   [ You are not allowed to view attachments ]
Title: Re: DIY "GREEN DOT" Data Logger
Post by: 92merc on April 18, 2018, 05:02:51 PM
After working with the Software Designed Radio's with the NOAA weather radio, I wish I was smart enough to combine a SDR to retrieve the Davis ISS signal, and combine it with a Raspberry PI.  Basically turn the PI into a Weather Link IP.  In short, a replacement for a full console and data logger.

Only other issue is that you would need to add an external barometer and temp gauge to truly match what a console does.

Alas, I'm not a programmer. 
Title: Re: DIY "GREEN DOT" Data Logger
Post by: vreihen on April 18, 2018, 05:39:48 PM
Some of the SDR heavy lifting has already been done.....

https://github.com/bemasher/rtldavis (https://github.com/bemasher/rtldavis)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: 92merc on April 19, 2018, 09:12:37 AM
My idea was to basically create a replacement for the Virtual VP program.  Have a PI receive the data via SDR.  Then have a small database running on the PI.  Have it dish out the live data just like Virtual VP did.  Ideally via IP and multiple ports, and possible a serial driver.

Then have the data base store a history, basically like the data logger.  But also keep a history of when the last communication a particular port handed out the data.  Have a couple of weeks worth of data similar to what VVP could have done.

Like I said, I'm not a programmer.  But if you'd combine a copy of weewx or Cumulus MX on the same machine, you'd have a potent little device.  And you'd run it a lot cheaper than a second console and logger.  But you'd still need a barometer connected to it as well as probably an inside temp if you truly are replacing the console.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: pfletch101 on April 19, 2018, 10:22:56 AM
Like I said, I'm not a programmer.  But if you'd combine a copy of weewx or Cumulus MX on the same machine, you'd have a potent little device.  And you'd run it a lot cheaper than a second console and logger.  But you'd still need a barometer connected to it as well as probably an inside temp if you truly are replacing the console.

Assuming that you already have the Pi and an SDR dongle, you can get and use an Ambient Temp/humidity sensor (which can be located where you want it, rather than being constrained by the location of the Pi, with its power supply) for just over $10.00, and a decent barometer sensor to wire to the Pi for about the same amount. Some programming would be required, of course.  :-)
Title: Re: DIY "GREEN DOT" Data Logger
Post by: pfletch101 on April 19, 2018, 09:14:36 PM
Some of the SDR heavy lifting has already been done.....

https://github.com/bemasher/rtldavis (https://github.com/bemasher/rtldavis)

Sadly, this project appears to be a 'work in progress' that stopped progressing a couple of years ago.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: vreihen on April 20, 2018, 07:04:42 AM
Note that I said "some" of the heavy lifting.  Unlike many of the consumer 433Mhz stations, Davis uses frequency hopping that adds an extra layer of complexity when trying to snag packets with an SDR.

IIRC, the above code can follow the frequency hops and collect data, but is missing the decoder part.  Since Boris/MeteoStick/MB-Pro have figured this out, it is obviously possible to decode the information.  My uneducated guess would be that Davis sends the exact same packet data over the air that they send to a wired console, so it may just be a matter of finding any progress made on decoding that and joining it to the SDR code.....
Title: Re: DIY "GREEN DOT" Data Logger
Post by: kobuki on April 20, 2018, 07:45:37 AM
On the air packet format and transmit scheduling is the same as on wire. The code in the mentioned repo can decode the radio packets and there are already a handful of solutions to make use of them, including my own here (https://github.com/kobuki/weewx-meteoRX). If someone adept in golang could come up with a daemon that can serve the packets via eg. a simple tcp or unix socket interface (based on the bemasher repo), I'm willing to add handler code to my fork of the weewx driver.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: pfletch101 on April 20, 2018, 10:24:34 AM
In my (admittedly fairly brief) tests, with an antenna located within a few inches of a Davis console which shows excellent reception, and a good-quality SDR (that works very well with Ambient TH sensors), the software was apparently only able to detect/decode occasional transmissions. Life is too short - for me, at least - to try to use/debug/modify unsupported software in a language that I don't 'speak'. YMMV.

I will be sticking to downloading the data from the USB logger in my console, for now.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: kobuki on April 21, 2018, 06:39:55 AM
So this solution doesn't look reliable with the existing software. Too bad...
Title: Re: DIY "GREEN DOT" Data Logger
Post by: vreihen on April 21, 2018, 08:20:04 AM
So this solution doesn't look reliable with the existing software. Too bad...

For some background, I have only had my Davis VP2 for about a month now, after wrestling with various hacks to collect data from other consumer-oriented stations for years.

The only reason why I have not pursued these Davis hack setups any further is because of what I learned above.  If the SDR locks up or overflows the USB bus, you lose data.  If you have to shut down your logging computer with a serial or USB-connected console, you lose data.  Starting to see a recurring theme here?  I lost three weeks of data due to an unexpected hospital stay, combined with a USB bus lockup with an SDR.

My eyes were opened when I was setting up a genuine Davis USB logger a few weeks ago.  I needed to shut down my new weewx Raspberry Pi to install a realtime clock, and I was *floored* when I saw the weewx Vantage driver backfill data from the time that the computer was down thanks to its internal memory!   Made me realize that Davis calls the thing a "logger" because it has memory to LOG data...even when the connected device is offline.  Maybe data continuity means less to others, but the Davis logger is worth the price to me compared with options that do not have replay capabilities if the connected computer is down.

I do have the desire to crack the Davis wired console code one day, to put a Raspberry Pi or NodeMCU inside a wired VP2 ISS to make a wifi weather station.  Purely for the technical challenge, not something that I would ever personally use unless I could obtain the Davis logger's reliability levels.....
Title: Re: DIY "GREEN DOT" Data Logger
Post by: kobuki on April 21, 2018, 08:41:56 AM
My receiver (https://github.com/kobuki/VPTools/tree/master/Examples/WxReceiver) and the weewx driver (https://github.com/kobuki/weewx-meteoRX) has been working stable for years. Currently the receiver has a bug that prevents correct reception of US channels and since I only have EU equipment I can't fix it easily. Just give it a try (or another one (https://github.com/mcrossley/VPTools/tree/master/Examples/RelayRxTx) based on mine) sometime. It doesn't have log memory, though. It's running mostly on RPi3 devices in the wild and some of them are running from UPS solutions so they don't lose data on blackouts. The driver has been extensively tuned by me and also its upstream for the best precision we could achieve using available formulas and our own tests. There are ports for other MCUs and IIRC even for ESP8266-based devices. You can easily adapt any of those for cabled connections if you want since they use the same packet format as the RF ones.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: sjjh on June 26, 2018, 04:36:23 PM
Hi, first post here. :)

We're trying to follow the different guides in this forum to create a DIY data logger. We use the pcb from night303 (http://www.wxforum.net/index.php?topic=18110.msg348033#msg348033) with an ATTINY85-20SU-ND as described in the PDF by  Torkelmj (http://wx.annoyingdesigns.com/DavisSPI.pdf). To program the ATTINY85 we use an Arduino UNO and the program described by JoeBean (http://www.wxforum.net/index.php?topic=18110.msg235399#msg235399). Unfortunately JoeBean used an AT45DB011 chip that seems to have a different pin assignment than the ATTINY85. We're thus a little unsure how to connect the ATTINY85 to the Ardunio. We came up with following set-up, but it seems not to work (no connection and out of sync-errors appear in the Ardunio sketch output, after changing pin 7 and 12 there's no output at all anymore, we might just have bricked the chip):
Code: [Select]
    AT45DB011D  ------------  ARDUINO
    1 (SI/MOSI) ------------  Pin 11
    2 (SCK)     ------------  Pin 13layout
    3 (RESET)   ------------  Pin 8
    4 (CS)      ------------  Pin 10
    5 (WP)      ------------  Pin 7
    6 (VCC)     ------------  3.3V
    7 (GND)     ------------  Ground
    8 (SO)      ------------  Pin 12


    ATTINY85-20SU-ND -------  ARDUINO
    1 (RESET)   ------------  Pin 8
    2 (WP)      ------------  Pin 7 (??)
    3 (CS)      ------------  Pin 10 (?)
    4 (GND)     ------------  Ground
    5 (SI/MOSI) ------------  Pin 11
    6 (SO)      ------------  Pin 12 (??)
    7 (SCK)     ------------  Pin 13
    8 (VCC)     ------------  5V

Can anybody confirm the pin assignment? Or give a hint how to proceed?

Thanks in advance!
Simon
Title: Re: DIY "GREEN DOT" Data Logger
Post by: docbee on June 27, 2018, 04:53:50 PM
ATTINY85 and AT45DB011 are completely different things IMHO. While the AT45DB011 is a serial data flash storage chip with a security register and some write once regions the ATTINY85 is a computing device that tries to trick the console by imitating the signal behavior expected by the console.

So the pin layout is not the main problem to solve when trying to use one as a drop-in replacement for the other. But may be I am missing something here. The most compatible way to Davis green dot is of course when you go the AT45DB011 route, but it requires to get a grip on those chips, which are EOL in the meantime.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: sjjh on June 27, 2018, 05:42:05 PM
Ah, damn it. Thx for your reply. So if I understand it correctly either we would need to find a successor of the AT45DB011 and hope that it works as well (I mean, Davis must continue to use some chip as well), or we would need to port the code printed in the PDF to an Arduino sketch.

//Edit: The replacement for the AT45DB011 seems to be the AT45DB021E [1] which might be compatible to it [2] and still seems to be available (e.g. via mouser). But as we bought the above mentioned PCB [3] and the AT45DB021E is not compatible to the ATTINY85 I'm wondering if we actually could use the AT45DB021E at all anyway? Anybody an idea? Thx!

[1] http://www.adestotech.com/pcn/pdf023.pdf
[2] https://www.adestotech.com/wp-content/uploads/doc8789.pdf
[3] https://oshpark.com/shared_projects/M0mczaXC
Title: Re: DIY "GREEN DOT" Data Logger
Post by: night303 on August 08, 2018, 05:31:24 PM
Hi, first post here. :)

We're trying to follow the different guides in this forum to create a DIY data logger. We use the pcb from night303 (http://www.wxforum.net/index.php?topic=18110.msg348033#msg348033) with an ATTINY85-20SU-ND as described in the PDF by  Torkelmj (http://wx.annoyingdesigns.com/DavisSPI.pdf). To program the ATTINY85 we use an Arduino UNO and the program described by JoeBean (http://www.wxforum.net/index.php?topic=18110.msg235399#msg235399). Unfortunately JoeBean used an AT45DB011 chip that seems to have a different pin assignment than the ATTINY85. We're thus a little unsure how to connect the ATTINY85 to the Ardunio. We came up with following set-up, but it seems not to work (no connection and out of sync-errors appear in the Ardunio sketch output, after changing pin 7 and 12 there's no output at all anymore, we might just have bricked the chip):
Can anybody confirm the pin assignment? Or give a hint how to proceed?

Thanks in advance!
Simon

As docbee said, ATTiny is microcontroller and AT45DB011 is flash chip, so they're completely different kind of chips.

For programming ATTiny I used MiniPro programmer, but it can also be programmed with Arduino. Check out this link :
https://www.instructables.com/id/Attiny-Programmer-using-Arduino-UNO/

Note that version with ATTiny doesn't give you data logger functionality, it just unlocks UART port so Davis station can be used with USB-UART cable for connecting to Cumulus (tested) and probably other software as well.

Title: Re: DIY "GREEN DOT" Data Logger
Post by: sjjh on August 09, 2018, 04:01:55 AM
Thanks for your reply. We were aware of the missing data storing capability of the data logger using an ATtiny85, but as we intended to connect it to an constantly running Rasperry Pi running Weewx we believed that this shouldn't be a problem.
Anyway, In the meantime we looked into programming the ATtiny85 with the Arduino Uno -- and it unfortunately seemed more complicated than I hoped. I started porting the Basic code published by Torkel in his PDF to an Arduino sketch (see below), but struggled with the communication part. The ATtiny85 doesn't support SPI, but only USI. We tried to use ATTinyCore (https://github.com/SpenceKonde/ATTinyCore) to add support for the ATtiny85 to the Arduino Uno, but it only supports SPI master and not slave mode. I wasn't able to find an Arduino Uno SPI slave library using USI for the ATtiny85. As I have no experience in programming micro controllers what so ever and the data logger is needed rather quickly, we went for the easier route and ordered one from belfryboy. Maybe we'll try to build our own later on... If anybody is able to bring it further, I'd be happy to get to know about it.
Simon

Code: [Select]
/*
  Unlock the Davis VP2/Vue console serial line using the ATtiny85 and a
  random device ID. Using algorithm as described by WXForum.net user
  "watson" on November 28, 2013: http://www.wxforum.net/index.php?topic=18110.msg200376.

  Code based on a programm by Torkel M. Jodalen <tmj@bitwrap.no> in revision from 2013-11-30
  available at http://wx.annoyingdesigns.com/DavisSPI.pdf

  Ported to Arduino Sketch by Simon Harhues (2018-07-06 to 2018-07-16 )

  See example for SPI slave support:
  https://gist.github.com/Weathergadget/b96255e5ec700a15e42c4c1497ec506b#file-attiny_spi_slave-ino
  https://weathergadget.wordpress.com/2016/05/19/usi-spi-slave-communication/

  https://avrhelp.mcselec.com/index.html?using_usi_universal_serial_int.htm

 
  Pin assignment of ATtiny85 for ISP communciation (https://github.com/SpenceKonde/ATTinyCore):
  Note: Davis Console acts as master, data logger as slave
  1:  Reset   8:  VCC
  2:  xy      7:  SCK
  3:  xy      6:  MISO/DO [as slave]
  4:  GND     5:  MOSI/DI [as slave]
*/


// Static look-up table for security register
u8 const GreenDot_Table[256] =
{
0x00, 0x04, 0x08, 0x0C, 0x10, 0x14, 0x18, 0x1C, 0x21, 0x25, 0x29, 0x2D, 0x31, 0x35, 0x39, 0x3D,
0x46, 0x42, 0x4E, 0x4A, 0x56, 0x52, 0x5E, 0x5A, 0x67, 0x63, 0x6F, 0x6B, 0x77, 0x73, 0x7F, 0x7B,
0x8C, 0x88, 0x84, 0x80, 0x9C, 0x98, 0x94, 0x90, 0xAD, 0xA9, 0xA5, 0xA1, 0xBD, 0xB9, 0xB5, 0xB1,
0xCA, 0xCE, 0xC2, 0xC6, 0xDA, 0xDE, 0xD2, 0xD6, 0xEB, 0xEF, 0xE3, 0xE7, 0xFB, 0xFF, 0xF3, 0xF7,
0x18, 0x1C, 0x10, 0x14, 0x08, 0x0C, 0x00, 0x04, 0x39, 0x3D, 0x31, 0x35, 0x29, 0x2D, 0x21, 0x25,
0x5E, 0x5A, 0x56, 0x52, 0x4E, 0x4A, 0x46, 0x42, 0x7F, 0x7B, 0x77, 0x73, 0x6F, 0x6B, 0x67, 0x63,
0x94, 0x90, 0x9C, 0x98, 0x84, 0x80, 0x8C, 0x88, 0xB5, 0xB1, 0xBD, 0xB9, 0xA5, 0xA1, 0xAD, 0xA9,
0xD2, 0xD6, 0xDA, 0xDE, 0xC2, 0xC6, 0xCA, 0xCE, 0xF3, 0xF7, 0xFB, 0xFF, 0xE3, 0xE7, 0xEB, 0xEF,
0x31, 0x35, 0x39, 0x3D, 0x21, 0x25, 0x29, 0x2D, 0x10, 0x14, 0x18, 0x1C, 0x00, 0x04, 0x08, 0x0C,
0x77, 0x73, 0x7F, 0x7B, 0x67, 0x63, 0x6F, 0x6B, 0x56, 0x52, 0x5E, 0x5A, 0x46, 0x42, 0x4E, 0x4A,
0xBD, 0xB9, 0xB5, 0xB1, 0xAD, 0xA9, 0xA5, 0xA1, 0x9C, 0x98, 0x94, 0x90, 0x8C, 0x88, 0x84, 0x80,
0xFB, 0xFF, 0xF3, 0xF7, 0xEB, 0xEF, 0xE3, 0xE7, 0xDA, 0xDE, 0xD2, 0xD6, 0xCA, 0xCE, 0xC2, 0xC6,
0x29, 0x2D, 0x21, 0x25, 0x39, 0x3D, 0x31, 0x35, 0x08, 0x0C, 0x00, 0x04, 0x18, 0x1C, 0x10, 0x14,
0x6F, 0x6B, 0x67, 0x63, 0x7F, 0x7B, 0x77, 0x73, 0x4E, 0x4A, 0x46, 0x42, 0x5E, 0x5A, 0x56, 0x52,
0xA5, 0xA1, 0xAD, 0xA9, 0xB5, 0xB1, 0xBD, 0xB9, 0x84, 0x80, 0x8C, 0x88, 0x94, 0x90, 0x9C, 0x98,
0xE3, 0xE7, 0xEB, 0xEF, 0xF3, 0xF7, 0xFB, 0xFF, 0xC2, 0xC6, 0xCA, 0xCE, 0xD2, 0xD6, 0xDA, 0xDE
};


// the setup function runs once when you press reset or power the board
void setup() {
  u8 const OptCode_ChipStatus       = 0xD7;   // optcode to request chip status
  u8 const Reply_ChipStatus         = 0x8C;   // response to chip status request
  u8 const OptCode_SecurityRegister = 0x77;   // optcode to request security register value
  //the following is probably not needed (according to Torkels PDF)
//  u8 const OptCode_ManufacturerID_DataDensity = 0x9F; // optcode to request manufacturer id (0x1F) and data density (0x22)
 
  // The 128 byte one time programmable security register
  // Bytes  0 -   2: fixed (value seems to not matter)
  // Bytes  3 -  64: calculated value (derived from devide id)
  // Bytes 64 - 127: device id (we'll use a random one here)
  u8 Security_Register[128];
 
  // Fill fixed values, bytes 0-2
  Security_Register[0] = 0x00; // or whatever you want
  Security_Register[1] = 0x00; // or whatever you want
  Security_Register[2] = 0x07; // or whatever you want
 
  // Fill in a random device ID, bytes 64-127
  for (int i=64;i<128;i++){
    Security_Register[i] = (u8)random(256);
  }
  // Fill in appropiate calculated security register values, bytes 3-63
  u8 value;
  for (int i=3;i<64;i++){
    value = (u8)(Security_Register[64 + n] + n); //device ID starts at byte 64 of security register
    Security_Register[i] = GreenDot_Table[value];
  }



  // Wait for console to communicate with us, the data logger
 
  //ToDo: to request optcode 0xD7 reply with chip status (0x8C)
 
  //ToDo: to request optcode 0x77 reply with security register
  for (int i=0;i<128;i++){
    //write Security_Register[i];
  }
  // see examples
  // see: https://create.arduino.cc/projecthub/arjun/programming-attiny85-with-arduino-uno-afb829
}

// the loop function runs over and over again forever
void loop() {
}
Title: Re: DIY "GREEN DOT" Data Logger
Post by: gmu on May 29, 2020, 11:36:49 AM
I have finally cracked this.  [tup] 

With an Attiny45 and an arduino nano.

Thanks to night303's davis_random.zip hex file on page 12 and the flashing instructions and files found here: 

https://www.instructables.com/id/Arduino-As-ISP-Burn-Hex-File-in-AVR-Fuse-in-AVR-Ar/

https://www.instructables.com/id/Program-an-ATtiny-with-Arduino/


Just make sure to steer the cmd directory to where the averdude.exe / .hex file is and that it writes to the chip despite the strange info messages. 



After setting up, these 4 commands did the job in my case and I flashed two chips no problem.


avrdude -c arduino -b 19200 -p xyz

avrdude -F -c arduino -b 19200 -p t45 -P COM7 -n

avrdude -F -c arduino -b 19200 -p t45 -P COM7 -U efuse:w:0xFF:m -U hfuse:w:0xDF:m -U lfuse:w:0xC1:m -U lock:w:0xFF:m

avrdude -F -c arduino -b 19200 -p t45 -P COM7 -U flash:w:davis_random.hex


Note:  night303's davis_constant.hex file didn't seem to work (the console receiver seemed to stopped working) but his davis_random.hex file did work.


Title: Re: DIY "GREEN DOT" Data Logger
Post by: night303 on August 21, 2020, 04:35:33 PM
@gmu, thanks for the feedback.
As I credited, code is not my work, it's watson's, I merely compiled it with Bascom which is I guess a bit of rarely used software when it comes to AVR development nowdays.
In my case I used MiniPro programmer and both random and constant versions worked on multiple Davis Vantage Vue and Davis Vantage Pro II stations, I used ATTiny85. Instructions in torkelmj's paper claim that random version of code works only with ATTiny85 as ATTiny45 lacks memory for the buffer and constant version should be used.  It's however very critical part of programming process to use exactly specified fuses, otherwise it doesn't run correctly. Your instructions for Arduino as ISP are surely welcome as Arduino is more commonly used board and quite cheaper than MiniPro.
Title: Re: DIY "GREEN DOT" Data Logger
Post by: noctilucent on August 09, 2021, 11:28:51 AM
The other 192 bytes of the GreenDot_Table is a stupid "copy and paste" of the first 64 bytes, with very poor permutations.

Coming very late to the discussion but that looks more like a non-maximal-length LFSR sequence or similar, which would make sense since it's very easy to generate on a low-power CPU.