Dragino LG01 LoRa User manual

www.dragino.com
LoRa Gateway User Manual ---Update:2017-02-21 1 / 44
LG01 LoRa Gateway User Manual
Document Version: 1.0
Firmware Version: IoT Mesh v3.4.0
Version
Description
Date
0.1
Initiate
2016-Oct-29
1.0
Release, Add ThingSpeak Examples
2016-Dec-9

www.dragino.com
LoRa Gateway User Manual ---Update:2017-02-21 2 / 44
Index:
1Introduction ............................................................................................................4
1.1 Overview.......................................................................................................4
1.2 What is LG01.................................................................................................4
1.3 Specifications................................................................................................4
1.4 Features ........................................................................................................6
1.5 System Structure ..........................................................................................6
1.6 Applications ..................................................................................................7
1.7 Hardware Variants ........................................................................................8
2Quick Start Guide ....................................................................................................9
2.1 Access and config LG01 ................................................................................9
2.2 Program microcontroller.............................................................................10
2.2.1 Download and configure Arduino IDE..............................................10
2.2.2 Upload a sketch in the MCU.............................................................12
2.3 Simple LoRa wireless example....................................................................14
2.3.1 Installing LoRa Library ......................................................................14
2.3.2 Upload LoRa Server Sketch ..............................................................15
2.3.3 Upload LoRa Client Sketch ...............................................................15
3Typical Network Setup ..........................................................................................16
3.1 Overview.....................................................................................................16
3.2 General WiFi AP Network...........................................................................17
3.3 WAN Port Internet Mode ...........................................................................18
3.4 WiFi Client Mode........................................................................................18
3.5 Mesh WiFi Network....................................................................................19
3.5.1 Mesh Gateway Set Up......................................................................19
3.5.2 Mesh Client Set Up...........................................................................21
3.6 USB Dial Up Modem Set Up .......................................................................23
3.7 USB 3G/4G Ethernet Dongle ......................................................................24
4Linux System..........................................................................................................25
4.1 SSH Access for Linux console......................................................................25
4.2 Edit and Transfer files .................................................................................26
4.3 File System..................................................................................................26
4.4 Package maintain system............................................................................27
5Bridge Library ........................................................................................................28
6Advance Management ..........................................................................................29
6.1 Reset Network or Reset to Factory Default................................................29
7Upgrade Firmware ................................................................................................30
7.1 Upgrade via Web UI....................................................................................30
7.2 Upgrade via Linux console..........................................................................30

www.dragino.com
LoRa Gateway User Manual ---Update:2017-02-21 3 / 44
8Auto-Provisioning..................................................................................................31
9Advance Examples ................................................................................................31
9.1 Upstream: Get data from LoRa node and send to IoT server ....................31
9.1.1 Set up hardware...............................................................................31
9.1.2 Set up IoT Server account ................................................................31
9.1.3 Upload sketches ...............................................................................32
9.1.4 Check Result.....................................................................................32
9.2 Downstream: Get data from IoT Server and send to LoRa node ...............33
9.2.1 Set up Hardware ..............................................................................33
9.2.2 Set up talkback command................................................................33
9.2.3 Upload sketches ...............................................................................34
9.2.4 Check Result.....................................................................................34
9.3 Multiple Nodes examples...........................................................................35
9.4 More Examples...........................................................................................36
10 FAQ.................................................................................................................37
10.1 Why there is 433/868/915 version LoRa part?.......................................37
10.2 What is the frequency range of LG01 LoRa part? ...................................37
10.3 How may nodes can the LG01 support? .................................................37
10.4 What kind of Server the LG01 can support?...........................................37
10.5 Can I make my own firmware for LG01? Where can I find the source
code of LG01? ......................................................................................................38
11 Trouble Shooting............................................................................................39
11.1 I can’t download the Dragino profile in Arduino IDE. .............................39
11.2 Bridge between MCU and Linux module doesn’t work..........................40
11.3 Arduino IDE doesn’t detect LG01............................................................40
11.4 I get kernel error when install new package, how to fix? .......................40
11.5 How to recover the LG01 if firmware crash ............................................41
12 Order Info.......................................................................................................42
13 Packing Info....................................................................................................42
14 Support...........................................................................................................42
15 Reference .......................................................................................................44

