Setting up Multitech Conduit Gateway for TTN

Here we go:

{
	"SX1301_conf" : 
	{
		"chan_FSK" : 
		{
			"bandwidth" : 250000,
			"datarate" : 100000,
			"enable" : false,
			"if" : 100000,
			"radio" : 0
		},
		"chan_Lora_std" : 
		{
			"bandwidth" : 500000,
			"enable" : true,
			"if" : 400000,
			"radio" : 0,
			"spread_factor" : 8
		},
		"chan_multiSF_0" : 
		{
			"enable" : true,
			"if" : -300000,
			"radio" : 0
		},
		"chan_multiSF_1" : 
		{
			"enable" : true,
			"if" : -100000,
			"radio" : 0
		},
		"chan_multiSF_2" : 
		{
			"enable" : true,
			"if" : 100000,
			"radio" : 0
		},
		"chan_multiSF_3" : 
		{
			"enable" : true,
			"if" : 300000,
			"radio" : 0
		},
		"chan_multiSF_4" : 
		{
			"enable" : true,
			"if" : -300000,
			"radio" : 1
		},
		"chan_multiSF_5" : 
		{
			"enable" : true,
			"if" : -100000,
			"radio" : 1
		},
		"chan_multiSF_6" : 
		{
			"enable" : true,
			"if" : 100000,
			"radio" : 1
		},
		"chan_multiSF_7" : 
		{
			"enable" : true,
			"if" : 300000,
			"radio" : 1
		},
		"radio_0" : 
		{
			"enable" : true,
			"freq" : 912200000
		},
		"radio_1" : 
		{
			"enable" : true,
			"freq" : 913000000
		}
	},
	"gateway_conf" : 
	{
            "forward_crc_disabled" : true,
            "forward_crc_error" : false,
            "forward_crc_valid" : true,  
            "gateway_ID" : "my_ID",
            "keepalive_interval" : 12,
            "push_timeout_ms" : 120,
            "serv_port_down" : 1700,
            "serv_port_up" : 1700,
            "server_address" : "54.229.214.112",
            "stat_interval" : 20,
            "synch_word" : 52
	}
}

@Lieutier
Please download a new sample configuration for US 915Mhz frequencies from GitHub. Do not forget to set the correct gateway_id , position information (red_latitude etc) and contact information before use.

@robbo Thank you very much.

@Robbo thanks for sharing your results. My config is the same as yours , my results are the same as yours only that PUSH_DATA acknowledged is always 0.00%.

@Kersing - Used your poly_forward binary and got the seam results, packets forwarded but ACK = 0%

Not sure why on the downstream i got 50% ack.

Thanks again for your support!

@johan

YEs I am using croft.thethings.girovito.nl, tried with ip address as well.
Log files is the same as the ones I’ve seen around:

“gateway_conf” :
{
“forward_crc_disabled” : true,
“forward_crc_error” : false,
“forward_crc_valid” : true,
“gateway_ID” : “my_EUI”,
“keepalive_interval” : 12,
“push_timeout_ms” : 120,
“serv_port_down” : 1700,
“serv_port_up” : 1700,
“server_address” : “croft.thethings.girovito.nl”,
“stat_interval” : 20,
“synch_word” : 52
}

1 Like

Thought my personal step by step directions to get this set up might be useful to others.

MultiConnect Conduit mLinux setup with Ethernet connectivity for The Things Network

These instructions are designed to enable a non-expert to set up the MultiTech MultiConnect Conduit mLinux LoRaWAN gateway and Multitech Mdot LoRaWAN node to forward packets to The Things Network (TTN).
The instructions are a collation of the MultiTech documentation as well as information from TTN forum and Wiki.

Step 1

Setting up the MultiConnect conduit mLinux requires a little understanding of Linux, basic networking, and using Terminal tools to access the Conduit. I downloaded and installed TeraTerm to SSH into the Conduit and WinSCP to copy over firmware updates. WinSCP is also useful to use as a general File Explorer for those of us who do not love the command line.

The first step is to install and connect the Lora radio hardware as described here. My Conduit model is a MTCDT-210L-US-EU-GB and does not include cellular connectivity.

As I was setting this up on a company network I needed to work with IT to get the Connect on the network with Ports 1700 opened for UDP traffic. For security reasons IT was not comfortable with putting me on the main network or even in the DMZ. Fortunately a separate network with a DSL modem was available on 192.168.1.xx for me to use.

