DIY low-cost LoRa gateway based on pcDuino

From LinkSprite Playgound
Revision as of 08:13, 16 February 2017 by Alvin (talk | contribs) (Introduction)
Jump to: navigation, search

Introduction

Thanks to this open source project which uses the Raspberry Pi as Lora gateway and Arduino as Lora node device. We port this project to pcDuino and send the received data from Lora node to LinkSpriteIO. The basic architecture is shown as the following diagram.

Lora Gateway 组图.jpg

LoRa 2 A.png

There is an Arduino Lora node to read the sensor's data and send it to pcDuino Lora gateway. After pcDuino Lora gateway recevice the data and it will send it to LinkSpriteIO which is our IoT cloud.

The following content, I will introduce the details of how to DIY a low-cost Lora gateway with pcDuino and Arduino.

Required

pcDuino lora gateway

Arduino lora node

  • Arduino Uno x 1

Steps

1. Assemble the hardware

  • According to the following pins map table to connect the lora module and pcDuino or Arduino

LoRa 2 B.jpg

Arduino Lora node

LoRa 2 C.png

pcDuino Lora Gateway

LoRa 2 D.png

2. Program Arduino Uno

  • Download the Arduino program from github
  • Use Arduino IDE to open the Arduino_LoRa_node project in examples folder
  • Upload this program to Arduino Uno
  • Open Serial Monitor to check the message

LoRa 2 E.png

3. Program on the pcDuino8 Uno

Create device on LinkSpriteIO

  • Go to www.linksprite.io and sign up
  • Enter your Email and password to create a new account
  • Go to My Account to get your own API Key.

LoRa 2 F.png

  • Click My Device, and choose Create DIY Device.

LoRa 2 G.png

  • Click the created device icon and get the DeviceID **.

LoRa 2 H.png

Download the source code

  • Access to the pcDuino8 Uno Ubuntu system Note: user name and password are all: linaro:
git clone https://github.com/YaoQ/pcduino-lora-AP
cd pcDuino-lora-AP/pcduino-gateway
make
  • Use your own deviceID and apikey to update the line 27 and 28 in LinkSpriteIO_Post.py
26 # Use your own deviceID and apikey
27 deviceID="xxxxxxxxxx"
28 apikey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

4. Test

To make it simple, we just use random number to simulate the temperature value and send it periodically to pcDuino lora gateway. Then pcDuino Lora gateway will post data to LinkSpriteIO.

./pcduino-gateway | python LinkSpriteIO_Post.py

On Arduino side:

LoRa 2 I.png

On pcDuino side:

LoRa 2 J.png

On LinkSpriteIO side:

LoRa 2 K.png