Kerlink Common Packet Forwarder Keros 4.0.4 connect to TTN

Hy all,

start of this year Kerlink released a new packet forwarder, called the Common Packet Forwarder. The Kerlink documentation and wiki is really a pain, so we are not sure we did anything right. Hopefully someone can give us some hints.

There are some details here: https://www.thethingsnetwork.org/docs/gateways/kerlink/config.html

We have installed the CPF on an iFemtocell and things look similar to what we had with the old SFP. The main difference is a database to store and resend lost packages.

Setup is done via lorafwd.toml,
Following the wiki, we have to set the lns-Adress and the ports, which is

node = "router.eu.thethings.network"
service.uplink = 1700
service.downlink = 1700

In the setup-File there are some strange things we did not understand:

[ database ]

# Whether or not a persistent database will store the incoming messages until
# they will be sent and acknowledged.
#
# Type:    boolean
# Example: true
# Default: false
#
enable = true

which means, that the database is disabled by default?!? Ok, we set this to true to prevent packet loss.

Next strang thing in the setup:

[ gwmp ]

# WARNING ! The GWMP a.k.a. Gateway Message Protocol is a deprecated feature.

Following the wiki, wie should use the GWMP, but here they say, it is deprecated?!?

The old SPF had an autoquit feature, as UDP cannot handle a gateway reconnect. It seems, this is not active on the new CPF, as connection stops after an external WLAN-reset.

Maybe someone can explain. Thank you for your help!

Hy all, nobody out there to help??

The documentation of the CPF is not really good. From the setup we can see that they implemented communication based on websockets, but there are no information how to connect to TTN. This is the part of the setup we can see:

[ gwmp ]

# WARNING ! The GWMP a.k.a. Gateway Message Protocol is a deprecated feature.

# The internet host where the gateway should connect. The node can be either a
# fully qualified domain name or an IP address (IPv4 or IPv6).
#
# Type:    string
# Example: "myhost.example.com" or "123.45.67.89" or "2001:db8::1234"
# Default: "localhost"
#
node = "router.eu.thethings.network"

# The GWMP services can be a service name (see services(5)) or an integer and,
# in this case, refers to a network port.

# The service where the gateway should push uplink messages.
#
# Type:    string or integer
# Example: "https" or 1234
# Default: 0
#
service.uplink = 1700

# The service where the gateway should pull downlink messages.
#
# Type:    string or integer
# Example: "https" or 1234
# Default: 0
#
service.downlink = 1700

# The heartbeat period. Used to keep the firewall open.
#
# Type:    integer (in seconds)
# Example: 30
# Default: 10
#
#period.heartbeat = 10

# The statistics period. Used to send statistics.
#
# Type:    integer (in seconds)
# Example: 10
# Default: 30
#
#period.statistics = 30

# The number of timed out messages which will automatically trigger a network
# socket restart. Used to monitor the connection.
#
# Type:    boolean or integer (false = 0 = disabled) (true = 10)
# Example: 3
# Default: true
#
#autorestart = false

# The maximum datagram size for uplink messages. The datagram includes the GWMP
# header and payload.
#
# Type:    integer
# Example: 50000
# Default: 20000
#
#limit.datagram = 65507

# The endpoint to control the LoRa daemon. Used to request statistics.
#
# Type:    string
# Example: "tcp://localhost:3333"
# Default: "ipc:///var/run/lora/lorad"
#
#lorad.control = "ipc:///var/run/lora/lorad"

[ api ]

# The API use ZeroMQ as transport layer. More informations about ZeroMQ
# endpoints format can be found here:
#
# http://api.zeromq.org/4-2:zmq-connect

# The endpoints for the uplink channel. Used to receive uplink messages.
#
# Type:    string or array of strings
# Example: "tcp://localhost:1111"
# Default: "ipc:///var/run/lora/uplink"
#
#uplink = [ "ipc:///var/run/lora/uplink", "tcp://localhost:1111" ]

# The endpoints for the downlink channel. Used to send downlink messages.
#
# Type:    string or array of strings
# Example: "tcp://localhost:2222"
# Default: "ipc:///var/run/lora/downlink"
#
#downlink = [ "ipc:///var/run/lora/downlink", "tcp://localhost:2222" ]

