Dragino LG02 User Manual

Dragino LG02 User Manual

Lora gateway
Hide thumbs Also See for LG02:
Table of Contents

Advertisement

Quick Links

LG02/OLG02 LoRa Gateway User Manual
Document Version: 1.5.2
Firmware Version: LG02_LG08--build-v5.3.1581838658-20200216-1539
Version
Description
1.0
Release
1.1
Enrich content for ABP
1.2
Add TCP_IP Client Instruction, Add Radiohead support
(firmware ver > LG02_LG08--build-v5.1.1541419802-20181105-2011)
1.3
Add notice for recover mode, add packet relay mode example.
Add Example for LoRa RAW.
Add Manual for MQTT mode
(firmware ver > LG02_LG08--build-v5.1.1545026772-20181217-1407)
1.4
Add Customized Script Feature
(firmware ver >LG02_LG08--build-v5.1.1547896817-20190119-1921)
1.5
-Add Downlink support and example.
(firmware ver >LG02_LG08--build-v5.1.1548820215-20190130-1151)
-Correct typo for the UNO code of example for lg02_single_rx_tx
1.5.1
Add How to control LEDs, add hardware source, improve limitation
description.
1.5.2
Relay mode limitation, MQTT instruction
1.5.3
Add photo for OLG02 SIM card installation
1.5.4
--Change the HTTP Port and SSH port for firmware version > v5.3
LG02 LoRa Gateway User Manual
www.dragino.com
Date
2018-Sep-11
2018-Oct-07
2018-Nov-5
2018-Dec-27
2019-Jan-19
2019-Jan-30
2019-May-13
2019-Jun-19
2019-Nov-01
2019-Nov-26
1 / 63

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the LG02 and is the answer not in the manual?

Questions and answers

