Author Topic: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2  (Read 10282 times)

0 Members and 1 Guest are viewing this topic.

Offline Ingineer

  • Member
  • *
  • Posts: 16
I wanted a wireless connection to my server from the VP2, so I came up with a much easier and more elegant way to achieve connection/logging.  Note that unless you are savvy with electronics and soldering you could DESTROY your expensive console!

Why Bluetooth?  In my situation it would be difficult to get wires from my server which is recording the weather (using WeeWx) to the VP2 for direct connect serial, and I risk ESD/RFI damage/interference to the server because of the galvanic connection.

The advantage of Bluetooth is obviously it's wireless, but it also prevents any RF noise or ESD from travelling to/from your server and the Davis console.   This is especially an important issue if you happen to have a wired weather station! (as I do)  If lightning or ESD ever hits your station hardware, then you could also expose your server to it in a hardwired configuration.  It also gets around the problem of USB serial adapters that like to reset themselves.

Ok, now for the Meat:

NOTE: Davis has attempted to disable homebrew loggers such as this one starting with version 3.0 firmware.  If you have 3.0 or greater firmware on your console, you will first need to program your flash chip using Watson's authentication algorithm found here: http://www.wxforum.net/index.php?topic=18110.msg200376#msg200376  If you don't, none of this will work!

Davis must have considered building a model with internal flash logging, as there is an unpopulated location for a SPI serial flash memory next to the micro.  To get logging on the cheap, You can actually solder an Atmel AT45DB011D-SH-B (wide body) Flash right into the VP2. (Part source link below)  All but one pin is correct pin for pad.  The pin difference allows the microcontroller to address the internal as well as the external flash as a separate units.  Here's an image:


Before soldering the flash, bend up pin 4 (CS) so that it wont touch the PCB and don't solder that to the board pad.  Then, after soldering the other 7 pins, run a jumper from pin 4 to the SS (pin 1) header, or you can "cheat" as shown above if you have good soldering skills, and go directly to the micro.  Add a .1uf and a 4.7uF cap in the 2 locations next to the flash.  (Though it will probably be fine with just the .1uf.)  Don't bother trying with pin 4 connected to the pad, as it's not the correct chip select.  Reset is also different, but works correctly as-is.
 
Then to round out an elegant hack, instead of a wired serial connection, simply purchase a bluetooth serial module (available cheap on ebay) and install it inside:


I first had to connect a USB to TTL converter up to the bluetooth module in order to configure it for 19200 baud, I also renamed it "WeatherStation" and changed the PIN.  Fire up your favorite serial terminal program (I used minicom) and configure your port for 9600,8,N,1.  If you type "AT", (case sensitive, no return needed) you should get an "OK".  If not, try reversing the TX/RX.  Once you have the OK, you can change the parameters.  I found it only works if you type fast, so I simply cut and pasted in the following commands:
AT+NAMEWeatherStation
AT+PIN0000
AT+BAUD5
The module will respond after each command.  After the last baud command, the baud rate changes, so you lose communication with it, but that's ok, We're done! 

Note: If you don't have/don't want to get a USB TTL cable, you can probably just skip all of that terminal stuff and just reconfigure your VP2 to 9600 Baud (the default for the Bluetooth adapter).  The Pin defaults to 1234.

I then positioned the Bluetooth module where the antenna wouldn't be blocked, and it where it would fit without interference inside the housing.  Luckily, there are unused pads for an RJ-11 jack that contain 5v power and ground, so I soldered 2 pieces of stiff wire through to corresponding pins on the module.  The clear tape is layered over the other pins so the data lines will not short.  Since the bluetooth module is expecting 3.3v TTL, this is a perfect match with the VP2's micro!

Once you get everything soldered up, test it by first powering up your VP2, exit setup by holding "done", then execute a "clear all" by making sure wind speed is showing and pressing 2nd then holding "clear" for 6 seconds until "clearing now" is displayed.  Then be sure to set your Baud to 9600 unless you have adjusted the bluetooth module baud to 19200.  (Go back into setup and scroll to step 14)  Start the test by creating a serial link over bluetooth with your favorite terminal program.  If you are successful you will get "TEST" echoed back to you if you type it. (Case sensitive)  I then set up logging by typing the "SETPER 5" command (set up 5 minute intervals) and then the "START" command.

