{"id":171,"date":"2017-11-24T17:06:51","date_gmt":"2017-11-24T17:06:51","guid":{"rendered":"http:\/\/wp.spoton.cz\/?p=171"},"modified":"2017-11-24T17:06:51","modified_gmt":"2017-11-24T17:06:51","slug":"davis-vantague-vue-arduino-and-a-raspberry-pi-3","status":"publish","type":"post","link":"https:\/\/spoton.cz\/index.php\/2017\/11\/24\/davis-vantague-vue-arduino-and-a-raspberry-pi-3\/","title":{"rendered":"Davis Vantague Vue, Arduino and a RaspBerry PI 3"},"content":{"rendered":"<p>Home automation has become more popular and weather monitoring definitely falls into that category. One of the best things you can buy is a Davis (whatever version). There is a BUT though. In order to log data, you need to buy their special data-logger that will set you back some $300 or so. Or do you?<!--more--><\/p>\n<h2>Davis Vantage Vue<\/h2>\n<p>This davis instrument is a all-in-one bundle. Wind direction and speed sensors, temperature and humidity sensor (nicely shielded), and a rain bucket sensor. Mind you, these are nicely set up instruments in a ready made package. In addition, you&#8217;ll get all this powered by solar power during the day, a supercapacitor charged from solar, powers it throughout the majority of the night and is backed up by a battery, should it not suffice.<\/p>\n<p>\n All this ties to a nicely designed (straight from the early &#8217;90s) home console, which displays all the nifty-shifty graphs and tells you various things. The console adds a couple more sensors, namely a temperature and humidity reading of the inside, as well as atmospheric pressure sensor. All this is well worth the money, go for it. It is mostly around $400-$500 (12.000 CZK \ud83d\ude42 )<\/p>\n<p>\n Software sucks, full-stop.<\/p>\n<p>\n If you want to log data to a database, or just print them on paper and circle them with a red pen later on, don&#8217;t expect to connect to the home console via a USB, or other, reasonable interface. There has been one obscure interface in the past, but Davis &#8220;upgraded&#8221; the firmware and this is no longer available (well, it is, but ).<\/p>\n<p>\n To recap, what you get from a Davis Vantage Vue (An impressive set, I must say):<\/p>\n<ul>\n<li>Temperature<\/li>\n<li>Humidity<\/li>\n<li>Wind direction<\/li>\n<li>Wind velociity (including wind gusts)<\/li>\n<li>Rain rate, total rainfall<\/li>\n<li>Solar irradiation<\/li>\n<li>Capacitance battery backup<\/li>\n<\/ul>\n<h2>Counting the options<\/h2>\n<p>&nbsp;<\/p>\n<h2>The components<\/h2>\n<p>What will you need you ask? These:<\/p>\n<ul>\n<li>CC1101 module<\/li>\n<li>Arduino Mini Pro @ 3.3V<\/li>\n<li>FTDI usb stick to program the arduino<\/li>\n<li>Regulated power source (3.3V)<\/li>\n<li>ESP-01s (8266 wireless chip)<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>Wiring together<\/h2>\n<h3>CC1101 pinout:<\/h3>\n<p>The module came in without anything soldered onto it. Given the size, it eill require some steady hands a fine soldering tip.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/wp.spoton.cz\/wp-content\/uploads\/2017\/11\/DSC_0022_s.jpg\"><img loading=\"lazy\" class=\"aligncenter wp-image-158 size-full\" src=\"http:\/\/wp.spoton.cz\/wp-content\/uploads\/2017\/11\/DSC_0022_s.jpg\" alt=\"\" width=\"1200\" height=\"675\" srcset=\"https:\/\/spoton.cz\/wp-content\/uploads\/2017\/11\/DSC_0022_s.jpg 1200w, https:\/\/spoton.cz\/wp-content\/uploads\/2017\/11\/DSC_0022_s-300x169.jpg 300w, https:\/\/spoton.cz\/wp-content\/uploads\/2017\/11\/DSC_0022_s-1024x576.jpg 1024w, https:\/\/spoton.cz\/wp-content\/uploads\/2017\/11\/DSC_0022_s-768x432.jpg 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/wp.spoton.cz\/wp-content\/uploads\/2017\/11\/DSC_0016_s-e1511542240690.jpg\"><img loading=\"lazy\" class=\"aligncenter wp-image-153 size-full\" src=\"http:\/\/wp.spoton.cz\/wp-content\/uploads\/2017\/11\/DSC_0016_s-e1511542240690.jpg\" alt=\"\" width=\"846\" height=\"564\" srcset=\"https:\/\/spoton.cz\/wp-content\/uploads\/2017\/11\/DSC_0016_s-e1511542240690.jpg 846w, https:\/\/spoton.cz\/wp-content\/uploads\/2017\/11\/DSC_0016_s-e1511542240690-300x200.jpg 300w, https:\/\/spoton.cz\/wp-content\/uploads\/2017\/11\/DSC_0016_s-e1511542240690-768x512.jpg 768w\" sizes=\"(max-width: 846px) 100vw, 846px\" \/><\/a><\/p>\n<p>From left to right, the connections to arduino are:<\/p>\n<pre>CC1101\u00a0   |\u00a0 Arduino\n-------------------\n1 \u2013 Vcc   |  3.3V\n2 \u2013 GND   |  GND\n3 \u2013 MISO  |  PIN11\n4 \u2013 SCLK  |  PIN13\n5 \u2013 MOSI  |  PIN12\n6 \u2013 GDO2  |  PIN03\n7 \u2013 GDO0  |  PIN02\n8 \u2013 SCN   |  PIN10<\/pre>\n<p>When wired together, on a breadboard, the whole setup looks like this. Neat.<\/p>\n<h2><a href=\"http:\/\/wp.spoton.cz\/wp-content\/uploads\/2017\/11\/DSC_0026_s.jpg\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-162\" src=\"http:\/\/wp.spoton.cz\/wp-content\/uploads\/2017\/11\/DSC_0026_s.jpg\" alt=\"\" width=\"1200\" height=\"675\" \/><\/a><\/h2>\n<h2>\u00a0<\/h2>\n<h2>Software<\/h2>\n<p>All these need to be present in one directory \/ imported as libraries and then included in the main davis.ino program.<\/p>\n<p><a href=\"http:\/\/wp.spoton.cz\/public\/davis_source\/CC1101.h\" target=\"_blank\" rel=\"noopener\">CC1101.h<\/a><\/p>\n<p><a href=\"http:\/\/wp.spoton.cz\/public\/davis_source\/Davis.h\" target=\"_blank\" rel=\"noopener\">Davis.h<\/a><\/p>\n<p><a href=\"http:\/\/wp.spoton.cz\/public\/davis_source\/Davis.cpp\" target=\"_blank\" rel=\"noopener\">Davis.cpp<\/a><\/p>\n<p>davis.ino:<\/p>\n<pre>#include &lt;SoftwareSerial.h&gt;\n\n\/*\n Davis.ino for the RFBee.\n  Prints out the received data packets from the Davis Instruments Vantage Vue ISS.\n  rdsman\n \n*\/\n#include \"Davis.h\"\n#include \"SPI.h\"\n\/\/\nbyte temp;\nSoftwareSerial esp(8, 9);\/\/ RX, TX\nString ssid =\"abc\";\nString password=\"def\";\nString data;\nString server = \"abc.us\"; \/\/ www.example.com\nString uri = \"\/insert.php\";\n \n\/\/\n\/\/ The standard Arduino setup.\n\/\/\nvoid setup()\n{ \n delay(100);\n Serial.begin(9600);\n delay(100); \n Radio.begin();\n Radio.rx();\n\n\/\/esp.begin(115200);\n\nSerial.println(\"Done Setup\");\n}\n\/\/\n\/\/ The standard Arduino loop.\n\/\/\nvoid loop()\n{\n if (Radio.available() &gt; 0)\n printPacket();\n if (hopping)\n {\n hopping = 0;\n Radio.hop();\n Radio.rx(); \/\/ Un-comment if not using Timer 2.\n } \n} \n\/\/\n\/\/ Print the received packet.\n\/\/\nvoid printPacket(void)\n{\n byte header = Radio.read(); \/\/ Where's the header?\n byte package[16];\n \n package[0] = hopIndex; \/\/ Which frequency are we at?\n package[1] = header;\n for (int i = 2; i &lt; 11; i++) \/\/ The received packet.\n {\n package[i] = Radio.read();\n }\n package[11] = pktRssi;\n package[12] = pktLqi;\n package[13] = freqError;\n package[14] = next;\n package[15] = pktCount;\n String data = \"{hop:\" + String(package[0]) + \",\" + \n \"'header':\" + String(package[1]) + \",\" +\n \"'byte0':\" + String(package[2]) + \",\" + \n \"'byte1':\" + String(package[3]) + \",\" + \n \"'byte2':\" + String(package[4]) + \",\" + \n \"'byte3':\" + String(package[5]) + \",\" + \n \"'byte4':\" + String(package[6]) + \",\" + \n \"'byte5':\" + String(package[7]) + \",\" + \n \"'byte6':\" + String(package[8]) + \",\" + \n \"'byte7':\" + String(package[9]) + \",\" + \n \"'byte8':\" + String(package[10]) + \",\" + \n \"'byte9':\" + String(package[11]) + \",\" + \n \"'rssi':\" + String(package[12]) + \",\" + \n \"'lqi':\" + String(package[13]) + \",\" + \n \"'next':\" + String(package[14]) + \",\" + \n \"'count':\" + String(package[15]) + \"}\";\n Serial.print(data);\n Serial.println();\n hopping = 1; \/\/ Turn on hopping.\n}<\/pre>\n<h2>\u00a0<\/h2>\n<h2>Results<\/h2>\n<p>So far, this is in the serial console.<\/p>\n<pre>Done Setup\n{hop:0,'header':128,'byte0':4,'byte1':171,'byte2':23,'byte3':91,'byte4':0,'byte5':189,'byte6':249,'byte7':255,'byte8':255,'byte9':184,'rssi':93,'lqi':7,'next':64,'count':1}\n{hop:1,'header':48,'byte0':3,'byte1':174,'byte2':250,'byte3':65,'byte4':135,'byte5':114,'byte6':115,'byte7':255,'byte8':255,'byte9':183,'rssi':92,'lqi':7,'next':64,'count':2}\n{hop:2,'header':224,'byte0':2,'byte1':174,'byte2':11,'byte3':1,'byte4':9,'byte5':213,'byte6':126,'byte7':255,'byte8':255,'byte9':184,'rssi':102,'lqi':7,'next':64,'count':3}\n{hop:3,'header':80,'byte0':1,'byte1':185,'byte2':255,'byte3':115,'byte4':14,'byte5':171,'byte6':196,'byte7':255,'byte8':255,'byte9':184,'rssi':99,'lqi':7,'next':64,'count':4}\n{hop:4,'header':128,'byte0':2,'byte1':203,'byte2':23,'byte3':75,'byte4':5,'byte5':122,'byte6':120,'byte7':255,'byte8':255,'byte9':183,'rssi':96,'lqi':7,'next':64,'count':5}\n{hop:0,'header':144,'byte0':2,'byte1':194,'byte2':6,'byte3':81,'byte4':156,'byte5':25,'byte6':240,'byte7':255,'byte8':255,'byte9':183,'rssi':45,'lqi':1,'next':64,'count':6}\n{hop:1,'header':224,'byte0':2,'byte1':186,'byte2':11,'byte3':3,'byte4':2,'byte5':211,'byte6':33,'byte7':255,'byte8':255,'byte9':184,'rssi':46,'lqi':1,'next':64,'count':7}\n{hop:2,'header':80,'byte0':2,'byte1':189,'byte2':255,'byte3':115,'byte4':8,'byte5':239,'byte6':33,'byte7':255,'byte8':255,'byte9':184,'rssi':44,'lqi':1,'next':64,'count':8}\n{hop:3,'header':128,'byte0':2,'byte1':200,'byte2':23,'byte3':91,'byte4':15,'byte5':67,'byte6':157,'byte7':255,'byte8':255,'byte9':183,'rssi':46,'lqi':1,'next':64,'count':9}\n{hop:4,'header':160,'byte0':3,'byte1':198,'byte2':254,'byte3':41,'byte4':3,'byte5':239,'byte6':137,'byte7':255,'byte8':255,'byte9':184,'rssi':45,'lqi':1,'next':64,'count':10}<\/pre>\n<p>And the contents were a bit worked out and the more polished, but still a development version is at <a href=\"http:\/\/www.spoton.cz\/weather\">www.spoton.cz\/weather<\/a><\/p>\n<p>&lt;This blog post being constantly updated&gt;<\/p>\n<p>&lt;Web portion in a separate post&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Home automation has become more popular and weather monitoring definitely falls into that category. One of the best things you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":154,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,8],"tags":[23,31,33,39,40,102],"_links":{"self":[{"href":"https:\/\/spoton.cz\/index.php\/wp-json\/wp\/v2\/posts\/171"}],"collection":[{"href":"https:\/\/spoton.cz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/spoton.cz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/spoton.cz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/spoton.cz\/index.php\/wp-json\/wp\/v2\/comments?post=171"}],"version-history":[{"count":0,"href":"https:\/\/spoton.cz\/index.php\/wp-json\/wp\/v2\/posts\/171\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/spoton.cz\/index.php\/wp-json\/wp\/v2\/media\/154"}],"wp:attachment":[{"href":"https:\/\/spoton.cz\/index.php\/wp-json\/wp\/v2\/media?parent=171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/spoton.cz\/index.php\/wp-json\/wp\/v2\/categories?post=171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/spoton.cz\/index.php\/wp-json\/wp\/v2\/tags?post=171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}