{"id":563,"date":"2014-11-04T18:17:08","date_gmt":"2014-11-04T18:17:08","guid":{"rendered":"http:\/\/chris-stubbs.co.uk\/wp\/?p=563"},"modified":"2014-11-04T18:26:24","modified_gmt":"2014-11-04T18:26:24","slug":"ukhasnet-wifi-node-using-esp8266","status":"publish","type":"post","link":"https:\/\/chris-stubbs.co.uk\/wp\/?p=563","title":{"rendered":"UKHASnet WiFi node using ESP8266"},"content":{"rendered":"<p>Since the UKHAS conference in August I have been playing with some UKHASnet nodes, which are &#8220;A simple wireless network aimed for use with low power licence exempt wireless modules&#8221;.<br \/>\nThe system was developed by members of the UKHAS community, but is not specifically aimed at ballooning (however can be used for it).<br \/>\nI have 2 LPC810 based nodes designed by James Coxon, and an AVR node from Phil Crump. After I had these set up, I loaded Phil&#8217;s code onto an old Cheapo v3 PCB and bug soldered a RFM69 onto the back. This made a pretty effective GPS node and after some tinkering I had positions being uploaded to ukhas.net.<\/p>\n<p><a href=\"http:\/\/chris-stubbs.co.uk\/wp\/wp-content\/uploads\/2014\/11\/15129165171_617a8f28db_b.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-571\" src=\"http:\/\/chris-stubbs.co.uk\/wp\/wp-content\/uploads\/2014\/11\/15129165171_617a8f28db_b-300x164.jpg\" alt=\"15129165171_617a8f28db_b\" width=\"300\" height=\"164\" srcset=\"https:\/\/chris-stubbs.co.uk\/wp\/wp-content\/uploads\/2014\/11\/15129165171_617a8f28db_b-300x164.jpg 300w, https:\/\/chris-stubbs.co.uk\/wp\/wp-content\/uploads\/2014\/11\/15129165171_617a8f28db_b-500x273.jpg 500w, https:\/\/chris-stubbs.co.uk\/wp\/wp-content\/uploads\/2014\/11\/15129165171_617a8f28db_b.jpg 991w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The system relies on packets being repeated between nodes, before hitting a &#8220;gateway&#8221; node which is connected to the internet. This may be a node connected to a PC, or a raspberry pi with an RFM69 radio. After seeing the ESP8266 popping up in various places, I decided to order a couple of modules and design a PCB for a simple AVR based wifi node.<\/p>\n<p><a href=\"http:\/\/chris-stubbs.co.uk\/wp\/wp-content\/uploads\/2014\/11\/qlbQJpC.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-566\" src=\"http:\/\/chris-stubbs.co.uk\/wp\/wp-content\/uploads\/2014\/11\/qlbQJpC-300x214.jpg\" alt=\"qlbQJpC\" width=\"300\" height=\"214\" srcset=\"https:\/\/chris-stubbs.co.uk\/wp\/wp-content\/uploads\/2014\/11\/qlbQJpC-300x214.jpg 300w, https:\/\/chris-stubbs.co.uk\/wp\/wp-content\/uploads\/2014\/11\/qlbQJpC-419x300.jpg 419w, https:\/\/chris-stubbs.co.uk\/wp\/wp-content\/uploads\/2014\/11\/qlbQJpC.jpg 812w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The PCB was very quick to put together and Phil&#8217;s repeater code had it working almost straight away.<\/p>\n<p><a href=\"http:\/\/chris-stubbs.co.uk\/wp\/wp-content\/uploads\/2014\/11\/node.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-565 size-medium\" src=\"http:\/\/chris-stubbs.co.uk\/wp\/wp-content\/uploads\/2014\/11\/node-300x168.jpg\" alt=\"node\" width=\"300\" height=\"168\" srcset=\"https:\/\/chris-stubbs.co.uk\/wp\/wp-content\/uploads\/2014\/11\/node-300x168.jpg 300w, https:\/\/chris-stubbs.co.uk\/wp\/wp-content\/uploads\/2014\/11\/node-500x281.jpg 500w, https:\/\/chris-stubbs.co.uk\/wp\/wp-content\/uploads\/2014\/11\/node.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>I put together a library for sending HTTP POST requests to the ukhasnet server from an ESP8266 via AT commands. I updated my ESP chip with this firmware (<a href=\"http:\/\/www.electrodragon.com\/w\/File:V0.9.2.2_AT_Firmware.bin.zip\">File:V0.9.2.2_AT_Firmware.bin.zip from\u00a0http:\/\/www.electrodragon.com\/w\/Wi07c<\/a> \/ \u00a0 <a href=\"http:\/\/chris-stubbs.co.uk\/wp\/wp-content\/uploads\/2014\/11\/V0.9.2.2_AT_Firmware.bin_.zip\">Mirror<\/a>) to reduce the speed down to 9600 baud. The chip does indeed work with WPA2 (which I was not expecting, possibly down to the firmware update)<\/p>\n<p>The node has been running now for about 72 hours with no apparent problems \ud83d\ude42<\/p>\n<p>The ESP8266 Library, repeater\/gateway code (credit to Phil) and PCB files are up at <a href=\"https:\/\/github.com\/chrisstubbs93\/ESP8266\">https:\/\/github.com\/chrisstubbs93\/ESP8266<\/a><\/p>\n<p>The basic upload sketch looks something like this:<code><br \/>\n<\/code><\/p>\n<pre>#include \"ESP8266.h\"\r\n#include \"wifiConfig.h\" \/\/this is where you need to set your SSID and Password\r\n#define DST_IP \"212.71.255.157\" \/\/ukhas.net 212.71.255.157\r\n#define WIFI_EN 7 \/\/CH_PD\r\n\r\nESP8266 esp8266 = ESP8266();\r\n\r\nvoid setup()\r\n{\r\n  Serial.begin(9600); \/\/Open serial communications \r\n  esp8266.initialise(Serial, WIFI_EN); \/\/Pass it over to the ESP8266 class, along with the pin number to enable the module (CH_PD)\r\n  while (!esp8266.resetModule()); \/\/reset module until it is ready\r\n  esp8266.tryConnectWifi(SSID, PASS);\/\/connect to the wifi\r\n  esp8266.singleConnectionMode(); \/\/set the single connection mode\r\n}\r\n\r\nvoid loop()\r\n{\r\n  esp8266.uploadPacket(DST_IP, \"your_data\");\r\n  delay(10000);\r\n}\r\n<\/pre>\n<p><code><br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since the UKHAS conference in August I have been playing with some UKHASnet nodes, which are &#8220;A simple wireless network aimed for use with low power licence exempt wireless modules&#8221;. The system was developed by members of the UKHAS community, &hellip; <a href=\"https:\/\/chris-stubbs.co.uk\/wp\/?p=563\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3,1],"tags":[],"class_list":["post-563","post","type-post","status-publish","format-standard","hentry","category-electronics","category-uncategorized"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/chris-stubbs.co.uk\/wp\/index.php?rest_route=\/wp\/v2\/posts\/563","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chris-stubbs.co.uk\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chris-stubbs.co.uk\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chris-stubbs.co.uk\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chris-stubbs.co.uk\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=563"}],"version-history":[{"count":4,"href":"https:\/\/chris-stubbs.co.uk\/wp\/index.php?rest_route=\/wp\/v2\/posts\/563\/revisions"}],"predecessor-version":[{"id":572,"href":"https:\/\/chris-stubbs.co.uk\/wp\/index.php?rest_route=\/wp\/v2\/posts\/563\/revisions\/572"}],"wp:attachment":[{"href":"https:\/\/chris-stubbs.co.uk\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=563"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chris-stubbs.co.uk\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=563"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chris-stubbs.co.uk\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}