www.dragino.com
LoRa Gateway User Manual ---Update:2017-02-21 4 / 44
1Introduction
1.1 Overview
1.2 What is LG01
The LG01 is an open source single channel LoRa Gateway. It lets you bridge LoRa wireless
network to an IP network base on WiFi, Ethernet, 3G or 4G cellular. LG01 runs on open source
embedded Linux system; it has USB host port and has full Ethernet and 802.11 b/g/n WiFi
capabilities. The USB host port can be used to connect cellular modules so LG01 is very flexible to
bridge LoRa Network to different kinds of network to fit user’s requirement.
1.3 Specifications
Hardware System:
Linux Part:
400Mhz ar9331 processor
64MB RAM
16MB Flash
MCU Part:
MCU: ATMega328P
Flash: 32KB
SRAM: 2KB
EEPROM: 1KB
Interface:
Power Input: 9 ~ 24v DC
2 x RJ45 ports
USB 2.0 Host port x 1
Internal USB 2.0 Host Interface x 1
LG01 in an IoT Network

www.dragino.com
LoRa Gateway User Manual ---Update:2017-02-21 5 / 44
WiFi Spec:
IEEE 802.11 b/g/n
Frenquency Band: 2.4 ~ 2.462GHz
Tx power:
11n tx power : mcs7/15: 11db mcs0 : 17db
11b tx power: 18db
11g 54M tx power: 12db
11g 6M tx power: 18db
Wifi Sensitivity
11g 54M : -71dbm
11n 20M : -67dbm
LoRa Spec:
Frequency Range:
Band 1 (HF): 862 ~ 1020 Mhz
Band 2 (LF): 410 ~ 528 Mhz
Band 3 (LF): 137 ~ 175 Mhz
168 dB maximum link budget.
+20 dBm - 100 mW constant RF output vs.
+14 dBm high efficiency PA.
Programmable bit rate up to 300 kbps.
High sensitivity: down to -148 dBm.
Bullet-proof front end: IIP3 = -12.5 dBm.
Excellent blocking immunity.
Low RX current of 10.3 mA, 200 nA register retention.
Fully integrated synthesizer with a resolution of 61 Hz.
FSK, GFSK, MSK, GMSK, LoRaTM and OOK modulation.
Built-in bit synchronizer for clock recovery.
Preamble detection.
127 dB Dynamic Range RSSI.
Automatic RF Sense and CAD with ultra-fast AFC.
Packet engine up to 256 bytes with CRC.
Built-in temperature sensor and low battery indicator.

www.dragino.com
LoRa Gateway User Manual ---Update:2017-02-21 6 / 44
1.4 Features
Open source Linux (OpenWrt) inside. User can modify or compile the firmware with
custom features and own brand.
Low power consumption.
Compatible with Arduino IDE 1.5.4 or later, user can program, debug or upload sketch
to the MCU via Arduino IDE.
Managed by Web GUI, SSH via LAN or WiFi.
Software upgradable via network.
Auto-Provisioning.
Built-in web server.
Support internet connection via LAN port, WiFi or 3G /4G dongle.
Failsafe design provides robustly system.
1.5 System Structure

www.dragino.com
LoRa Gateway User Manual ---Update:2017-02-21 7 / 44
1.6 Applications

www.dragino.com
LoRa Gateway User Manual ---Update:2017-02-21 8 / 44
1.7 Hardware Variants
There are different LG01 variants for difference applications. Below table shows the difference
between these models.
Model
Photo
Description
LG01-P
The most general version can be used as a LoRa
Gateway.
LG01-S
Include screw terminal which can connect to external
sensors
OLG01
Our door version, this version doesn’t include LoRa
antenna, instead, it has a SMA connector, user can
connect it to a high gain LoRa antenna.
It can be powered by a passive PoE adapter.

www.dragino.com
LoRa Gateway User Manual ---Update:2017-02-21 9 / 44
2Quick Start Guide
2.1 Access and config LG01
The LG01 is configured as a WiFi AP by factory default. User can access and configure the LG01
after connect to its WiFi network.
At the first boot of LG01, it will auto generate an unsecure
WiFi network call dragino2-xxxxxx
User can use the laptop to connect to this WiFi network. The
laptop will get an IP address 10.130.1.xxx and the LG01 has the
default IP 10.130.1.1
Open a browser in the laptop and type 10.130.1.1
User will see the login interface of LG01.
The account for Web Login is:
User Name: root
Password: dragino