Voila! Wireless link to your PC or server!  I used the open-source (free) software called WEEWX to create web pages and upload my weather data.  It will even run on a $35 raspberry pi!

Be sure to get the widebody variant of the Atmel flash, otherwise it will not fit the pads in the VP2.  Here for less than $1:
http://www.digikey.com/product-detail/en/AT45DB011D-SH-B/AT45DB011D-SH-B-ND/1886154

Here's a California supplier for the Bluetooth Module ($14):
http://www.ebay.com/itm/140830930279
(You can get them from China much cheaper, but it will take longer)

I have mine up and running with WeeWx and it works great!  If you don't have bluetooth on the PC or server you want to install your weather logger software on, you can buy a USB dongle for low cost.  If you need long range, get a class 1 radio.

Enjoy!
« Last Edit: January 16, 2015, 06:11:29 PM by Ingineer »

Offline belfryboy

  • Forecaster
  • *****
  • Posts: 489
  • waiting for the rain.....
    • Belfryboy Blog
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #1 on: October 16, 2012, 12:17:52 PM »
Interesting, what sort of range do you get with this?

Offline Garth Bock

  • Table Rock Lake Weather
  • Forecaster
  • *****
  • Posts: 2745
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #2 on: October 16, 2012, 12:40:05 PM »
Very nice !!!!!  =D> =D> =D> =D> =D>

This would work for an Envoy which is less risky and less expensive as a console. I might get an Envoy and do it for the heck of it. (I am not mod'ing my current Envoy....it has been running quietly for the past 5 years or more...can't remember when I bought it.)

This could open the door to a Wifi Envoy (not talking the WLIP)....with the Wifi internal.

This adds to list of mysteries of VPro2....on the ISS board there are pads for a second supercap....why ?

Offline DeKay

  • Forecaster
  • *****
  • Posts: 399
    • Mad Scientist Labs
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #3 on: October 16, 2012, 02:30:36 PM »
This rocks!

I have an older rev console after I blew up my newer rev console.  It will be interesting to see if this footprint is there or not on mine.

Do you have any information on the power draw of the Bluetooth module?  I usually run my console just off batteries and this would probably shorten their life significantly.  And I noticed that the range is listed as < 30', so the chances of this working through a couple walls in the house are likely slim.

Right now I'm thinking of a Jeenode that wakes up every few minutes, sends the result of a quick LOOP command to my router, and otherwise sleeps in low power mode.  More range this way, and having a micro at the console end opens up other possibilities.  I've started playing with this now but don't have the time I wish I had to make much progress so far.

Offline Ingineer

  • Member
  • *
  • Posts: 16
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #4 on: October 16, 2012, 06:23:52 PM »
There is no reason why you can solder in the flash into another unit if it has the expansion port, though it may not be as easy as the VP2.  The bluetooth module is super-easy, as it's only 4 wires.