Out-of-the box the Conduit comes configured to work on a 192.168.2.1 network with no DHCP so I followed the instructions in the MultiTech documentation to change the IP address to a fixed IP (In my case 192.168.1.49) with the gateway at 192.168.1.1 .

Note that the time zone in the documentation is for Chicago so you need to use your own time zone. In my case I ran:

ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime

Step 2

The next step is to check the currently installed versions of the LoRa Server and Packet Forwarder following the MuliTech instructions here. In my case I had old versions and needed to upgrade.

I downloaded the new packages from the downloads page to my PC used WinSCP to connect to the Conduit. Use the Conduit’s IP address as the Host Name (i.e. 192.168.1.49 in my case).

I copied the new packages to /var/packages (this was simply my choice and there may be a convention that I am not aware of.)

I then installed them by going to the /var/packages directory using TeraTerm and running them using:

$ opkg install lora-packet-forwarder_1.4.1-r8.16_arm926ejste.ipk
$ opkg install lora-network-server_0.0.8-r0.0_arm926ejste.ipk

As described in the Multitech documentation.

Step 3

Convert mLinux to a basic packet forwarder to The Things Network using the instructions on the MultiTech site and on The Things Network forum.

Note that the gateway configuration for TTN is as follows:

"gateway_conf" :
{
        "forward_crc_disabled" : true,
        "forward_crc_error" : false,
        "forward_crc_valid" : true,  
        "gateway_ID" : "<GATEWAY_EUI>",
        "keepalive_interval" : 12,
        "push_timeout_ms" : 120,
        "serv_port_down" : 1700,
        "serv_port_up" : 1700,
        "server_address" : "54.229.214.112",
        "stat_interval" : 20,
        "synch_word" : 52            
}

Don’t forget to add your EUI from the MTAC-LORA accessory card. Note that I used a fixed IP rather than croft.thethings.girovito.nl since I did not set up the Conduit for DNS.

Step 4