www.dragino.com
LoRa Gateway User Manual ---Update:2017-02-21 10 / 44
2.2 Program microcontroller.
The MCU (microcontroller) M328P is used to communicate with LoRa Radio part and Dragino
Linux module. The program language for the MCU is based on C and program tool is Arduino IDE.
Below the way shows how to do program it.
2.2.1 Download and configure Arduino IDE
Download the latest Arduino Software(IDE) from Arduino official site:
https://www.arduino.cc/en/Main/Software
Install the IDE in the PC, open it and click File --> Preference, add below URL
http://www.dragino.com/downloads/downloads/YunShield/package_dragino_yun_test_index.js
on in the Additional Boards Manager URLs.
Go to tools --> Boards --> Boards Manager, find Dragino boards info and install it.

www.dragino.com
LoRa Gateway User Manual ---Update:2017-02-21 11 / 44
After install Dragino’s board info in the IDE, we can see the boards info from the IDE, as
below screenshot. For LG01, we should choose: Arduino Uno –Dragino Yun.
Note: If user has trouble to install via Board Manager. User can manually add the board profile.

www.dragino.com
LoRa Gateway User Manual ---Update:2017-02-21 12 / 44
2.2.2 Upload a sketch in the MCU
For the very start, we can try to upload a simple sketch to the MCU and see how it works.
Make sure your computer and the LG01 is in the same network, if you already connect to
the LG01 WiFi SSID, then both devices are in the same WiFi network. In the IDE, select the
correct port as below screenshot.
Select the example from IDE --> File --> Examples --> Dragino --> Basic --> Blink
Click Upload to upload the sketch to LG01, the LG01 may ask you password to upload, if so,
type the password of LG01.

www.dragino.com
LoRa Gateway User Manual ---Update:2017-02-21 13 / 44
Check result
The blink sketch will set the A2 pin of the MCU to periodically high and low. This pin
connects to the HEART LED of the LG01. So if successfully upload this sketch, user can see
the HEART LED turn on and turn off periodically.

www.dragino.com
LoRa Gateway User Manual ---Update:2017-02-21 14 / 44
2.3 Simple LoRa wireless example
To test LoRa wireless, we at least need 2 devices support LoRa. In this example we will use below
devices:
LoRa Server: LG01 ; LoRa Client: LoRa Shield + Arduino Uno
Or
LoRa Server: LG01 ; LoRa Client: LG01
Above two combination will shows the same LoRa feature, we provide different devices examples
in LoRa Client which is for user convenient only.
2.3.1 Installing LoRa Library
The Library used here is Radiohead Library, Which can be download from
http://www.airspayce.com/mikem/arduino/RadioHead/RadioHead-1.63.zip . unzip it and put it in
the Arduino Library Folder. Reference: Installing Library in Arduino

www.dragino.com
LoRa Gateway User Manual ---Update:2017-02-21 15 / 44
2.3.2 Upload LoRa Server Sketch
Select the example from:
IDE --> File --> Examples --> Dragino --> LoRa --> LoRa_Simple_Server_Yun
Upload this Sketch to the LG01, then open the serial monitor to monitor the LG01 status, as
below screenshot
2.3.3 Upload LoRa Client Sketch
For LoRa Shield + Arduino as LoRa Client:
Select the example from:
IDE --> File --> Examples --> Dragino --> LoRa --> LoRa_Simple_Client_Arduino
Upload it to Arduino board, and open the serial monitor , you will get as below screenshot.
For another LG01 as LoRa Client:
Method is same as above, but the example sketch is:
IDE --> File --> Examples --> Dragino --> LoRa --> LoRa_Simple_Client_Yun