Even though the power draw is low on the bluetooth module, I bet it would chow through a set of batteries pretty fast.  I have a decent bluetooth dongle on my Linux server, the $13 AzioBTD-V301, and it has no trouble going through 3 walls at about 40 feet to receive the VP2 signals.  (And that's in my noisy ISM2.4 environment!)

All I did was use a 5' USB extension to get the dongle away from the back of the server, and elevate it a bit.

Here's where to get it:
http://www.amazon.com/Azio-BTD-V201-Micro-Bluetooth-Adapter/dp/B003765X38

Offline C5250

  • Forecaster
  • *****
  • Posts: 840
    • Local weather
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #5 on: October 16, 2012, 10:01:54 PM »
Davis must have considered building a model with internal flash logging, as there are pads for another one next to the micro.  To get logging on the cheap, You can actually solder the AT45DB011D-SH-B (wide body) Atmel Flash right into the VP2. All but one pin is correct pin for pad. Here's an image:

Uhm... Are you referring to U51? If so, that is the location for the radio chip.



Sorry the pic is so blurry.
Precious little in your life is yours by right and won without a fight.

Offline Ingineer

  • Member
  • *
  • Posts: 16
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #6 on: October 16, 2012, 10:10:17 PM »
No, In that picture it looks to me like it's the space just above and to the left of the micro (big chip).  It's U82 in my VP2.

Offline C5250

  • Forecaster
  • *****
  • Posts: 840
    • Local weather
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #7 on: October 16, 2012, 10:18:53 PM »
This adds to list of mysteries of VPro2....on the ISS board there are pads for a second supercap....why ?

Apparently that is no longer the case on the newer SIM boards. As for the two sets of pads, see this.
Precious little in your life is yours by right and won without a fight.

Offline C5250

  • Forecaster
  • *****
  • Posts: 840
    • Local weather
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #8 on: October 16, 2012, 10:24:50 PM »
No, In that picture it looks to me like it's the space just above and to the left of the micro (big chip).  It's U82 in my VP2.

Ahh, OK. Have you checked if it is actually logging. The firmware check is pretty simple, so it could be possible.
Precious little in your life is yours by right and won without a fight.

Offline Ingineer

  • Member
  • *
  • Posts: 16
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #9 on: October 16, 2012, 11:10:08 PM »
Yes, it's logging.  The proof is WEEWX will not work without logging.  I originally installed the Bluetooth and found this fact out the hard way!

Once the flash was soldered in, all I had to do is issue the "SETPER 5" command (set up 5 minute intervals) and then the "START" command... Logging!

You can see my Wunderground icon below:

Offline mulveyr

  • Member
  • *
  • Posts: 27
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #10 on: October 16, 2012, 11:23:33 PM »
Yes, it's logging.  The proof is WEEWX will not work without logging.  I originally installed the Bluetooth and found this fact out the hard way!

Once the flash was soldered in, all I had to do is issue the "SETPER 5" command (set up 5 minute intervals) and then the "START" command... Logging!

You can see my Wunderground icon below:

Actually, the beta version of Weewx 2.0 that came out a couple days ago can be configured so that it doesn't need a logger - just access to loop packets.

Offline Ingineer

  • Member
  • *
  • Posts: 16
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #11 on: October 16, 2012, 11:28:05 PM »
Actually, the beta version of Weewx 2.0 that came out a couple days ago can be configured so that it doesn't need a logger - just access to loop packets.
NOW you tell me!  =)

Well, I guess having the Flash is still a good idea, as it will store any weather data in the event of loss of bluetooth or weewxd crash, etc.

Thanks!

Offline Devonian

  • Member
  • *
  • Posts: 17
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #12 on: October 24, 2012, 05:33:23 PM »
Nice work  =D&gt;

How about plumbing in a Raspberry Pi through it's GPIO port instead of the Bluetooth adapter?
Then, you would have a Linux server directly attached to the consol.
Cable it via ethernet to your router (or add a WiFi adapter to the Raspberry Pi) and it's then linked to your network (and the t'internet if you want).

I have a new, wired VP2 ready to install in my new home and just got a new 512Mb R-Pi to play with and it will run a headless LAMP (Linux Apache MySQL PHP) server no problem.
I just need a few months for the builders to finish...

http://www.raspberrypi.org/

Nigel.

Offline vpweather

  • Member
  • *
  • Posts: 8
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #13 on: March 03, 2013, 06:36:04 PM »
Fascinating post.
@VPWeather

Offline Devonian

  • Member
  • *
  • Posts: 17
Has anyone done this mod?
I'm wondering if it is affected by firmwares above v1.90?

I'm about to modify my VP2 cabled console with the memory chip but will add a serial 433MHz transceiver module instead of the Bluetooth as I need more than 10 metres/yards wireless distance to my server.
I have a pair of APC220 serial wireless modules, like this
http://wiki.openpilot.org/display/Doc/APC220+Transceiver+Telemetry
They can be programmed for frequency and baud rate.

Nigel.

Offline Ingineer

  • Member
  • *
  • Posts: 16
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #15 on: January 14, 2015, 03:59:50 PM »
A friend of mine just completed this mod using the USR-WIFI232-T module instead of bluetooth.  He doesn't have any pics, but it's doable, and this increases the range.  The new ESP8266 based modules are even cheaper.

If you do this, just add virtual serial port driver.  (I use Socat in Linux for this)