# The endpoints for the control channel. Used to receive control request.
#
# Type:    string or array of strings
# Example: "tcp://eth0:4444"
# Default: "ipc:///var/run/lora/lorafwd"
#
#control = [ "ipc:///var/run/lora/lorafwd", "tcp://eth0:4444" ]

# The filters for the uplink channel. Used to subscribe to uplink messages.
#
# The filters can handle raw binary (by using unicode) or keywords. The special
# empty filter ("") subscribe to all incoming messages.
#
# Keywords are case-insensitive and are one of these:
# - "lora"
# - "gfsk" or "fsk"
# - "event" (for ease of use, lorafwd always subscribe to event messages)
#
# Type:    string or array of strings
# Example: [ "\u000A", "keyword" ]
# Default: ""
#
#filters = [ "lora", "gfsk" ]

Currently this is configured to use UDP, but does not run stable.

Any hints how to configure for TTN?

Not. TTN implements two protocols are this time. UDP and ttn-gateway-connector. Websockets is not an option.

Thx.

Seems we need to stay on SPF until Kerlink adopts the TTN forwarder. CPF seems to be a bit buggy on UDP still.

I don’t mean to unbury an old post, but CPF is actually GWMPv2 compliant, so gateways need to be declared as iBTS to work with TTN.

Just to update this thread: installed a Kerlink Wirnet iStation FW 4.1.6 based on Kerlink’s Wiki (yes, it’s a bit messy, but with some patience you can find the information needed), installed CPF 1.1.6, edited the lorafwd.toml: set the gateway id and the below:

node = "router.eu.thethings.network"
service.uplink = 1700
service.downlink = 1700

reboot and once you set up your gateway in TTN it worked right away

Can you explain? What is the difference to the semtech udp?

None. Semtech UDP has two variants: GWMPv1 and GWMPv2.
CPF is compliant with GWMPv2 for all hardware (v1 or v2), to have a unified API.

Hi!

I have a couple of iFemtoCell gateways. I’ve set them up as described here with the

node = "router.eu.thethings.network"
service.uplink = 1700 
service.downlink = 1700

This works well - the iFemtoCells are connecting and visible in the TTN console.

Now I’m setting up an iFemtoCell Evolution (with build in 4G backhaul). This uses a new version of the packet forwarder, however the setup seems to be the same. I’ve put in the same values in the lorafwd.toml and registered the gateway in the console. However it keeps ‘not connected’ status… When running:

monit status

I get the following:

Monit 5.20.0 uptime: 16h 54m

Process ‘watchdog’
status Running
monitoring status Monitored
monitoring mode active
on reboot start
pid 887
parent pid 1
uid 0
effective uid 0
gid 0
uptime 16h 54m
threads 1
children 0
cpu 0.0%
cpu total 0.0%
memory 0.0% [60 kB]
memory total 0.0% [60 kB]
data collected Fri, 14 Feb 2020 09:00:53

Process ‘timem’
status Running
monitoring status Waiting
monitoring mode active
on reboot start
pid 835
parent pid 1
uid 0
effective uid 0
gid 0
uptime 16h 53m
threads 2
children 0
cpu 0.0%
cpu total 0.0%
memory 5.6% [12.4 MB]
memory total 5.6% [12.4 MB]
data collected Fri, 14 Feb 2020 09:00:23

Process ‘sysma’
status Running
monitoring status Waiting
monitoring mode active
on reboot start
pid 821
parent pid 1
uid 0
effective uid 0
gid 0
uptime 16h 53m
threads 2
children 0
cpu 0.0%
cpu total 0.0%
memory 5.6% [12.3 MB]
memory total 5.6% [12.3 MB]
data collected Fri, 14 Feb 2020 09:00:23

Process ‘statm’
status Running
monitoring status Waiting
monitoring mode active
on reboot start
pid 800
parent pid 1
uid 0
effective uid 0
gid 0
uptime 16h 53m
threads 2
children 0
cpu 0.0%
cpu total 0.0%
memory 6.0% [13.2 MB]
memory total 6.0% [13.2 MB]
data collected Fri, 14 Feb 2020 09:00:23

Process ‘smsma’
status Running
monitoring status Waiting
monitoring mode active
on reboot start
pid 853
parent pid 1
uid 0
effective uid 0
gid 0
uptime 16h 53m
threads 2
children 0
cpu 0.0%
cpu total 0.0%
memory 5.4% [12.0 MB]
memory total 5.4% [12.0 MB]
data collected Fri, 14 Feb 2020 09:00:23

