Connect Conduit to TTN LoRaWan via Poly Packet Fwd

One of the most versatile LoRa / LoRaWAN gateways on todays market is Multitech Conduit with LoRa module. This nice blue boxes comes in 2 flavours; mLinux with everything driven from the command line and standard config files and the AEP version with a web based UI. The AEP version is intended for private LoRaWan deployments and where quick and easy configuration is required. I am not going to discuss benefits of Multitech gateway, there is another post coming where I will compare gateways from several vendors one of them being Multitech.

AEP lorawan

I will focus now on how to configure your AEP box to talk to TTN with PolyPacket Forwarder.

To begin, you need to install the Poly Packet Forwarder on your box. I suggest to download the package to another system and then use scp to move it to your Conduit:

Keep in mind, that this example is for SubBand 7 of North American flavour of Lora.
The local_conf.json will overwrite respective portion go global_conf.json with your site specific information

local_conf.json{
/* Put there parameters that are different for each gateway (eg. pointing one gateway to a test server while the others stay in production) */
/* Settings defined in global_conf will be overwritten by those in local_conf */
"gateway_conf": {
/* you must pick a unique 64b number for each gateway (represented by an hex string) */
"gateway_ID": "008000000000XXXX",
/* Email of gateway operator, max 40 chars*/
"contact_email": "YOUR_CONTACT_EMAIL",
/* Public description of this device, max 64 chars */
"description": "DESCRIPTION_OF_YOUR_GATEWAY",
/* Enter VALID GPS coordinates below before enabling fake GPS */
"fake_gps": true,
"ref_latitude": YOUR_GPS_LAT,
"ref_longitude": YOUR_GPS_LON,
"ref_altitude": YOUR_GPS_ALT
}
}

There is one more thing, since the UI controls switching between Packet forwarder mode and Network server mode, you will have no logging for the packet forwarder. In order to enable it, you need to issue the following command from your console:curl 127.0.0.1/api/loraNetwork -X PUT -d '{"log":{"syslog":false}}' -H "Content-Type: application/json"

At this point you can restart you lora service /etc/init.d/lora-network-server restart and your log should confirm that everything is in order:tail -f /var/log/lora-pkt-fwd-1.log
# Invalid gps time reference (age: 1464959181 sec)
# Manual GPS coordinates: latitude ....., longitude ...., altitude 111 m
##### END #####
INFO: [down] for server router.us.thethings.network PULL_ACK received in 106 ms
INFO: [up] PUSH_ACK for server router.us.thethings.network received in 108 ms
INFO: [up] PUSH_ACK for server ott1.iothub.ca received in 35 ms
INFO: [down] for server 127.0.0.1 PULL_ACK received in 1 ms
INFO: [down] for server ott1.iothub.ca PULL_ACK received in 34 ms
INFO: [down] for server router.us.thethings.network PULL_ACK received in 105 ms
INFO: [down] for server 127.0.0.1 PULL_ACK received in 1 ms
INFO: [down] for server ott1.iothub.ca PULL_ACK received in 34 ms
As you can see, we are also connecting to the localhost, so Conduit’s network server. I used that for some tests and find it very helpful.

At this point you can start your node-red (on the Conduit) and configure it to connect to TTN to retrieve and process your packets:

ttn

node-red & lorawan

From the node-red, processed packets are send to InfluxDB and then Grafana provides nice user interface:

SenseInAir over lorawan

Please let me know if you are interested in any write-ups on Node-Red and TTN (or other LoRaWan networks), but for now enjoy your AEP Conduit communicating flawlessly with The Things Network and LoRaWan.

This is ironic because my name is also Stefan but I’m not the same person… but I had the same issue as Stefan above.
After I Ran:
curl 127.0.0.1/api/loraNetwork -X PUT -d ‘{“log”:{“syslog”:false}}’ -H “Content-Type: application/json”

I Run:
tail -f /var/log/tail -f lora-pkt-fwd-1.log

Output:
tail: can’t open ‘/var/log/tail’: No such file or directory
tail: can’t open ‘lora-pkt-fwd-1.log’: No such file or directory
tail: no files

Where did the tx_lut_xx array and rssi_offset values come from? I’ve seen these in some of the European configuration files, and in one other US configuration, but I haven’t seen who decides what they should be, how they’re calculated, etc.

It’s as per SX1301 spec. You don’t really change that part (offsets etc). In case of North America you just change both frequencies and the rest remains the same. Those values will be provided with Conduit template, but in case of more sophisticated devices such as Kerlink, they will be generated after the calibration. Actually, technically speaking you get Kerlink pre-calibrated, but those values are unique for your model.

IOTMAN,
This is quite interesting. Are you suggesting that I would be able to both subscribe and publish through both the localhost ( Conduit ) and say thethingsnetwork? I need to archive the messages locally if my internet connection were to go down.

The Poly forwarder allows you to connect to multiple lora servers, like your localhost and ttn for example. However, your node will register with only one of those servers, so the other one will still receive packets but they will be rejected….