Summary of Contents for Dragino LG02

  • Page 1 LG02/OLG02 LoRa Gateway User Manual Document Version: 1.5.2 Firmware Version: LG02_LG08--build-v5.3.1581838658-20200216-1539 Version Description Date Release 2018-Sep-11 Enrich content for ABP 2018-Oct-07 Add TCP_IP Client Instruction, Add Radiohead support 2018-Nov-5 (firmware ver > LG02_LG08--build-v5.1.1541419802-20181105-2011) Add notice for recover mode, add packet relay mode example.
  • Page 2 1.6.0 -- Add more features, remote access 2020-Mar-02 LG02 LoRa Gateway User Manual 2 / 63...
  • Page 3: Table Of Contents

    Introduction ..........................6 What is LG02 & OLG02 ....................... 6 Specifications ..........................7 Features ............................9 System Structure ........................9 Applications ..........................10 Hardware Variants ........................11 Install SIM card in 4G module ....................12 Firmware Change log ....................... 12 Access LG02 ..........................
  • Page 4 Can I develop my own application for LG02? ............... 55 13.5 Can I make my own firmware for LG02? Where can I find the source code of LG02? ..55 13.6 Can I change the LoRa behavior of LG02? ................55 13.7...
  • Page 5 14.2 How to recover the LG02 if firmware crash ................. 59 14.3 I configured LG02 for WiFi access and lost its IP. What to do now?........60 Order Info ..........................61 Packing Info ..........................61 Support ........................... 61 Reference ..........................63...
  • Page 6: Introduction

    LG02 & OLG02 provide a low cost for your IoT network connection. Compare to the cost with normal SX1301 LoRaWAN solution. LG02 & OLG02 is only of its 1/4 or less cost. This makes the LG02 very suitable to set up small scale LoRa network or use it to extend the coverage of current LoRaWAN network.
  • Page 7: Specifications

    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. LG02 LoRa Gateway User Manual 7 / 63...
  • Page 8  Up to 150Mbps downlink and 50Mbps uplink data rates  Worldwide LTE,UMTS/HSPA+ and GSM/GPRS/EDGE coverage  MIMO technology meets demands for data rate and link reliability in modem wireless communication systems LG02 LoRa Gateway User Manual 8 / 63...
  • Page 9: Features

    Limited support in LoRaWAN/ Support Private LoRa protocol  Support upto 300 nodes  LoRa band available at 433/868/915/920 Mhz  Max range in LoRa: 5~10 km. Density Area:>500m 1.4 System Structure LG02 LoRa Gateway User Manual 9 / 63...
  • Page 10: Applications

    1.5 Applications LG02 LoRa Gateway User Manual 10 / 63...
  • Page 11: Hardware Variants

    1.6 Hardware Variants The LG02 and OLG02 use the same firmware and have the same feature in the software side. In this document, we will use LG02 as the model number to explain the feature. Model Photo Description Indoor version for dual channel LoRa Gateway,...
  • Page 12: Install Sim Card In 4G Module

    1.7 Install SIM card in 4G module For LG02 & OLG02 4G version, the 4G module is inside the box, please open the box and use below direction to install the SIM card 1.8 Firmware Change log Please see this link for firmware change log: http://www.dragino.com/downloads/index.php?dir=LoRa_Gateway/LG02-OLG02/Firmware/&file...
  • Page 13: Access Lg02

    2. Access LG02 Access and configure LG02 The LG02 is configured as a WiFi AP by factory default. User can access and configure the LG02 after connect to its WiFi network. At the first boot of LG02, it will auto generate an unsecure WiFi network call dragino-xxxxxx User can use the laptop to connect to this WiFi network.
  • Page 14: Typical Network Setup

    3.2 Use WAN port to access Internet By default, the LG02 set to use WAN port as network connection. When connect LG02’s WAN port to router, LG02 will get IP from router and have internet access. The network status can be checked as below:...
  • Page 15: Access Internet As A Wifi Client

    3.3 Access Internet as a WiFi Client. In the WiFi Client Mode, Dragino acts as a WiFi client and gets DHCP from uplink router via WiFi. The step to set is as below: Step1: In network -> Wireless, select Radio0 interface and scan.
  • Page 16 After successful associate, the WiFi network interface can be seen in the same page: LG02 LoRa Gateway User Manual 16 / 63...
  • Page 17: Use Built-In 4G Modem For Internet Access

    3.4 Use built-in 4G modem for internet access For the LG02 model with 4G version, user can configure the modem for internet access. Step 1: Add New Interface LG02 LoRa Gateway User Manual 17 / 63...
  • Page 18 Step 2: Configure cellular interface Step 3: Check Result Note: In case you don’t know if your device has 4G modem, you can run lsusb command in SSH access to check, as below: LG02 LoRa Gateway User Manual 18 / 63...
  • Page 19: Check Internet Connection

    3.5 Check Internet connection User can use the diagnostics page to check and analyze Internet connection. LG02 LoRa Gateway User Manual 19 / 63...
  • Page 20: Example 1: Configure As A Lorawan Gateway - Lorawan Mode

    4. Example 1: Configure as a LoRaWAN gateway – LoRaWAN mode LG02 has two LoRa channels and can be configured as a Dual Channel LoRaWAN gateway. LG02 is pre-configured to support one uplink channel and one downlink channel in the LoRaWAN mode.
  • Page 21 Step 3: Create a Gateway in TTN A8 40 41 1b 6f c4 41 50 LG02 LoRa Gateway User Manual 21 / 63...
  • Page 22: Configure Lg02 Gateway

    4.2 Configure LG02 Gateway 4.2.1 Configure to connect to LoRaWAN server We should configure the LG02 now to let it connect to TTN network. Make sure your LG02 has Internet Connection first. Step1: Configure LG02 to act as raw forwarder Step2: Input server info and gateway id Choose the correct the server address and gateway ID.
  • Page 23: Configure Lg02'S Rx Frequency

    Check Result After above settings, the LG02 should be able to connect to TTN, below is the result seen from TTN: 4.2.2 Configure LG02’s RX frequency Now we should configure LG02 to act receive the LoRaWAN packets. This is in Channel 1, we configure is to use 868.1Mhz (868100000 Hz) as below.
  • Page 24: Create Lora End Node

    LG02 supports LoRaWAN End Node, in LoRaWAN protocol, it requires LoRaWAN node to send data in a hopping frequency. Since LG02 only support one single frequency, it will only able to receive the packet which is of the same Radio Frequency set up in LG02 Radio 1.
  • Page 25: Preparation

    Install this library https://github.com/dragino/arduino-lmic to the Arduino Library path. Before compiling the End Device software, User needs to change the Frequency Band to use with LG02. What user need to change is in the file arduino\libraries\arduino-lmic \src\lmic\config.h. Changes are as below:...
  • Page 26: Test With Otaa Lora End Node (Lora Shield + Uno)

    4.3.3 Test with OTAA LoRa end node (LoRa Shield + UNO) Step 1: Create an OTAA device in TTN server -- > Application page. LG02 LoRa Gateway User Manual 26 / 63...
  • Page 27 2: Input keys into Arduino Sketch. The sketch for the LoRa Shield is in Arduino –IDE --> Examples -->LMIC_Arduino ttn-otaa Choose Arduino UNO to upload the sketch to LoRa Shield and UNO LG02 LoRa Gateway User Manual 27 / 63...
  • Page 28 Step 3: Check Result for OTAA Note: The LG02_DNWFREQ value in Arduno_LMIC/src/lmic/config.h should match downlink frequency from TTN. TTN shows 868.1 here, So LG02_DNWFREQ should be 868100000 LG02 LoRa Gateway User Manual 28 / 63...
  • Page 29 Downlink message Send out from TTN after the next uplink message arrive. In TTN --> Gateway --> Traffic Downlink message arrives gateway In LG02 --> Service --> Logread Downlink message arrives LoRa Shield In Arduino IDE --> Serial Monitor LG02 LoRa Gateway User Manual...
  • Page 30: Test With Abp Lora End Node (Lora Shield + Uno)

    4.3.4 Test with ABP LoRa end node (LoRa Shield + UNO) Step 1: Create an ABP device in TTN server -- > Application page. And change it to ABP mode. LG02 LoRa Gateway User Manual 30 / 63...
  • Page 31 Make sure the Network Session Key and App Session Key are in MSB order Arduino Sketch ttn-abp Input the keys from TTN Choose Arduino UNO to upload the sketch to LoRa Shield and UNO LG02 LoRa Gateway User Manual 31 / 63...
  • Page 32 In Arduino IDE --> Serial Monitor Packet Arrive Gateway. In page Service-->logread Packet Arrive TTN. In TTN --> Gateway --> Traffic Packet Arrive TTN Device Page. In TTN --> Application --> Device --> Data LG02 LoRa Gateway User Manual 32 / 63...
  • Page 33 Downlink message Send out from TTN after the next uplink message arrive. In TTN --> Gateway --> Traffic Downlink message arrives gateway In LG02 --> Service --> Logread Downlink message arrives LoRa Shield In Arduino IDE --> Serial Monitor LG02 LoRa Gateway User Manual...
  • Page 34: Example 2: Control Lora Radio Directly As General Lora Transceiver

    | Send packet immediately (will ignore tmst & time) tmst | number | Send packet on a certain timestamp value (will ignore time) tmms | number | Send packet at a certain GPS time (GPS synchronization required) LG02 LoRa Gateway User Manual 34 / 63...
  • Page 35 1) First set up a LoRa Shield with this code: LoRaReceiver. So the LoRa Shield will receive the data at frequency 915.6Mhz, SF7BW125, CR: 4/5 2) Edit a file (any name) under /var/iot/push/ with below content. {"txpk":{"freq":915.6,"powe":20,"datr":"SF7BW125","codr":"4/5","ipol":false,"data":"test"}} And then we can see below output LG02 LoRa Gateway User Manual 35 / 63...
  • Page 36: Use Lora Radio Device Directly

    5.2 Use LoRa radio device directly There are two SPI devices in LG02, user can use lg02_single_rx_tx to control this SPI device for transmit and receive. When use the lg02_single_rx_tx command to transmit, it will initiate the SPI device on each call and it will add delay to start transmit, this will be slower than the pkt_fwd...
  • Page 37 Then set up a LoRa node to send out LoRa packet, We use LoRa Shield + UNO in this example. The library use in Arduino UNO is LoRa-Master. And the source code is LoRaSender.. Result screen shot: LG02 LoRa Gateway User Manual 37 / 63...
  • Page 38 Step 3: Use lg02_single_rx_tx to transmit Command: root@dragino-1b6fb0:~# lg02_single_rx_tx -t -d 2 -f 915600000 –m “hello from dragino” Use radio 2 to transmit a message at frequency 9156000000 Set up a LoRa node to send out LoRa packet, We use LoRa Shield + UNO in this example.
  • Page 39: Example 3: Mqtt Transfer Mode

    Most IoT server support MQTT connection, for those servers, we can use MQTT to connect it to publish data or subscribe to a channel. A detail of how to use MQTT plus Video instruction can be found at: http://wiki.dragino.com/index.php?title=MQTT_Forward_Instruction LG02 LoRa Gateway User Manual 39 / 63...
  • Page 40: Example 4: Tcp Ip Client Mode

    7. Example 4: TCP IP Client Mode In the TCP IP Client mode, LG02 can accept LoRa packets and send it to the TCP-IP server. The working topology is as below. In this mode, The Uplink LoRa packets should use a customized format.
  • Page 41 For example, if we have configured 2 channels 12345 and 34567. And there is are three LoRa End nodes sending: 12345,34567,78 The LG02 will accept the data from 12345 and 34567, it will ignore the data from Node 78 Case 1: Node 12345 send <12345>field1=0.0&field2=1102.0...
  • Page 42: Example 5: Write A Customized Script

    8. Example 5: Write a customized script LG02 supports customized script to process LoRa data. This chapter describes about the data format from LoRa End node and How to write the script. The data flow from LoRa End Node to LG02 is as below: Example: Store Data in a file.
  • Page 43 Step 4: Configure the LoRa End Device to send sensor data. Here is an example code for LoRa Shield: End Device Code Outputs: End node send out packages: Gateway receive packet & Script find packet Script store data into file LG02 LoRa Gateway User Manual 43 / 63...
  • Page 44: Example 6: Lorawan Packet Relay Mode

    9. Example 6: LoRaWAN Packet Relay mode The LG02 has two radio channels, we can use these two channels as LoRaWAN relay to improve the network coverage. 9.1 How it works Basic concept: Get data in Radio 1 with match frequency, transmit the same data on Radio2 with pre-configure frequency.
  • Page 45 Step 3: Configure transmit channel info For example, if we want to transmit all received packets on: Frequency: 903.9Mhz, sf=7, bw=125000, cr=5, wd=0x34, bandwidth= 125k. Below is the configuration. LG02 LoRa Gateway User Manual 45 / 63...
  • Page 46: Limitation

    Uplink channels 1-9 (RX1) 869.525 - SF9BW125 (RX2 downlink only) For uplink: if we set LG02 to listen on 868.3 , SF7, BW125, and transmit at 868.3,SF7,BW125. The LG02 will receive all end node’s packet at 868.3 SF7BW125 and can’t receive other frequency from end node.
  • Page 47: More Features

    10.2 More instructions http://wiki.dragino.com/index.php?title=Main_Page#LoRa.2FLoRaWAN_Gateway_Instruction 11. Linux System The LG02 bases on OpenWrt Linux System. It is open source, and user are free to configure and modify the inside Linux settings. 11.1 SSH Access for Linux console User can access to the Linux console via SSH protocol. Make sure your PC and the LG01 is in the same network, then use a SSH tool (such as putty) to access it.
  • Page 48 LG02 LoRa Gateway User Manual 48 / 63...
  • Page 49: Edit And Transfer Files

    One of the easiest is through WinSCP utility. After access via WinSCP to the device, use can use a FTP alike window to drag / drop files to the LG02 or Edit the files directly in the windows. Screenshot is as below: 11.3 File System The LG02 has a 16MB flash and a 64MB RAM.
  • Page 50 4% /overlay //Flash: Remain after reboot Reset to factory default: mtd erase rootfs_data -r Except /tmp and /var. all data will be store in flash. /tmp and /var are store in RAM LG02 LoRa Gateway User Manual 50 / 63...
  • Page 51: Package Maintain System

    There are more than 3000+ packages available in our package server for user to install for their applications. For example, if user wants to add iperf tool, they can install the related packages and configure LG02 to use iperf Below is some examples opkgs command, more please refer...
  • Page 52: Upgrade Linux Firmware

    12. Upgrade Linux Firmware We keep improving the LG02 Linux side firmware for new features, bug fixes. The latest firmware can be found on LG02 Firmware & release note The file named as dragino-LG02_LG08----xxxxx-squashfs-sysupgrade.bin is the upgrade Image. There are different methods to upgrade, as below: 12.1...
  • Page 53: Faq

    End node transmits at 868.1Mhz, The LG02’s RX setting must be 868.1Mhz so to receive this packet. 2/ It works only for one DR at a time. DR specifies the Spreading Factor and Bandwidth. In LG02, even the rx frequency match , if DR doesn’t match, it still can’t get the sensor data.
  • Page 54 // g-band LMIC_setupChannel(8, 868800000, DR_RANGE_MAP(DR_FSK, DR_FSK), BAND_MILLI); // g2-band So the LG02 will only able to receive the packet and will not receive others. Means 868100000, SF7 only one packet will arrive the TTN server in every 8 packet sent from the LoRaWAN end node.
  • Page 55: Can I Develop My Own Application For Lg02

    -software-before-build-the-image 13.5 Can I make my own firmware for LG02? Where can I find the source code of LG02? Yes, User can make own firmware for LG02 for branding purpose or add customized application. The LG012source code and compile instruction can be found at: https://github.com/dragino/openwrt_lede-18.06...
  • Page 56: How Can I Reset The Device To Factory Default

    User can reset the device to factory default in different ways: Method 1: Reset via Web UI. Click the button in Web UI --> System --> Back up / Flash firmware --> Perform Reset LG02 LoRa Gateway User Manual 56 / 63...
  • Page 57: Can I Control The Leds

    Can I control the LEDs? Except the PWR LED and sensor LED, all other LEDs can be controlled by developer. Control Globe LED: ON: echo 1 > /sys/class/leds/dragino2\:red\:wlan/brightness OFF: echo 0 > /sys/class/leds/dragino2\:red\:wlan/brightness LG02 LoRa Gateway User Manual 57 / 63...
  • Page 58: Trouble Shooting

    * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-dragino2-si3217x: kernel (= 3.10.49-1-4917516478a753314254643facdf360a) * * opkg_install_cmd: Cannot install package kmod-dragino2-si3217x. In this case, user can use the –force-depends option to install such package. opkg install kmod-dragino2-si3217x_3.10.49+0.2-1_ar71xx.ipk --force-depends LG02 LoRa Gateway User Manual 58 / 63...
  • Page 59: How To Recover The Lg02 If Firmware Crash

    In this case, user can recover the whole Linux system by uploading a new firmware via Web Failsafe mode. Procedure is as below: Use a RJ45 cable to connect the PC to LG02’s port directly. Set the PC to ip 192.168.255.x, netmask 255.255.255.0 Pressing the toggle button and power on the device...
  • Page 60: I Configured Lg02 For Wifi Access And Lost Its Ip. What To Do Now

    14.3 I configured LG02 for WiFi access and lost its IP. What to do now? The LG01 has a fall-back ip in its LAN port. This IP is always enabled so user can use fall back ip to access LG01 no matter what the WiFi IP is. The fall back ip is useful for connect and debug the unit.
  • Page 61: Order Info

    16. Packing Info Package Includes:  LG02 or OLG02 LoRa Gateway x 1  Stick Antenna for LoRa RF part. Frequency is one of 433 or 868 or 915Mhz depends the model ordered  Power Adapter: EU/AU/US type power adapter depends on country to be used ...
  • Page 62  Provide as much information as possible regarding your enquiry (product models, accurately describe your problem and steps to replicate it etc) and send a mail to support@dragino.com LG02 LoRa Gateway User Manual 62 / 63...
  • Page 63: Reference

     OpenWrt official Wiki http://www.openwrt.org/  Download of this manual or Update version http://www.dragino.com/downloads/index.php?dir=UserManual/LG02_OLG02/  LMIC library for Arduino LoRaWAN end device use with LG02. https://github.com/dragino/arduino-lmic  Hardware Source LG02 = LoRa G Dual OLG02= PAN v2.0 LoRa G Dual...

This manual is also suitable for:

Olg02

Table of Contents