Process ‘lorafwd’
status Running
monitoring status Monitored
monitoring mode active
on reboot nostart
pid 925
parent pid 1
uid 0
effective uid 0
gid 0
uptime 16h 54m
threads 10
children 0
cpu 0.1%
cpu total 0.1%
memory 2.3% [5.1 MB]
memory total 2.3% [5.1 MB]
data collected Fri, 14 Feb 2020 09:00:53

Process ‘lorad’
status Running
monitoring status Monitored
monitoring mode active
on reboot nostart
pid 904
parent pid 1
uid 0
effective uid 0
gid 0
uptime 16h 54m
threads 9
children 0
cpu 4.4%
cpu total 4.4%
memory 1.4% [3.1 MB]
memory total 1.4% [3.1 MB]
data collected Fri, 14 Feb 2020 09:00:53

System ‘klk-fevo-030006’
status Running
monitoring status Monitored
monitoring mode active
on reboot start
load average [0.02] [0.07] [0.02]
cpu 0.2%us 4.4%sy 0.0%wa
memory usage 65.1 MB [29.6%]
swap usage 0 B [0.0%]
uptime 16h 54m
boot time Thu, 13 Feb 2020 16:06:05
data collected Fri, 14 Feb 2020 09:00:53

Can anyone help figuring out how to get the gateway to connect?

Thank you!

Mathies

A wee update:

The file:
/var/log/lora.log*

Shows the following (and a thousand similar lines):

2020-02-14T11:36:13.026674+00:00 klk-fevo-030006 lorafwd[925]: <3> Failed to send heartbeat

2020-02-14T11:36:16.757775+00:00 klk-fevo-030006 lorafwd[925]: <3> Failed to send data: Invalid argument

2020-02-14T11:36:23.027029+00:00 klk-fevo-030006 lorafwd[925]: <3> Failed to send data: Invalid argument

2020-02-14T11:36:23.027137+00:00 klk-fevo-030006 lorafwd[925]: <3> Failed to send heartbeat

2020-02-14T11:36:29.680752+00:00 klk-fevo-030006 lorafwd[925]: <6> Received uplink message:

2020-02-14T11:36:29.680886+00:00 klk-fevo-030006 lorafwd[925]: <6> | lora uplink (5C900314), payload 27 B, channel 868.3 MHz, crc error, bw 125 kHz, sf 7, cr 4/8

2020-02-14T11:36:29.680954+00:00 klk-fevo-030006 lorafwd[925]: <6> | - radio (00000106)

2020-02-14T11:36:29.681064+00:00 klk-fevo-030006 lorafwd[925]: <6> | - demodulator counter 1469520364, UTC time 2020-02-14T11:36:29.670069Z, rssi -116 dB, snr -13.5< -11.25 <-7 dB

2020-02-14T11:36:29.681114+00:00 klk-fevo-030006 lorafwd[925]: <6> Dropping message with invalid CRC

2020-02-14T11:36:29.681919+00:00 klk-fevo-030006 lorad[904]: <6> Sent 1 uplink message

2020-02-14T11:36:33.027501+00:00 klk-fevo-030006 lorafwd[925]: <3> Failed to send data: Invalid argument

2020-02-14T11:36:33.027576+00:00 klk-fevo-030006 lorafwd[925]: <3> Failed to send heartbeat

I’m not an expert on this, so if you have any suggestions please let me know.

Thanks!

Share your configuration files (lorad and lorafwd) and I’ll have a look. What’s the output of opkg list?

Thanks for replying.

Here’s the requested info:

root@klk-fevo-030006:/user/etc/lorad # opkg list

keros - 4.2.1-0-g67038bc9

lorad - 1.2.0-2

lorafwd - 1.1.1-2

And files (uploading .toml files wasn’t allowed, so I’ve just made a .txt copy):

[lorad.json|attachment](uploalorad.json (2.0 KB) lorafwd.txt (4.7 KB) d://cyDZzmKlJg68SCt3JJhypDpeK6R.json) (2.0 KB)

You didn’t uncomment the LNS address and uplink/downlink ports. Remove the # and it should work. It’s in lorafwd.toml

1 Like

Oh, what a terrible noob mistake. Thank you very much for having a look!

It is now online!