Set up your mDot using manual join as described on the MultiTech site using the settings from TTN wiki.
Setting Up the mDot Using Manual Join

  1. Establish a serial connection to the mDot
  2. Connect your PC to the DB9 serial connector on the UDK – (I had to buy a USB to serial adapter from Amazon to do this. Odd that Multilink did not use on-board USB to serial to do this.)
  3. Open a terminal session using an application such as TeraTerm with baud rate 115,200
  4. Issue these commands:
    AT+NJM=0 (manual join mode)
    AT+PN=1 (public network mode)
    AT&W=7 (915 NA only | value = frequencySubBand from your Conduit)
    AT+NSK=2B7E151628AED2A6ABF7158809CF4F3C (TTN network session key)
    AT+DSK=2B7E151628AED2A6ABF7158809CF4F3C (value = Data (application) session key for your application)
    AT+NA=02013E00 (value = 4-byte device address – Boston currently has a 256 block at 02:01:3E:xx see http://thethingsnetwork.org/wiki/AddressSpace. You may need to add your own block if your group does not have one already.)
    AT&W (save settings)
    ATZ (restart)
  5. Send data without requesting an ACK:
    o AT+ACK=0
    o AT+SEND=Hello from Boston

Step 5

Check TTN rest API using your browser to see if your message came through by going to:
http://thethingsnetwork.org/api/v0/nodes/your_device_address/ and replace your_device_address with your own device address. If successful you should see data like this returned:

{
    "node_eui": "02013E00",
    "gateway_eui": "00000008004A02BD",
    "data_plain": "Hello from Boston",
    "_id": "564cd7127585d2ea79ada581",
    "time": "2015-11-18T19:52:50.281Z",
    "data_raw": "QAA+AQIABwABIpIHLG7lKVjXia0lOpRtIScfJXlQ",
    "data": "SGVsbG8gZnJvbSBCb3N0b24="
},

You can also run tail -f /var/log/lora-pkt-fwd.log as described in the documentation and view the log using the Conduit terminal session.
A successful result should look something like this:

##### 2015-11-18 20:15:22 GMT #####
### [UPSTREAM] ###
# RF packets received by concentrator: 2
# CRC_OK: 100.00%, CRC_FAIL: 0.00%, NO_CRC: 0.00%
# RF packets forwarded: 2 (72 bytes)
# PUSH_DATA datagrams sent: 1 (498 bytes)
# PUSH_DATA acknowledged: 100.00%
### [DOWNSTREAM] ###
# PULL_DATA sent: 2 (0.00% acknowledged)
# PULL_RESP(onse) datagrams received: 0 (0 bytes)
# RF packets sent to concentrator: 0 (0 bytes)
# TX errors: 0
##### END #####

If you have trouble you can post questions on TTN forum here.

6 Likes

might be worth adding this as a wiki entry

Andrew

1 Like

Here a mBed code to send a hello world to TTN.

https://developer.mbed.org/users/ropu/code/mDot_LoRa_example_TTN_connect/

this should replace the terminal commands.

Just got my Buenos Aires TTN Multitech gateway working!

http://thethingsnetwork.org/api/v0/nodes/0201BA01/

thanks for all the help

1 Like

Good walk through @robbo. Just one clarification. The EUI in the gateway config should be the EUI of the MTAC-LORA accessory card instead of the Conduit.

-Brandon

@brandon-multitech Thanks for the correction. I made the update. Is there a way to query the EUI from the command line? I must have used the wrong EUI but it still worked?

Just corrected my EUI to the mTAC

but having an issue with the packages.

when i move the mDot, lets say 10mts, i start loosing packeges and getting this log

##### 2015-11-19 22:33:34 GMT #####
### [UPSTREAM] ###

# RF packets received by concentrator: 0
# CRC_OK: 0.00%, CRC_FAIL: 0.00%, NO_CRC: 0.00%
# RF packets forwarded: 0 (0 bytes)
# PUSH_DATA datagrams sent: 0 (0 bytes)
# PUSH_DATA acknowledged: 0.00%
### [DOWNSTREAM] ###
# PULL_DATA sent: 1 (0.00% acknowledged)
# PULL_RESP(onse) datagrams received: 0 (0 bytes)
# RF packets sent to concentrator: 0 (0 bytes)
# TX errors: 0
##### END #####
WARNING: [down] ignoring invalid packet

when i get back closer, i start getting this, and msg are bvack in the TTN API

lgw_receive:1428: FIFO content: Pkts: 1 7 1 Stat: 7 Size: 85
lgw_receive:1443: [2 17]
Note: LoRa packet

The lora-network-server script uses

mts-io-sysfs show lora/eui 2> /dev/null

to get the EUI.

1 Like

Hi all!

You guys helped out a ton, especially the post from robbo was very valuable. Unfortunately, it’s not working yet.

I don’t have an mDot yet, only the gateway. I’m simulating messages with mosquitto_pub, and it seems like they’re being received (I see “Note: LoRa packet” in the packet forwarder log). However, nothing is forwarded to TTN, I get 0% ACK and (after sending some messages) a CRC_FAIL of 100%.

I used tcpdump to see that there is some UDP traffic going to TTN, once every 12 seconds or so, and a package coming back as well. So that’s good I suppose!

A typical log entry:

##### 2015-11-20 19:49:24 GMT #####
### [UPSTREAM] ###
# RF packets received by concentrator: 0
# CRC_OK: 0.00%, CRC_FAIL: 0.00%, NO_CRC: 0.00%
# RF packets forwarded: 0 (0 bytes)
# PUSH_DATA datagrams sent: 0 (0 bytes)
# PUSH_DATA acknowledged: 0.00%
### [DOWNSTREAM] ###
# PULL_DATA sent: 2 (0.00% acknowledged)
# PULL_RESP(onse) datagrams received: 0 (0 bytes)
# RF packets sent to concentrator: 0 (0 bytes)
# TX errors: 0
##### END #####
WAlgw_receive:1428: FIFO content: Pkts: 1 fe 2 Stat: 7 Size: 6d
lgw_receive:1443: [5 17]
Note: LoRa packet
RNING: [down] ignoring invalid packet

##### 2015-11-20 19:49:44 GMT #####
### [UPSTREAM] ###
# RF packets received by concentrator: 1
# CRC_OK: 0.00%, CRC_FAIL: 100.00%, NO_CRC: 0.00%
# RF packets forwarded: 0 (0 bytes)
# PUSH_DATA datagrams sent: 0 (0 bytes)
# PUSH_DATA acknowledged: 0.00%
### [DOWNSTREAM] ###
# PULL_DATA sent: 1 (0.00% acknowledged)
# PULL_RESP(onse) datagrams received: 0 (0 bytes)
# RF packets sent to concentrator: 0 (0 bytes)
# TX errors: 0
##### END #####
WARNING: [down] ignoring invalid packet
WARNING: [down] ignoring invalid packet

Anyone have any idea what it could be? I am not sure what to set for network and passphrase in lora-network-server.conf for example, does it matter? Or is it simply not possible to send and receive with a gateway, and should I wait for my mDot?

Does someone perhaps have an example global_conf.json for EU?

That’s just data being received that might or might not be a valid packet. Stat: 7 actually is a CRC error (valid packets have stat 5) so no valid data has been received.

Packets with CRC errors are (rightly) not forwarded.

For TTN you need to use the instructions to make it a forwarder (step 3 in robbos message). The MultiTech software does not allow multiple servers so you will not be able to use the network server on the device. (If you want send to multiple servers, check my message [70] to get the poly_packet_forwarder, the package contains a valid example config for use in the EU)

You got it, the gateway will not receive packets it is sending so you need a node to receive data.

A sample EU config for the MultiTech software:

{
"SX1301_conf" : 
{
	"chan_FSK" : 
	{
		"bandwidth" : 250000,
		"datarate" : 50000,
		"enable" : true,
		"freq_deviation" : 25000,
		"if" : 100000,
		"radio" : 0
	},
	"chan_Lora_std" : 
	{
		"bandwidth" : 250000,
		"enable" : true,
		"if" : -200000,
		"radio" : 0,
		"spread_factor" : 7
	},
	"chan_multiSF_0" : 
	{
		"enable" : true,
		"if" : -400000,
		"radio" : 0
	},
	"chan_multiSF_1" : 
	{
		"enable" : true,
		"if" : -200000,
		"radio" : 0
	},
	"chan_multiSF_2" : 
	{
		"enable" : true,
		"if" : 0,
		"radio" : 0
	},
	"chan_multiSF_3" : 
	{
		"enable" : true,
		"if" : -400000,
		"radio" : 1
	},
	"chan_multiSF_4" : 
	{
		"enable" : true,
		"if" : -200000,
		"radio" : 1
	},
	"chan_multiSF_5" : 
	{
		"enable" : true,
		"if" : 0,
		"radio" : 1
	},
	"chan_multiSF_6" : 
	{
		"enable" : true,
		"if" : 200000,
		"radio" : 1
	},
	"chan_multiSF_7" : 
	{
		"enable" : true,
		"if" : 400000,
		"radio" : 1
	},
	"radio_0" : 
	{
		"enable" : true,
		"freq" : 868500000
	},
	"radio_1" : 
	{
		"enable" : true,
		"freq" : 869500000
	}
},
"gateway_conf" : 
{
	"forward_crc_disabled" : true,
	"forward_crc_error" : false,
	"forward_crc_valid" : true,
	"gateway_ID" : "<YOUR ID HERE>",
	"keepalive_interval" : 12,
	"push_timeout_ms" : 120,
	"serv_port_down" : 1700,
	"serv_port_up" : 1700,
	"server_address" : "54.229.214.112",
	"stat_interval" : 20,
	"synch_word" : 52
}
}

A valid config is actually generated by lora-network-server in /var/run/lora (apart from the server address and ports) if you start it with the configuration for EU as described on the MultiTech Website (steps 4-7)

Appreciate the help. I suppose I need to wait for my node to arrive then. Everything else looks good, so looking forward to it!

Hi there, I’m getting results appear in the Node bit of the API - http://thethingsnetwork.org/api/v0/nodes/02011E01/ but there is no entry for my gateway (008000000000A052) in the Gateway bit of the API.

Any idea what I am missing?

I have an mlinux Conduit with an MTAC-LORA-868 card.

Thanks, Mark

@mark: this sounds like the same problem I had with my DIY gateway: Setting up your first gateway

My gateway wasn’t sending geo-info, and because of that, it didn’t show up in the list.

Ah, yes using gps_pkt_fwd makes it appear in the Gateways , thanks :slight_smile:

For info gps_pkt_fwd has different params to basic_pkt_fwd - it doesn’t accept -l logfile, so you need to strip that bit out of /etc/init.d/lora-network-server where it uses the start-stop daemon to launch pkt_fwd.

Follow-up question - how do I configure or display the logitude and latitude? Mine are coming out blank. http://thethingsnetwork.org/api/v0/gateways/008000000000A052/

I just filled them in in the global_conf.json file

See this message for Configuring longitude and latitude