Offline AnOldFella

  • Member
  • *
  • Posts: 16
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #16 on: January 16, 2015, 09:59:06 AM »
I decided to try this method for storage and remote downloading of the weather data from my VP2 console.  I was able to use an FTDI cable and PuTTY to change the baud rate, name and PIN on my Bluetooth H06 module.  I've successfully soldered the flash chip, both caps (hot air rework station to the rescue !) and the BT module to the VP2 console main board.  The VP2 console powers up normally and I've cleared all the console data.  I can link the BT module to my Win7 x64 computer and pair it by running PuTTY in serial mode using the virtual com port assigned to the BT link. 

But, now I'm stuck.  Once the BT module is paired using PuTTY, it doesn't seem to be communicating.  I get no response after entering any of the AT commands or the VP2 console commands SETPER 1 or START.  I've tried it with TX/RX wired both ways.  Cumulus can't connect through the virtual serial port.

I've spent days trying everything I can think of or find on the web.  Any help or ideas from forum members would be greatly appreciated !

Offline belfryboy

  • Forecaster
  • *****
  • Posts: 489
  • waiting for the rain.....
    • Belfryboy Blog
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #17 on: January 16, 2015, 10:18:44 AM »
Did you program the flash chip security register?

Offline Ingineer

  • Member
  • *
  • Posts: 16
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #18 on: January 16, 2015, 12:28:46 PM »
Do you have a scope or logic analyzer?  Probing the RX serial line on the VP2 to confirm it's receiving data and at the correct baud rate would be a good check.  If not, Try disconnecting RX and TX from the VP2 and shorting them together.  Then fire up Putty on your Win7 PC and connect to the BT serial port at 19200.  Type a few characters and see if you get them echoed back.  This will confirm everything on the PC and the BT module.  If this test fails then it's something on the PC or in the BT module itself.  I'm using a Linux box, so I can't advise on troubleshooting on Win7. (Maybe someone else here can?)
I decided to try this method for storage and remote downloading of the weather data from my VP2 console.  I was able to use an FTDI cable and PuTTY to change the baud rate, name and PIN on my Bluetooth H06 module.  I've successfully soldered the flash chip, both caps (hot air rework station to the rescue !) and the BT module to the VP2 console main board.  The VP2 console powers up normally and I've cleared all the console data.  I can link the BT module to my Win7 x64 computer and pair it by running PuTTY in serial mode using the virtual com port assigned to the BT link. 

But, now I'm stuck.  Once the BT module is paired using PuTTY, it doesn't seem to be communicating.  I get no response after entering any of the AT commands or the VP2 console commands SETPER 1 or START.  I've tried it with TX/RX wired both ways.  Cumulus can't connect through the virtual serial port.

I've spent days trying everything I can think of or find on the web.  Any help or ideas from forum members would be greatly appreciated !

Offline Ingineer

  • Member
  • *
  • Posts: 16
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #19 on: January 16, 2015, 01:29:04 PM »
Better question, is his firmware 3.0 or higher?   I just saw the 3.0 thread.  Maybe we can test out the security register theory with AnOldFella's help?
Did you program the flash chip security register?

Offline belfryboy

  • Forecaster
  • *****
  • Posts: 489
  • waiting for the rain.....
    • Belfryboy Blog
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #20 on: January 16, 2015, 04:12:34 PM »
I'm not sure what there is to test; torkelmj found that there were no significant differences between the old and new console PCBs in this epic piece of work, we also know that newer console PCBs with firmware of 3.00 and above require a programmed security register.

Offline Ingineer

  • Member
  • *
  • Posts: 16
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #21 on: January 16, 2015, 06:14:40 PM »
Thanks Belfryboy, I had looked around and even searched the forum for information about this, but didn't find any.  I have updated my first post with a warning that the flash must first be programmed.

AnOldFella, check you'r console's version and see if you are a "green dotter".  If you are, then you'll need to get an Arduino or bus pirate and program your flash.

Here's Watson's algorithm that calculates the correct authentication code from the flash's unique serial number: http://www.wxforum.net/index.php?topic=18110.msg200376#msg200376