www.dragino.com
LoRa Gateway User Manual ---Update:2017-02-21 16 / 44
3Typical Network Setup
3.1 Overview
LG01 support flexible network set up for different environment. This section describes the typical
network topology can be set in LG01. The typical network set up includes:
WAN Port Internet Mode
WiFi Client Mode
WiFi AP Mode
Mesh WiFi Network
USB Dial Up Mode
USB Ethernet Mode
Before setting network parameters, user can set up the Display Net Connection under Web -->
Network --> Internet Access for easily checking network status. LG01 will check the network
connection to the host and show the status in GLOBAL LED. The GLOBAL LED will blink if LG01
has network connection to that host.
The network settings are under the network section, in the follow section of this chapter, we will
show how to configure the LG01 for typically network usage.

www.dragino.com
LoRa Gateway User Manual ---Update:2017-02-21 17 / 44
3.2 General WiFi AP Network
In the General AP Mode, LG01 gets internet access from its WAN port or USB 3G/4G/GPRS. LG01
itself acts as a WiFi Access Point and provide a WiFi AP network. LG01 shares the internet to its
AP network or LAN interface. Diagram is as below:
Set Up in Web UI for General WiFi AP mode
Network --> Internet Access:
Access Internet via WAN PORT or USB Modem
Network --> LAN and DHCP
Enable DHCP server in its LAN port
Network --> Access Point
Enable WiFi AP
Input SSID/ Encryption/ Passphrase
Network --> Mesh Network:
Disable WiFi Mesh Network

www.dragino.com
LoRa Gateway User Manual ---Update:2017-02-21 18 / 44
3.3 WAN Port Internet Mode
The LG01 will use WAN port for internet connection. When connect LG01’s WAN port to router,
LG01 will get IP from router and have internet access. This is the default setting. It also shares the
internet to its LAN port and WiFi AP network for other devices.
3.4 WiFi Client Mode
In the WiFi Client Mode, Dragino acts as a WiFi client and gets DHCP from uplink router via WiFi.
It also shares the internet to its LAN port for other devices.
Set Up in Web UI
Network --> Internet Access:
Access Internet via WiFi Client
Way to Get IP: DHCP
Input correct SSID, Password and Encryption.
Network --> LAN and DHCP
Enable DHCP server in its LAN port
Network --> Access Point
Disable WiFi AP
Network -->Mesh Network
Disable WiFi Mesh Network

www.dragino.com
LoRa Gateway User Manual ---Update:2017-02-21 19 / 44
3.5 Mesh WiFi Network
In the mesh network topology, user should choose the device to be a mesh gateway node or
mesh client node
Mesh Gateway: use WAN port or USB 3G/4G modem to get internet access from uplink router. It
also shares the internet to its Mesh Network for other Mesh Clients. The Mesh Gateway also acts
as a DHCP router for its mesh network.
Mesh Client: Connects to the Mesh Gateway via mesh network, it also bridge internet via the
LAN and WiFi AP interface.
3.5.1 Mesh Gateway Set Up
Network --> Internet Access
Access Internet via WAN PORT or USB Modem
Select Internet Connection Method for mesh gateway

www.dragino.com
LoRa Gateway User Manual ---Update:2017-02-21 20 / 44
Network --> LAN and DHCP
Enable DHCP server in its LAN port
Set Gateway to 255.255.255.255
Network --> Access Point
Enable WiFi AP (not necessary), Can set same SSID in the mesh network
Network --> Mesh Network
Enable WiFi Mesh Network
Input Mesh Group //Note: Mesh Device within same group can communicate with each
other. Mesh Group is a translation for BSSID for easy configure and remember.
This manual suits for next models
10
Table of contents
Other Dragino Gateway manuals

Dragino
Dragino LG01v2 User manual

Dragino
Dragino LPS8 User manual

Dragino
Dragino LG308N User manual

Dragino
Dragino LG01v2 User manual

Dragino
Dragino DLOS8N User manual

Dragino
Dragino G308 User manual

Dragino
Dragino LG01N User manual

Dragino
Dragino LIG16 User manual

Dragino
Dragino LG308 User manual

Dragino
Dragino LG02 User manual

Dragino
Dragino LPS8 User manual

Dragino
Dragino LPS8v2 User manual

Dragino
Dragino LG01N User manual

Dragino
Dragino DLOS8 User manual

Dragino
Dragino LPS8 User manual

Dragino
Dragino LPS8-868 User manual

Dragino
Dragino LG308 User manual

Dragino
Dragino LG01N User manual

Dragino
Dragino LPS8N User manual

Dragino
Dragino LG02 User manual