Wednesday, October 19, 2016

Esp8266 meets LoRaWan

I guess that you don't have any doubts that ESP8266 can do LoRaWan.

For this project I've used two modules:


1.LoRaWan Single Channel Gateway


Single channel gateway ( to be compatible with LoRaWan you must have 8 channes) was made using the SX1276 module and a Raspberry Pi2. Comunication is done over SPI using wiringPi library.



Single channel gateway


2.LoRaWan node with ESP8266 


For node I've used the Witty module with the modifications from this post.

As a software I've used the ported LMICv1.51 and modified to send data to only one channel since the gateway is single channel ( I am using 868.1Mhz).


Lora Node with ESP8266

Now the gateway is enrolled in TTN ( https://thethingsnetwork.org/) and the data has started to arrive. I've managed to receive also data from other surrounding nodes.



On the gateway data looks like:




Packet RSSI: -107, RSSI: -105, SNR: -11, Length: 108

rxpk update: {"rxpk":[{"tmst":368384825,"chan":0,"rfch":0,"freq":868.100000,"stat":1,"modu":"LORA","datr":"SF7BW125","codr":"4/5","lsnr":-11,"rssi":-107,"size":108,"data":"Wqish6GVYpKy6o9WFHingeTJ1oh+ABc8iALBvwz44yxZP+BKDocaC5VQT5Y6dDdUaBILVjRMz0Ynzow1U/Kkts9AoZh3Ja3DX+DyY27exB+BKpSx2rXJ2vs9svm/EKYIsPF0RG1E+7lBYaD9"}]}


and data from my nodes:


Packet RSSI: -28, RSSI: -105, SNR: 12, Length: 31


rxpk update: {"rxpk":[{"tmst":1060664170,"chan":0,"rfch":0,"freq":868.100000,"stat":1,"modu":"LORA","datr":"SF7BW125","codr":"4/5","lsnr":12,"rssi":-28,"size":31,"data":"QGIH4AIAqgABvJNVF4DpUapp/xQN1REVnI+jYoR6Ig=="}]}


Next I'll have to add sensors to nodes and to run some tests for range and buy a real gateway.


More info about LMIC port and code here.

More info about ESP8266  and code here.

New LoRa modules from dorji.com

Santa Claus came early this year for me with 10 great modules from dorji.com. You can buy them easy on tindie,com , ebay.com or give them an email.

Modules are based on SX1276 chip have the code DRF1276G with the full specs:

  •  (G)FSK/4(G)FSK/LoRa Modulation
  •  868/915MHz transceiver
  •  20dBm output power
  •  -139dBm sensitivity
  •  Standard SPI interface
  •  127dB dynamic Range RSSI
  •  Automatic RF sense and CAD monitor
  •  Data Rate: <300 kbps
  •  Standby current: <1uA
  • Supply voltage: 1.8~3.6V


Dorji DRF1276G LoRa 868Mhz modules

Comparing them with other modules I have, from niceRF, the space between the pads is 2mm versus 1mm on niceRF so there is more easy to solder them on. Also have pins on both sides so is much easy to design a good PCB. See a picture with the niceRF LoRa module.

niceRF SX1276  v1.1 868Mhz LoRa module


I will connect them to the ESP8266 on the SPI I will let you know about the progress.

You can connect them to this ESP module or this one which is battery operated (keep in mind that are 3.3V modules) and don't forget to read this post.

Another nice thing abut this modules is that you can use them as a single channel gateway for LoRa so you will make an economy of few hundred euros so you can buy more modules and test or deploy your network.





Finally my LoRa gateway will be happy to receive another 10 motes. I am waiting for ideas what to connect as sensors for  nodes. 

Other software I am working on is a new LoRa Network Server that will be deployed as SaaS into the cloud so anyone can have a LoRa Server in a matter of minutes. With this server will be very easy to deploy your private LoRa network.

As a status, the Rx (uplink) part is done and I am working now on the TX ( downlink).  The network server will support for the beginning the latest version (2) and I will add previous version (1) later on.

My LoRa Gateway