Page 1
LG01N/OLG01N LoRa Gateway User Manual Document Version: 1.3.0 Firmware Version: LG02_LG08--build-v5.3.1581838658-20200216-1539 Version Description Date Release 2018-Dec-28 Add Customized Script Feature 2019-Jan-19 (firmware ver >LG02_LG08--build-v5.1.1547896817-20190119-1921) --Add Downlink support and example. 2019-Jan-30 (firmware ver >LG02_LG08--build-v5.1.1548820215-20190130-1151) --Correct typo for the UNO code of example for lg02_single_rx_tx 1.2.1...
Introduction ..........................5 What is LG01N & OLG01N ......................5 Specifications ..........................6 Features ............................8 System Structure ........................8 Applications ..........................9 Hardware Variants ........................10 Interfaces ..........................10 Install SIM card in 4G module ....................11 Firmware Change log ....................... 12 Access LG01N ..........................
Page 3
Can I develop my own LoRa protocol and other software for LG01N? ........ 54 13.5 Can I make my own firmware for LG01N? Where can I find the source code of LG01N? ..54 13.6 On OTAA mode, if I use the other frequency, how should I modify in the library?....54 13.7...
Page 4
I get kernel error when install new package, how to fix? ............ 57 14.2 How to recover the LG01N if firmware crash............... 58 14.3 I configured LG01N for WiFi access and lost its IP. What to do now? ........59 Order Info ..........................60 Packing Info ..........................60 Support ........................... 60 Reference ..........................
LG01N & OLG01N provide a low cost for your IoT network connection. Compare to the cost with normal SX1301 LoRaWAN solution. LG01N & OLG01N is only of its 1/4 or less cost. This makes the LG01N very suitable to set up small scale LoRa network or use it to extend the coverage of current LoRaWAN network.
1.2 Specifications Hardware System: Linux Part: 400Mhz ar9331 processor 64MB RAM 16MB Flash Interface: 10M/100M RJ45 Ports x 2 WiFi : 802.11 b/g/n LoRa Wireless Power Input: 12V DC USB 2.0 host connector x 1 ...
Page 7
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.
1.3 Features Open Source OpenWrt LEDE system Low power consumption Firmware upgrade via Web Software upgradable via network Flexible protocol to connect to IoT servers Auto-Provisioning Built-in web server Managed by Web GUI, SSH via LAN or WiFi ...
1.6 Hardware Variants The LG01N and OLG01N use the same firmware and have the same feature in the software side. In this document, we will use LG01N as the model number to explain the feature. Model Photo Description LG01N...
1.8 Install SIM card in 4G module LG01N & OLG01N has optional built-in 4G module version. For the 4G version, devices will be shipped with screws un assembly, please open the box and use below direction to install the SIM...
2. Access LG01N Access and configure LG01 The LG01N is configured as a WiFi AP by factory default. User can access and configure the LG01N after connect to its WiFi network. At the first boot of LG01N, it will auto generate an unsecure WiFi network call dragino-xxxxxx User can use the laptop to connect to this WiFi network.
Page 13
Notice: In case the WiFi network is disabled, user can connect the PC to LG01N’s LAN port, the PC will get DHCP from LG01N, and be able to access it. LG01-N/OLG01-N Gateway User Manual 13 / 61...
3.2 Use WAN port to access Internet By default, the LG01N set to use WAN port as network connection. When connect LG01N’s WAN port to router, LG01N will get IP from router and have internet access. The network status is as below:...
3.3 Access Internet as a WiFi Client. In the WiFi Client Mode, Dragino acts as a WiFi client and gets IP from uplink router via WiFi. The step to set is as below: Step1: In network -> Wireless, select Radio0 interface and scan.
Page 16
(Note:make sure click the Save & Apply after configure) After successful associate, the WiFi network interface can be seen in the same page: LG01-N/OLG01-N Gateway User Manual 16 / 61...
3.4 Use built-in 4G modem for internet access For the LG01N with built-in 4G version, user can configure the modem for internet access. Step 1: Add New Interface LG01-N/OLG01-N Gateway User Manual 17 / 61...
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: LG01-N/OLG01-N Gateway User Manual 18 / 61...
3.5 Check Internet connection User can use the diagnostics page to check and analyze Internet connection. LG01-N/OLG01-N Gateway User Manual 19 / 61...
LoRaWAN Server is similar. 4.1 Create a gateway in TTN Server Step 1: Get a Unique gateway ID. Every LG01N has a unique gateway id. The id can be found at LoRaWAN page: The gateway id is: a840411b6fc44150...
Page 21
Step 2: Sign up an user account in TTN server Step 3: Create a Gateway in TTN A8 40 41 1b 6f c4 41 50 LG01-N/OLG01-N Gateway User Manual 21 / 61...
4.2 Configure LG01N Gateway 4.2.1 Configure to connect to LoRaWAN server We should configure the LG01N now to let it connect to TTN network. Make sure your LG01N has Internet Connection first. Step1: Configure LG01N to act as raw forwarder mode Step2: Input server info and gateway id Choose the correct the server address and gateway ID.
Check Result After above settings, the LG01N should be able to connect to TTN, below is the result seen from TTN: 4.2.2 Configure LG01’s Radio frequency Now we should configure LG01N‘s radio parameter to receive the LoRaWAN packets. we configure is to use 868.1Mhz (868100000 Hz) as below.
LG01N supports LoRaWAN End Node, in LoRaWAN protocol, it requires LoRaWAN node to send data in a hopping frequency. Since LG01N only support one single frequency, it will only be able to receive the packet which is of the same radio parameters in LG01N.
4.3.2 Preparation LoRaWAN End device Hardware: Software Library for LoRaWAN End device: 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.
4.3.3 Test with OTAA LoRa end node (LoRa Shield + UNO) Step 1: Create an OTAA device in TTN server -- > Application page. LG01-N/OLG01-N Gateway User Manual 26 / 61...
Page 27
Step 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 LG01-N/OLG01-N Gateway User Manual 27 / 61...
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 LG01-N/OLG01-N Gateway User Manual 28 / 61...
Page 29
Downlink message Send out from TTN after the next uplink message arrive. In TTN --> Gateway --> Traffic Downlink message arrives gateway In LG01N --> Service --> Logread Downlink message arrives LoRa Shield In Arduino IDE --> Serial Monitor LG01-N/OLG01-N Gateway User Manual...
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. LG01-N/OLG01-N Gateway User Manual 30 / 61...
Page 31
Step 2: Input keys into Arduino Sketch. The sketch for the LoRa Shield is in Arduino –IDE --> Examples -->LMIC_Arduino ttn-abp TTN LoRaWAN End Device page Make sure the Network Session Key and App Session Key are in MSB order...
Page 32
Step 3: Check Result for Uplink Packet Sent From LoRa Shield. 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...
Page 33
Downlink message Send out from TTN after the next uplink message arrive. In TTN --> Gateway --> Traffic Downlink message arrives gateway In LG01N --> Service --> Logread Downlink message arrives LoRa Shield In Arduino IDE --> Serial Monitor LG01-N/OLG01-N Gateway User Manual...
5. Example 2: Manually send / receive LoRa packets There are two ways to use the LoRa Radio of Gateway: a) Through pkt_fwd process , b) Use the Radio separately. 5.1 User LoRa Radio via pkt_fwd 5.1.1 Use pkt_fwd to receive When user chooses the MQTT/TCP-IP/Customized mode, the lg01_pkt_fwd will auto start.
Page 35
| number | FSK datarate (unsigned, in bits per second) codr | string | LoRa ECC coding rate identifier fdev | number | FSK frequency deviation (unsigned integer, in Hz) ipol | bool | Lora modulation polarization inversion...
5.2 Use LoRa radio device directly The LoRa Radio of LG01N is a SPI device, 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...
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: LG01-N/OLG01-N Gateway User Manual...
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” Set up radio 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.
6. Example 3: MQTT Transfer Mode MQTT is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport. It is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium.
7. Example 4: TCP IP Client Mode In the TCP IP Client mode, LG01N 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
Step3: Configure TCP Server Info Note: Gateway may receive many LoRa packets, it will only transfer the packet with the same ID as specify in the channel. Step4: About uplink data format The LoRa end node should upload the data with below format: Uplink Format: <Channel_ID>data...
8. Example 5: Write a customized script LG01N 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 LG01N is as below: Example: Store Data in a file.
Page 43
Step 3: Choose the customized script The directory to store customized script is in /etc/lora/customized_scripts/. User can write a new script and put it under this directory for their application. The web will auto detect it. Step 4: Configure the LoRa End Device to send sensor data.
9. Example 6: Communicate to a HTTP server Here shows an example for how to communicate to ThingSpeak server via HTTP protocol. 9.1 Test uplink and downlink via Linux command We can see the API requests method in ThingSpeak API keys tab.
Page 45
And we will be able to see the update in the feed: ThingSpeak has a talkback API which can dispatch command, it is under Apps Talkback We can use curl command to get command_string, as below: LG01-N/OLG01-N Gateway User Manual...
Step1: Run below commands to download the customized script for ThingSpeak: root@dragino-1893c4:~# wget http://www.dragino.com/downloads/downloads/LoRa_Gateway/LG02-OLG02/Firmware/customized_script/uplin k_downlink_ThingSpeak.sh root@dragino-1893c4:~# chmod +x uplink_downlink_ThingSpeak.sh root@dragino-1893c4:~# mv uplink_downlink_ThingSpeak.sh /etc/lora/customized_scripts/ Step2: Modify the script for your channels: There are three place need to modify: 1. Replace the channel with the corresponding channel ID and API KEY if [ "$channel"...
10.2 More instructions http://wiki.dragino.com/index.php?title=Main_Page#LoRa.2FLoRaWAN_Gateway_Instruction 11. Linux System The LG01N 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
LG01-N/OLG01-N Gateway User Manual 48 / 61...
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 LG01N or Edit the files directly in the windows. Screenshot is as below: 11.3 File System The LG01N has a 16MB flash and a 64MB RAM.
Page 50
"rootfs_data" //inside rootfs, all data store here. "config" // a separate partition doesn't include file system "art" // radio data and board ID. Use df command to see available flash & RAM: tmpfs 30096 30000 0% /tmp...
For example, if user wants to add iperf tool, they can install the related packages and configure LG01N to use iperf Below is some examples opkgs command, more please refer...
12. Upgrade Linux Firmware We keep improving the LG01N Linux side firmware for new features, bug fixes. The latest firmware can be found on LG01N 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...
8 channels. The LG01N only support two channels and can only support limited LoRaWAN protocol. Because of this limitation, if user wants to use a standard LoRaWAN device with LG01N, user has to modify this LoRaWAN node to run in single frequency to work with LG01N.
-software-before-build-the-image 13.5 Can I make my own firmware for LG01N? Where can I find the source code of LG01N? Yes, User can make own firmware for LG01N for branding purpose or add customized application. The LG01N source code and compile instruction can be found at: https://github.com/dragino/openwrt_lede-18.06...
Reset via Web UI. Click the button in Web UI --> System --> Back up / Flash firmware --> Perform Reset Method 2: Reset in Linux console, command is below: root@dragino-1b8288:~# firstboot This will erase all settings and remove any installed packages. Are you sure? [N/y] /dev/mtdblock4 is mounted as /overlay, only erasing files...
13.8 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 13.9 Can I upgrade the LG01-P / LG01-S to LG01-N? If user has LG01-P / LG01-S, they can upgrade their model to LG01-N by: 1) Change the Inside LoRa module to the module used in LG01-N.
14.1 I get kernel error when install new package, how to fix? In some case, when install package, it will generate kernel error such as below: root@dragino-16c538:~# opkg install kmod-dragino2-si3217x_3.10.49+0.2-1_ar71xx.ipk Installing kmod-dragino2-si3217x (3.10.49+0.2-1) to root... Collected errors: * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-dragino2-si3217x: kernel (= 3.10.49-1-4917516478a753314254643facdf360a) *...
14.2 How to recover the LG01N if firmware crash LG01N provides user a full control on its Linux system, it is possible that the device will brick and can’t boot after improper modification in some booting files. In this case, user can recover the whole Linux system by uploading a new firmware via Web Failsafe mode.
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 LG01N no matter what the WiFi IP is. The fall back ip is useful for connect and debug the unit.
16. Packing Info Package Includes: LG01N or OLG01N 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 ...
Source code for LG01N LoRa Gateway https://github.com/dragino/openwrt_lede-18.06 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 LG01N. https://github.com/dragino/arduino-lmic LG01-N/OLG01-N Gateway User Manual 61 / 61...
Need help?
Do you have a question about the LG01N and is the answer not in the manual?
Questions and answers