Offline AnOldFella

  • Member
  • *
  • Posts: 16
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #22 on: January 16, 2015, 07:23:23 PM »
Thanks for all the help and suggestions.

Did you program the flash chip security register?

No need for me to clean up after the Davis fiasco, since my VP2 is over 10 years old and running v1.70.  I've seen no reason to upgrade beyond this version, so haven't had to deal with the problems seen by those with newer systems.

Do you have a scope or logic analyzer?  Probing the RX serial line on the VP2 to confirm it's receiving data and at the correct baud rate would be a good check.  If not, Try disconnecting RX and TX from the VP2 and shorting them together.  Then fire up Putty on your Win7 PC and connect to the BT serial port at 19200.  Type a few characters and see if you get them echoed back.  This will confirm everything on the PC and the BT module.  If this test fails then it's something on the PC or in the BT module itself.  I'm using a Linux box, so I can't advise on troubleshooting on Win7. (Maybe someone else here can?)

My brother sent me his old Velleman HPS140i, but I haven't a clue how to use it.  I'm pretty sure that it's something on the BT module as shorting the TX/RX shows no response.  After I tried this, I removed the BT from my VP2 console.  I hooked the BT module back up to my USB FTDI cable where it used to work, but no longer does.  I used a magnifying glass and looked for solder bridges and other similar issues, but found nothing.  I think this BT board is probably toast, so ordered a new one that will be here in a week.

On a more positive note, the new flash chip I put in my VP2 console works great and is logging data as if I had a WeatherLink Data logger attached.  I temporarily moved my VP2 console near my computer and used my USB FTDI and a homemade ribbon cable to start data logging with PuTTY.  After a few minutes, I started Cumulus and configured it to use the com port for the FTDI.  After restarting Cumulus, it immediately started downloading the data from the console !  I let out a whoop that scared all the birds on the bird feeders outside my den window. :grin:

Once my new BT module arrives, I'll start trying to get remote access to the VP2 console again.  However, I think I'll do it from the expansion port this time as I don't want to take the chance of ruining my console main board with more soldering/desoldering.  I'll post here again once my new BT module arrives and my trials and tribulations start anew.

Offline AnOldFella

  • Member
  • *
  • Posts: 16
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #23 on: January 23, 2015, 11:34:14 AM »
My new Bluetooth H05 module finally arrived.  I hooked it up and quickly discovered that the single biggest issue with these BT serial modules is all the variants of hardware, firmware and AT command sets that are out there.  I spent several hours searching and testing until I uncovered enough information to program this new one.

I hooked it up to the expansion port (thanks to DeKay's pinout) of my VP2 console with the ribbon cable that I had made previously and started Cumulus.  It took a little while with the LED on the module doing a lot of blinking with some long pauses, but finally Cumulus showed that it was downloading.  One teeny, tiny triumph for mankind, one big Yeeeehaawww from me !!!  I finally have a wireless data logger for my VP2.

This particular module (gomcu CZ HZ-05) is small enough that by shortening my ribbon cable and rotating the header pins in towards the board, I'm able to easily fit it all in the recess for the WL data logger.  My VP2 console is about 25' and 3 walls away from my computer, but I'm having no trouble with the BT transmissions.

Many, many thanks to DeKay, Ingineer and all others who so willingly share their knowledge and skills with the rest of us.

Offline DeKay

  • Forecaster
  • *****
  • Posts: 399
    • Mad Scientist Labs
Re: HOWTO: Low-Cost Bluetooth Connectivity and Logging for the VantagePro2
« Reply #24 on: January 23, 2015, 01:50:47 PM »
I hooked it up to the expansion port (thanks to DeKay's pinout) of my VP2 console with the ribbon cable that I had made previously and started Cumulus.  It took a little while with the LED on the module doing a lot of blinking with some long pauses, but finally Cumulus showed that it was downloading.  One teeny, tiny triumph for mankind, one big Yeeeehaawww from me !!!

Congratulations!  Those Yeeeehaawww's are the best thing ever!

Many, many thanks to DeKay, Ingineer and all others who so willingly share their knowledge and skills with the rest of us.

I have admittedly been pretty quiet lately, but I'm hoping that some other stuff that I've been playing around with lately will just add to the pile of fun stuff we can do.