UKHASnet WiFi node using ESP8266

Since the UKHAS conference in August I have been playing with some UKHASnet nodes, which are “A simple wireless network aimed for use with low power licence exempt wireless modules”.
The system was developed by members of the UKHAS community, but is not specifically aimed at ballooning (however can be used for it).
I 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’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.

15129165171_617a8f28db_b

The system relies on packets being repeated between nodes, before hitting a “gateway” 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.

qlbQJpC

The PCB was very quick to put together and Phil’s repeater code had it working almost straight away.

node

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 (File:V0.9.2.2_AT_Firmware.bin.zip from http://www.electrodragon.com/w/Wi07c /   Mirror) 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)

The node has been running now for about 72 hours with no apparent problems 🙂

The ESP8266 Library, repeater/gateway code (credit to Phil) and PCB files are up at https://github.com/chrisstubbs93/ESP8266

The basic upload sketch looks something like this:

#include "ESP8266.h"
#include "wifiConfig.h" //this is where you need to set your SSID and Password
#define DST_IP "212.71.255.157" //ukhas.net 212.71.255.157
#define WIFI_EN 7 //CH_PD

ESP8266 esp8266 = ESP8266();

void setup()
{
  Serial.begin(9600); //Open serial communications 
  esp8266.initialise(Serial, WIFI_EN); //Pass it over to the ESP8266 class, along with the pin number to enable the module (CH_PD)
  while (!esp8266.resetModule()); //reset module until it is ready
  esp8266.tryConnectWifi(SSID, PASS);//connect to the wifi
  esp8266.singleConnectionMode(); //set the single connection mode
}

void loop()
{
  esp8266.uploadPacket(DST_IP, "your_data");
  delay(10000);
}


Leave a Reply

Your email address will not be published. Required fields are marked *