You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 32 Next »

Every RouterBOARD with a miniPCI-e slot which supports LTE modems can also be used as a LoRaWAN gateway by installing R11e-LoRa8 or R11e-LoRa9 card. In order to work with Lora, IoT package should be installed. You can find the package for your device architecture in extra packages archive on the download page.

Starting with v7.11 (stable), LoRa functionality is moved into the IoT package that is available on the download page under extra packages. A separate Lora package is still available for download.

When using IoT package, LoRa functionality will move to a /iot lora sub-menu. When using LoRa package, LoRa functionality will be possible via /lora sub-menu.

LoRa package is not obligatory anymore and is left only for compatibility reasons.


noteRouterOS does not support 3rd party LoRaWAN gateway cards.

Properties

Sub-menu: /iot lora

PropertyDescription
antenna-gain (integer [-128..127]; Default: 0)Antenna gain in dBi.
channel-plan (as-923 | au-915 | custom | eu-868 | in-865 | kr-920 | ru-864 | ru-864-mid | us-915-1 | us-915-2; Default: eu-868)Frequency plans for various regions.
disabled (yes | no; Default: yes)Whether LoRaWAN gateway is disabled.
forward (crc-disabled | crc-error | crc-valid; Default: crc-valid,crc-error)Defines what kind of packets should be forwarded to Network server:
  • crc-disabled - forward packets which CRC code isn`t checked
  • crc-error - forward packets with incorrect CRC code
  • crc-valid - forward valid packets with correct CRC.
gateway-id (string)Gateway ID or Gateway EUI, is used when registering the gateway with the server.
lbt-enabled (yes | no; Default: no)Whether gateway should use LBT (Listen Before Talk) protocol.
listen-time (integer [0us..4294967295us]; Default: 5000us)Time in microseconds to track RSSI before TX (used when lbt-enabled=yes).
name (string; Default: )Name of LoRaWAN gateway.
network (private | public; Default: public)Whether sync word should (network=private) or should not (network=public) be used.
rssi-threshold (integer [-32,768 .. 32,767]; Default: -65dB)RSSI value to determine whether forwarder may use specific channel to talk. If RSSI value is below rssi-threshold, channel could be used (used when lbt-enabled=yes).
servers (list of string; Default: )Name or names of servers from /lora servers.
src-address (IP; Default: )Specifies uplink packet source address if necessary (address should match an address configured on the RB).
spoof-gps (string; Default: )

Set custom GPS location:

  • Latitude [-90..90]
  • Longitude [-180..180]
  • Altitude(m) [-2147483648..2147483647]

Sometimes it can happen, that when trying to register the LoRaWAN gateway on the LoRaWAN server, the server can display an error indicating that the gateway ID/EUI is already taken by someone else. It just means that the other user luckily guessed/took your gateway ID and assigned it to their device before you.

If that happens, you can change it manually:

/iot lora set 0 gateway-id=503139xxxxxxxxxx

and then try re-registering this newly changed ID again.

Channels

Sub-menu: /iot lora channels

PropertyDescription
bandwidth (7.8_kHz | 15.6_kHz | 31.2_kHz | 62.5_kHz | 125_kHz | 250_kHz | 500_kHz; Default: 125_kHz)Bandwidth of specific channel, predefined when any of channel-plan preset is used, but could be manually changed when channel-plan is set to custom.
disabled (yes | no; Default: no)Whether specific channel is disabled.
freq-off (integer [-400000..400000]; Default:  )Channel frequency offset against radio central frequency, it makes possible to adjust channel frequencies so that channels does not overlap.
radio (radio0 | radio1; Default: )Defines which radio uses selected channel.
spread-factor (SF7 | SF8 | SF9 | SF10 | SF11 | SF12; Default: )Defines the Spread Factor for a channel with type=LoRa. Lower Spread Factor means higher data rate.

Join EUI

The gateway will forward to the server every single LoRaWAN payload it receives. That includes neighboring LoRaWAN node's payloads as well. It might not be ideal to forward everything, as, for example, it can increase the data amount used (and directly impact ISP plan cost).

The Join EUI menu allows you to specify a range of Join EUI's that the gateway will forward. After adding the range, make sure to apply it to the server settings.

If the Join EUI of the packet does not match the configuration, the packet is not forwarded to the server.


You can find the Join EUI used by your node with the help of RouterOS GUI. Go to the "LoRa" section and to the "Traffic" sub-menu (which is only available using the graphical interface). After you power your LoRaWAN node, the node should send a "Join-request" packet. Double-click on it to inspect it:

Sub-menu: /iot lora joineui

PropertyDescription
joineui (string; Default: )

Define a range of Join EUI's.

name (string; Default: )Define the name for the range.

An example of Join EUI would look like this E0 E1 E2 01 02 03 04 05. It consists of 8 octets in HEX format.

To add a range that allows every possible Join EUI, add a filter like this:

/iot lora joineui add name=ALL joineuis=0000000000000000-ffffffffffffffff

To add a range that allows "nothing" (basically "restrict" all Join EUI's), add a filter like this:

/iot lora joineui add name=NONE joineuis=0000000000000000-0000000000000000

For a specific single Join EUI, add a filter like this:

/iot lora joineui add name=SINGLE joineuis=E0E1E20102030405-E0E1E20102030405

Network ID

The gateway will forward to the server every single LoRaWAN payload it receives. That includes neighboring LoRaWAN node's payloads as well. It might not be ideal to forward everything, as, for example, it can increase the data amount used (and directly impact ISP plan cost).

The NetID menu allows you to specify a list of NetIDs that the gateway will forward. After adding the list, make sure to apply it to the server settings.

If the NetID (DevAddr range) of the packet does not match the configuration, the packet is not forwarded to the server.


NetIDs define the ranges of Device Addresses (DevAddr) that were assigned to different operators/servers by the LoRaWAN Alliance. A list with most ranges can be found in the TTN guide.

DevAddr is assigned to the LoRaWAN node by the LoRaWAN server after the communication with the server takes place. For example, TTN will assign your node an address from within the range 26000000 - 27FFFFFF. You can find it under the LoRaWAN server dashboard or using RouterOS GUI, under the "Traffic" sub-menu (after "join-request" and "join-accept" communication takes place) in the Dev Addr column/field.

Let's say TTN assigned 26 1B D8 D1 Dev Addr to your node. Based on the TTN guide, it falls under the 26000000 - 27FFFFFF DevAddr range and it belongs to the 000013 NetID.

Sub-menu: /iot lora netid

PropertyDescription
netids (string; Default: )

Define the NetIDs

name (string; Default: )Define the name for the ID.

To add a filter for a specific NetId, use the command (you can add more using a "comma" separator):

/iot lora netids add name=TTN netids=000013

Servers

Sub-menu: /iot lora servers

There are a few predefined servers that can be used (it requires to make an The Things Network account to use them):

[admin@MikroTik] /iot/lora/servers> print
Columns: NAME, UP-PORT, DOWN-PORT, ADDRESS
#  NAME              UP-PORT  DOWN-PORT  ADDRESS                                
0  TTN-EU               1700       1700  eu.mikrotik.thethings.industries       
1  TTN-US               1700       1700  us.mikrotik.thethings.industries       
2  TTS Cloud (eu1)      1700       1700  eu1.cloud.thethings.industries         
3  TTS Cloud (nam1)     1700       1700  nam1.cloud.thethings.industries        
4  TTS Cloud (au1)      1700       1700  au1.cloud.thethings.industries         
5  TTN V3 (eu1)         1700       1700  eu1.cloud.thethings.network            
6  TTN V3 (nam1)        1700       1700  nam1.cloud.thethings.network           
7  TTN V3 (au1)         1700       1700  au1.cloud.thethings.network          

Custom servers can be added as well. Data forwarding to multiple servers can work simultaneously if the first server does not change "DevAdress" part of the packet and under the condition that all servers are able to decode the packet.

PropertyDescription
address (domain name or IP address; Default: )Defines LoRaWAN Network server address.
down-port (integer [0..65535]; Default: )Defines port for down-link communication (from server to node) with LoRaWAN Network server. Most of known open source servers uses port 1700 as default, but it can change if multiple servers are configured on the same machine.
name (string; Default: )Defines server name.
up-port (integer [0..65535]; Default: )Defines port for up-link communication (from node to server) with LoRaWAN Network server. Most of known open source servers uses port 1700 as default, but it can change if multiple servers are configured on the same machine.
netid (list of string; Default: )Applies a filter to only send LoRaWAN payloads that match the Network ID (Net ID) filter configured.
joineui (list of string; Default: )
Applies a filter to only send LoRaWAN payloads that match the Join EUI filter configured.
  • No labels