Lorawan gateway GW-01 getting started.

Lorawan gateway GW-01.
GW-01 is  low cost open source Lorawan gateway.
LoRaWAN gateway

The device consists of two interconnected boards. Top of them implements LoRa PHY using SX1301 which is digital baseband chip for outdoor LoRaWAN macro gateways. Bottom one is well known orange pi zero development board with light modification – 8MB onboard flash IC instead of original 2MB. We replaced it because of OpenWrt distributive needs little bit more space to fit in flash IC. So this is gives as way to run gateway out of box without using microSD cards.

Power Up.

Just plug ethernet cable and power it up using micro USB cable to get working LoRaWAN gateway:
LoRaWAN gateway

SSH access.

Then you need to get access via SSH to configure it. Check IP address taken by gateway using DHCP:

 

Login via ssh as “root”. Password isn’t required:

 

Configure gateway.

Usually LoRaWAN network consist one or more gateways, swarm of end nodes and one server that stores all data from end nodes translated by gateways. So, before getting it working you need to configure gateway to connect with server. There are several options to get you up and running with LoRaWAN:

  • TheThingsNetwork for fast prototyping. Just register on this platform and get access to your account. Look here for details.
  • TheThingsNetwork stack V3 or LoRaServer if you need to deploy your own private gateway. You can deploy second one just in few minutes by typing following command in you Linux driven PC:
    $ docker-compose up

    But current post not about this part of LoRa network.

  • Get access to cloud.m2m-tele.com. Email as to get free account. Later we are going to add out of box applications for set of different end nodes. At this moment it is under development.

So, after choosing of server  you need to configure you gateway to pass data on it by editing global_conf.json file:

# vi /etc/global_conf.json

Find following params:

 “gateway_conf”: {

              “server_address”: “router.eu.thethings.network”,

              “server_port_up”: 1700,

             “server_port_down”: 1700,

}

Use this settings to pair 868MHz lorawan gateway with TTN. In a case of 915MHz gateway set “server_address” to router.us.thethings.network”. For cloud.m2m-tele.com set “server_address” to “m2m-tele.com”. You can find explanation of this settings here.

To exit from Vi without saving the changes type “:q!”. If you want to save changes on exit use “wq” command.

Start gateway.
After that gateway ready to start.
# /etc/init.d/lora_pkt_fwd start
To enable autostart on power up:
# /etc/init.d/lora_pkt_fwd enable
To stop gateway:
# /etc/init.d/lora_pkt_fwd stop
To view logs:
# logread
or:
# logread -f

Because of using SPI flash, RAM based ring buffer implemented instead of stressing SPI flash by writing to log files in file system. As there is restrictions about code size (8Mb spi flash used) any additional programs like “util_tx_continuous” not added to distributive.

 

ARMBIAN.

If you need more space and/or flexibility probably you would try another one distributive supported by GW-01 is Armbian. You need 2Gb or higher volume microSD card to boot Armbian from it. Just download Armbian image for lorawan gateway GW-01.

Write image on microSD. Use Win32 Disk Imager or any another to write image on microSD card:

Here you need to choose device index and image to write. Then press to Write button. Writing process takes few minutes:

After it finishes writing process plug in microSD card to GW-01 and power up the device.

Remote connection.

Similar as in a case of Openwrt but now we are looking for orangepizero device:

Then login via SSH using login/pass al/lorawan1:

After entering to console of GW-01 you are ready to start GW-01 to receive incoming LoRa packets.

Running the gateway.
cd ~
$ sudo ./iC880-SPI_reset.sh
$ sudo chmod 777 /dev/spidev1.1
$ cd packet_forwarder/lora_pkt_fwd
$ ./lora_pkt_fwd

You should see something similar to:

….
INFO: global_conf.json does contain a JSON object named gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to AA555A0000000005
INFO: server hostname or IP address is configured to “router.eu.thethings.network”
INFO: upstream port is configured to “1700”
INFO: downstream port is configured to “1700”
….
INFO: found local configuration file local_conf.json, parsing it
INFO: redefined parameters will overwrite global parameters
INFO: local_conf.json does not contain a JSON object named SX1301_conf
INFO: local_conf.json does contain a JSON object named gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to AA555A0000000005
INFO: packets received with a valid CRC will be forwarded
INFO: packets received with a CRC error will NOT be forwarded
INFO: packets received with no CRC will NOT be forwarded
lgw_connect:532: INFO: no FPGA detected or version not supported (v0)
Note: success connecting the concentrator

INFO: [down] PULL_ACK received in 61 ms
INFO: [down] PULL_ACK received in 60 ms
INFO: [down] PULL_ACK received in 60 ms
Some useful links to work with GW-01: