Setting up basic station protocol on Kerlink Wirnet Station

Hi All,

I am attempting to get the Basic Station protocol running on the ‘old’ Kerlink Wirnet Station ( https://www.thethingsnetwork.org/docs/gateways/kerlink/station/ )

I have successfully cross-compiled two binaries (one standard version,and one debug version), and created a simple config file and accompanying uri+cacert files:

[root@Wirnet_xxxxxxxxx ~]# cat station.conf
{
/* If slave-X.conf present this acts as default settings /
“SX1301_conf”: { /
Actual channel plan is controlled by server /
“lorawan_public”: true, /
is default /
“clksrc”: 1, /
radio_1 provides clock to concentrator /
/
path to the SPI device, un-comment if not specified on the command line e.g., RADIODEV=/dev/spidev0.0 /
/
“device”: “/dev/spidev0.0”,/
/
freq/enable provided by LNS - only HW specific settings listed here /
“radio_0”: {
“type”: “SX1257”,
“rssi_offset”: -166.0,
“tx_enable”: true,
“antenna_gain”: 0
},
“radio_1”: {
“type”: “SX1257”,
“rssi_offset”: -166.0,
“tx_enable”: false
}
/
chan_multiSF_X, chan_Lora_std, chan_FSK provided by LNS /
},
“station_conf”: {
“log_level”: “DEBUG”, /
XDEBUG,DEBUG,VERBOSE,INFO,NOTICE,WARNING,ERROR,CRITICAL */
“log_size”: 10000000,
“log_rotate”: 3
}
}

[root@Wirnet_xxxxxxxxx ~]# more tc.uri
wss://lns.eu.thethings.network:443

[root@Wirnet_xxxxxxxx ~]# more tc.trust
-----BEGIN CERTIFICATE-----
MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDANBgkqhkiG9w0BAQsFADA/
MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT
DkRTVCBSb290IENBIFgzMB4XDTE2MDMxNzE2NDA0NloXDTIxMDMxNzE2NDA0Nlow
SjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUxldCdzIEVuY3J5cHQxIzAhBgNVBAMT
GkxldCdzIEVuY3J5cHQgQXV0aG9yaXR5IFgzMIIBIjANBgkqhkiG9w0BAQEFAAOC
AQ8AMIIBCgKCAQEAnNMM8FrlLke3cl03g7NoYzDq1zUmGSXhvb418XCSL7e4S0EF
q6meNQhY7LEqxGiHC6PjdeTm86dicbp5gWAf15Gan/PQeGdxyGkOlZHP/uaZ6WA8
SMx+yk13EiSdRxta67nsHjcAHJyse6cF6s5K671B5TaYucv9bTyWaN8jKkKQDIZ0
Z8h/pZq4UmEUEz9l6YKHy9v6Dlb2honzhT+Xhq+w3Brvaw2VFn3EK6BlspkENnWA
a6xK8xuQSXgvopZPKiAlKQTGdMDQMc2PMTiVFrqoM7hD8bEfwzB/onkxEz0tNvjj
/PIzark5McWvxI0NHWQWM6r6hCm21AvA2H3DkwIDAQABo4IBfTCCAXkwEgYDVR0T
AQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAYYwfwYIKwYBBQUHAQEEczBxMDIG
CCsGAQUFBzABhiZodHRwOi8vaXNyZy50cnVzdGlkLm9jc3AuaWRlbnRydXN0LmNv
bTA7BggrBgEFBQcwAoYvaHR0cDovL2FwcHMuaWRlbnRydXN0LmNvbS9yb290cy9k
c3Ryb290Y2F4My5wN2MwHwYDVR0jBBgwFoAUxKexpHsscfrb4UuQdf/EFWCFiRAw
VAYDVR0gBE0wSzAIBgZngQwBAgEwPwYLKwYBBAGC3xMBAQEwMDAuBggrBgEFBQcC
ARYiaHR0cDovL2Nwcy5yb290LXgxLmxldHNlbmNyeXB0Lm9yZzA8BgNVHR8ENTAz
MDGgL6AthitodHRwOi8vY3JsLmlkZW50cnVzdC5jb20vRFNUUk9PVENBWDNDUkwu
Y3JsMB0GA1UdDgQWBBSoSmpjBH3duubRObemRWXv86jsoTANBgkqhkiG9w0BAQsF
AAOCAQEA3TPXEfNjWDjdGBX7CVW+dla5cEilaUcne8IkCJLxWh9KEik3JHRRHGJo
uM2VcGfl96S8TihRzZvoroed6ti6WqEBmtzw3Wodatg+VyOeph4EYpr/1wXKtx8/
wApIvJSwtmVi4MFU5aMqrSDE6ea73Mj2tcMyo5jMd6jmeWUHK8so/joWUoHOUgwu
X4Po1QYz+3dszkDqMp4fklxBwXRsW10KXzPMTZ+sOPAveyxindmjkW8lGy+QsRlG
PfZ+G6Z6h7mjem0Y+iWlkYcV4PIWL1iwBi8saCbGS5jN2p8M+X+Q7UNKEkROb3N6
KOqkqm57TH2H3eDJAkSnh6/DNFu0Qg==
-----END CERTIFICATE-----

When starting the program, there is a new connection setup to lns.eu.thethings.network:443, however, this does not seem successfull as it keeps repeating the connection.
Below is a combination of tcpdump in the background, with the program output to stdout:

[root@Wirnet_xxxxxxxx ~]# ./station_dbg
2020-08-04 09:20:57.318 [SYS:INFO] Logging : stderr (maxsize=10000000, rotate=3)
2020-08-04 09:20:57.320 [SYS:INFO] Station Ver : 2.0.5(kerlink/debug) 2020-08-03 21:49:07
2020-08-04 09:20:57.322 [SYS:INFO] Package Ver : (null)
2020-08-04 09:20:57.322 [SYS:INFO] proto EUI : 0:24b:xxxx:xxxx (/sys/class/net/eth0/address)
2020-08-04 09:20:57.323 [SYS:INFO] prefix EUI : ::1 (builtin)
2020-08-04 09:20:57.323 [SYS:INFO] Station EUI : 24b:8ff:xxxx:xxxx
2020-08-04 09:20:57.323 [SYS:INFO] Station home: ./ (builtin)
2020-08-04 09:20:57.324 [SYS:INFO] Station temp: /var/tmp/ (builtin)
2020-08-04 09:20:57.324 [SYS:WARN] Station in NO-CUPS mode
09:20:57.579252 IP 44.137.2.25.47922 > 52.169.76.203.443: Flags [S], seq 29817396, win 14600, options [mss 1460,nop,nop,sackOK,nop,wscale 4], length 0
09:20:57.625582 IP 52.169.76.203.443 > 44.137.2.25.47922: Flags [S.], seq 2270761648, ack 29817397, win 29200, options [mss 1280,nop,nop,sackOK,nop,wscale 7], length 0
09:20:58.571837 IP 44.137.2.25.47922 > 52.169.76.203.443: Flags [S], seq 29817396, win 14600, options [mss 1460,nop,nop,sackOK,nop,wscale 4], length 0
09:20:58.607629 IP 52.169.76.203.443 > 44.137.2.25.47922: Flags [S.], seq 2270761648, ack 29817397, win 29200, options [mss 1280,nop,nop,sackOK,nop,wscale 7], length 0
09:20:59.606603 IP 52.169.76.203.443 > 44.137.2.25.47922: Flags [S.], seq 2270761648, ack 29817397, win 29200, options [mss 1280,nop,nop,sackOK,nop,wscale 7], length 0
09:21:00.571832 IP 44.137.2.25.47922 > 52.169.76.203.443: Flags [S], seq 29817396, win 14600, options [mss 1460,nop,nop,sackOK,nop,wscale 4], length 0
09:21:00.604611 IP 52.169.76.203.443 > 44.137.2.25.47922: Flags [S.], seq 2270761648, ack 29817397, win 29200, options [mss 1280,nop,nop,sackOK,nop,wscale 7], length 0
09:21:02.602707 IP 52.169.76.203.443 > 44.137.2.25.47922: Flags [S.], seq 2270761648, ack 29817397, win 29200, options [mss 1280,nop,nop,sackOK,nop,wscale 7], length 0
2020-08-04 09:20:57.527 [TCE:INFO] Starting TC engine
2020-08-04 09:20:57.546 [any:INFO] ./tc.trust:
cert. version : 3
serial number : 0A:01:41:42:00:00:01:53:85:73:6A:0B:85:EC:A7:08
issuer name : O=Digital Signature Trust Co., CN=DST Root CA X3
subject name : C=US, O=Let’s Encrypt, CN=Let’s Encrypt Authority X3
issued on : 2016-03-17 16:40:46
expires on : 2021-03-17 16:40:46
signed using : RSA with SHA-256
RSA key size : 2048 bits
basic constraints : CA=true, max_pathlen=0
key usage : Digital Signature, Ke2020-08-04 09:20:57.546 [AIO:INFO] tc has no key+cert configured - running server auth only
2020-08-04 09:21:04.582 [AIO:ERRO] [3] WS connect failed: NET - The connection to the given server / port failed
2020-08-04 09:21:04.582 [AIO:DEBU] [3] WS connection shutdown…
2020-08-04 09:21:04.583 [TCE:ERRO] TC connect failed - URI: wss://lns.eu.thethings.network:443
2020-08-04 09:21:04.583 [TCE:INFO] INFOS reconnect backoff 0s (retry 0)
2020-08-04 09:21:04.587 [any:INFO] ./tc.trust:
cert. version : 3
serial number : 0A:01:41:42:00:00:01:53:85:73:6A:0B:85:EC:A7:08
issuer name : O=Digital Signature Trust Co., CN=DST Root CA X3
subject name : C=US, O=Let’s Encrypt, CN=Let’s Encrypt Authority X3
issued on : 2016-03-17 16:40:46
expires on : 2021-03-17 16:40:46
signed using : RSA with SHA-256
RSA key size : 2048 bits
basic constraints : CA=true, max_pathlen=0
key usage : Digital Signature, Ke2020-08-04 09:21:04.587 [AIO:INFO] tc has no key+cert configured - running server auth only
09:21:04.608585 IP 44.137.2.25.47923 > 52.169.76.203.443: Flags [S], seq 3927080007, win 14600, options [mss 1460,nop,nop,sackOK,nop,wscale 4], length 0
09:21:04.643017 IP 52.169.76.203.443 > 44.137.2.25.47923: Flags [S.], seq 2237967577, ack 3927080008, win 29200, options [mss 1280,nop,nop,sackOK,nop,wscale 7], length 0
09:21:05.601842 IP 44.137.2.25.47923 > 52.169.76.203.443: Flags [S], seq 3927080007, win 14600, options [mss 1460,nop,nop,sackOK,nop,wscale 4], length 0
09:21:05.637541 IP 52.169.76.203.443 > 44.137.2.25.47923: Flags [S.], seq 2237967577, ack 3927080008, win 29200, options [mss 1280,nop,nop,sackOK,nop,wscale 7], length 0
09:21:06.635672 IP 52.169.76.203.443 > 44.137.2.25.47923: Flags [S.], seq 2237967577, ack 3927080008, win 29200, options [mss 1280,nop,nop,sackOK,nop,wscale 7], length 0
09:21:07.601814 IP 44.137.2.25.47923 > 52.169.76.203.443: Flags [S], seq 3927080007, win 14600, options [mss 1460,nop,nop,sackOK,nop,wscale 4], length 0
09:21:07.643856 IP 52.169.76.203.443 > 44.137.2.25.47923: Flags [S.], seq 2237967577, ack 3927080008, win 29200, options [mss 1280,nop,nop,sackOK,nop,wscale 7], length 0
09:21:09.637016 IP 52.169.76.203.443 > 44.137.2.25.47923: Flags [S.], seq 2237967577, ack 3927080008, win 29200, options [mss 1280,nop,nop,sackOK,nop,wscale 7], length 0
2020-08-04 09:21:11.611 [AIO:ERRO] [3] WS connect failed: NET - The connection to the given server / port failed
2020-08-04 09:21:11.612 [AIO:DEBU] [3] WS connection shutdown…
2020-08-04 09:21:11.613 [TCE:ERRO] TC connect failed - URI: wss://lns.eu.thethings.network:443
2020-08-04 09:21:11.613 [TCE:INFO] INFOS reconnect backoff 10s (retry 1)
^C[root@Wirnet_xxxxxxxx ~]#

I attempted to increase debugging for the TLS connection (as found in other topics), but not sure how to interpret the added debug lines:

2020-08-04 09:28:58.872 [AIO:DEBU] ssl_tls.c:7344 MBEDTLS[2]: => free
2020-08-04 09:28:58.874 [AIO:DEBU] ssl_tls.c:7409 MBEDTLS[2]: <= free

[root@Wirnet_xxxxxxxx ~]# STATION_TLSDBG=4 ./station_dbg
2020-08-04 09:28:51.606 [SYS:INFO] Logging : stderr (maxsize=10000000, rotate=3)
2020-08-04 09:28:51.608 [SYS:INFO] Station Ver : 2.0.5(kerlink/debug) 2020-08-03 21:49:07
2020-08-04 09:28:51.610 [SYS:INFO] Package Ver : (null)
2020-08-04 09:28:51.612 [SYS:INFO] proto EUI : 0:24b:xxxx:xxxx (/sys/class/net/eth0/address)
2020-08-04 09:28:51.612 [SYS:INFO] prefix EUI : ::1 (builtin)
2020-08-04 09:28:51.612 [SYS:INFO] Station EUI : 24b:8ff:xxxx:xxxx
2020-08-04 09:28:51.613 [SYS:INFO] Station home: ./ (builtin)
2020-08-04 09:28:51.613 [SYS:INFO] Station temp: /var/tmp/ (builtin)
2020-08-04 09:28:51.614 [SYS:WARN] Station in NO-CUPS mode
2020-08-04 09:28:51.817 [TCE:INFO] Starting TC engine
2020-08-04 09:28:51.835 [any:INFO] ./tc.trust:
cert. version : 3
serial number : 0A:01:41:42:00:00:01:53:85:73:6A:0B:85:EC:A7:08
issuer name : O=Digital Signature Trust Co., CN=DST Root CA X3
subject name : C=US, O=Let’s Encrypt, CN=Let’s Encrypt Authority X3
issued on : 2016-03-17 16:40:46
expires on : 2021-03-17 16:40:46
signed using : RSA with SHA-256
RSA key size : 2048 bits
basic constraints : CA=true, max_pathlen=0
key usage : Digital Signature, Ke2020-08-04 09:28:51.836 [AIO:INFO] tc has no key+cert configured - running server auth only
2020-08-04 09:28:58.872 [AIO:ERRO] [3] WS connect failed: NET - The connection to the given server / port failed
2020-08-04 09:28:58.872 [AIO:DEBU] [3] WS connection shutdown…
2020-08-04 09:28:58.872 [AIO:DEBU] ssl_tls.c:7344 MBEDTLS[2]: => free
2020-08-04 09:28:58.874 [AIO:DEBU] ssl_tls.c:7409 MBEDTLS[2]: <= free
2020-08-04 09:28:58.875 [TCE:ERRO] TC connect failed - URI: wss://lns.eu.thethings.network:443
2020-08-04 09:28:58.875 [TCE:INFO] INFOS reconnect backoff 0s (retry 0)
2020-08-04 09:28:58.878 [any:INFO] ./tc.trust:

Any help would be greatly appreciated.
The version of the kerlink unit:

[root@Wirnet_xxxxxxxxx ~]# get_version -u
KERNEL_VER=3.10.104-3.10.104-klk6
PIC_VER=8.3
BOOTSTRAP_VER=“”
UBOOT_VER=“U-Boot 2009.03-2009.03-klk1 (Dec 27 2016 - 16:23:47)”
SCRIPT_VER=v1.0
INITRAMFS_VER=v1.1
FILESYSTEM_VER=2016.05v1.5
KNETD_VER=“wirma2_v4.09 WAN_3.16 (Dec 23 2016-14:33:40)”
PROD_FW=wirmaV2_wirnet_v3.1
LORABOARD_MANUFACTURER=00
LORABOARD_TYPE=“868-27dBm”
LORABOARD_HWVERSION=05
LORABOARD_SERIALNO=00XXXX

Have you checked the instructions in Setting up Basic Station protocol on RAK7240 and RAK7249 industrial gateways?

Hi Jac (et all),

Thanks for the answer, for some reason I just noticed your reply on the topic.

I did follow the link you provided (which shows the URL and port. These match what I have in my config files. It also shows the CA file which I have in place.

Looking at the network packets (when starting the station), these confirm my config files are correct and interpreted correctly.

To be sure, I just recompiled the software again, and placed the resulting files ( lib/s2core/include/bin dirs) on the Kerlink.

With a bit more logging these lines are printed, but do not show a real issue:

# STATION_TLSDBG=9 ./station --home=/root
2020-08-20 19:53:45.947 [any:XDEB]   rt_malloc(5) ../../src/sys.c:149 -> 0xd9048
2020-08-20 19:53:45.950 [any:XDEB]   rt_free() ../../src-linux/sys_linux.c:323 -> 0xd9170
2020-08-20 19:53:45.951 [any:XDEB]   rt_free() ../../src-linux/sys_linux.c:324 -> 0xd9048
2020-08-20 19:53:45.953 [any:XDEB]   rt_free() ../../src/sys.c:152 -> (nil)
2020-08-20 19:53:45.954 [any:XDEB]   rt_free() ../../src/sys.c:152 -> (nil)
2020-08-20 19:53:45.955 [any:XDEB]   rt_free() ../../src/sys.c:152 -> (nil)
2020-08-20 19:53:45.955 [any:XDEB]   rt_malloc(36) ../../src/sys.c:149 -> 0xd9518
2020-08-20 19:53:45.956 [any:XDEB]   rt_free() ../../src/sys.c:267 -> 0xd9518
2020-08-20 19:53:45.956 [any:XDEB]   rt_free() ../../src/sys.c:152 -> (nil)
2020-08-20 19:53:45.957 [any:XDEB]   rt_free() ../../src/sys.c:152 -> (nil)
2020-08-20 19:53:45.957 [SYS:INFO] Logging     : stderr (maxsize=10000000, rotate=3)
2020-08-20 19:53:45.958 [SYS:INFO] Station Ver : 2.0.5(kerlink/debug) 2020-08-20 19:35:04
2020-08-20 19:53:45.958 [any:XDEB]   rt_free() ../../src/sys.c:152 -> (nil)
2020-08-20 19:53:45.958 [any:XDEB]   rt_free() ../../src/sys.c:181 -> 0xd9540
2020-08-20 19:53:45.959 [SYS:INFO] Package Ver : (null)
2020-08-20 19:53:45.959 [SYS:INFO] proto EUI   : 0:24b:806:5f0	(/sys/class/net/eth0/address)
2020-08-20 19:53:45.959 [SYS:INFO] prefix EUI  : ::1	(builtin)
2020-08-20 19:53:45.960 [SYS:INFO] Station EUI : 24b:8ff:fe06:5f0
2020-08-20 19:53:45.960 [SYS:INFO] Station home: /root/	(--home)
2020-08-20 19:53:45.961 [SYS:INFO] Station temp: /var/tmp/	(builtin)
2020-08-20 19:53:45.961 [SYS:WARN] Station in NO-CUPS mode
2020-08-20 19:53:45.966 [any:XDEB]   rt_free() ../../src-linux/sys_linux.c:334 -> 0xd95e8
2020-08-20 19:53:45.966 [any:XDEB]   rt_free() ../../src/sys.c:100 -> (nil)
19:53:46.226101 IP 44.137.2.25.39216 > 52.169.76.203.443: Flags [S], seq 4244764450, win 14600, options [mss 1460,nop,nop,sackOK,nop,wscale 4], length 0
19:53:46.264696 IP 52.169.76.203.443 > 44.137.2.25.39216: Flags [S.], seq 3395713957, ack 4244764451, win 29200, options [mss 1280,nop,nop,sackOK,nop,wscale 7], length 0
19:53:47.223023 IP 44.137.2.25.39216 > 52.169.76.203.443: Flags [S], seq 4244764450, win 14600, options [mss 1460,nop,nop,sackOK,nop,wscale 4], length 0
19:53:47.256700 IP 52.169.76.203.443 > 44.137.2.25.39216: Flags [S.], seq 3395713957, ack 4244764451, win 29200, options [mss 1280,nop,nop,sackOK,nop,wscale 7], length 0
19:53:48.253259 IP 52.169.76.203.443 > 44.137.2.25.39216: Flags [S.], seq 3395713957, ack 4244764451, win 29200, options [mss 1280,nop,nop,sackOK,nop,wscale 7], length 0
19:53:49.223032 IP 44.137.2.25.39216 > 52.169.76.203.443: Flags [S], seq 4244764450, win 14600, options [mss 1460,nop,nop,sackOK,nop,wscale 4], length 0
19:53:49.257774 IP 52.169.76.203.443 > 44.137.2.25.39216: Flags [S.], seq 3395713957, ack 4244764451, win 29200, options [mss 1280,nop,nop,sackOK,nop,wscale 7], length 0
19:53:51.259335 IP 52.169.76.203.443 > 44.137.2.25.39216: Flags [S.], seq 3395713957, ack 4244764451, win 29200, options [mss 1280,nop,nop,sackOK,nop,wscale 7], length 0
2020-08-20 19:53:46.167 [any:XDEB]   rt_malloc(32) ../../src/rt.c:545 -> 0xd9518
2020-08-20 19:53:46.167 [any:XDEB]   rt_free() ../../src/rt.c:548 -> (nil)
2020-08-20 19:53:46.167 [TCE:INFO] Starting TC engine
2020-08-20 19:53:46.168 [any:XDEB]   rt_malloc(41336) ../../src/tc.c:276 -> 0xd9620
2020-08-20 19:53:46.168 [any:XDEB]   rt_malloc(176) ../../src/s2e.c:74 -> 0xe37a0
2020-08-20 19:53:46.169 [any:XDEB]   rt_malloc(36) ../../src/sys.c:149 -> 0xd90b8
2020-08-20 19:53:46.169 [any:XDEB]   rt_free() ../../src/sys.c:267 -> 0xd90b8
2020-08-20 19:53:46.169 [any:XDEB]   rt_malloc(220) ../../src/tls.c:112 -> 0xe3858
2020-08-20 19:53:46.170 [any:XDEB]   rt_malloc(944) ../../src/tls.c:67 -> 0xe3938
2020-08-20 19:53:46.185 [any:XDEB]   rt_malloc(312) ../../src/tls.c:172 -> 0xe3cf0
2020-08-20 19:53:46.187 [any:XDEB]   rt_malloc(1648) ../../src/sys.c:149 -> 0xe3e30
2020-08-20 19:53:46.187 [any:XDEB]   rt_free() ../../src/sys.c:222 -> 0xd95e8
2020-08-20 19:53:46.189 [any:INFO] /root/tc.trust:
cert. version     : 3
serial number     : 0A:01:41:42:00:00:01:53:85:73:6A:0B:85:EC:A7:08
issuer name       : O=Digital Signature Trust Co., CN=DST Root CA X3
subject name      : C=US, O=Let's Encrypt, CN=Let's Encrypt Authority X3
issued  on        : 2016-03-17 16:40:46
expires on        : 2021-03-17 16:40:46
signed using      : RSA with SHA-256
RSA key size      : 2048 bits
basic constraints : CA=true, max_pathlen=0
key usage         : Digital Signature2020-08-20 19:53:46.189 [any:XDEB]   rt_free() ../../src/tls.c:197 -> 0xe3e30
2020-08-20 19:53:46.190 [AIO:INFO] tc has no key+cert configured - running server auth only
2020-08-20 19:53:46.190 [any:XDEB]   rt_malloc(264) ../../src/tls.c:266 -> 0xe3e30
2020-08-20 19:53:53.233 [AIO:ERRO] [3] WS connect failed: NET - The connection to the given server / port failed
2020-08-20 19:53:53.233 [AIO:DEBU] [3] WS connection shutdown...
2020-08-20 19:53:53.233 [any:XDEB]   rt_free() ../../src/net.c:457 -> (nil)
2020-08-20 19:53:53.233 [any:XDEB]   rt_free() ../../src/net.c:458 -> (nil)
2020-08-20 19:53:53.234 [any:XDEB]   rt_free() ../../src/net.c:461 -> (nil)
2020-08-20 19:53:53.234 [AIO:DEBU] ssl_tls.c:7344 MBEDTLS[2]: => free
2020-08-20 19:53:53.235 [AIO:DEBU] ssl_tls.c:7409 MBEDTLS[2]: <= free
2020-08-20 19:53:53.235 [any:XDEB]   rt_free() ../../src/tls.c:291 -> 0xe3e30
2020-08-20 19:53:53.235 [any:XDEB]   rt_free() ../../src/tls.c:147 -> 0xe3cf0
2020-08-20 19:53:53.235 [any:XDEB]   rt_free() ../../src/tls.c:161 -> 0xe3858
2020-08-20 19:53:53.235 [TCE:ERRO] TC connect failed - URI: wss://lns.eu.thethings.network:443
2020-08-20 19:53:53.236 [any:XDEB]   rt_free() ../../src/net.c:875 -> (nil)
2020-08-20 19:53:53.236 [any:XDEB]   rt_free() ../../src/net.c:876 -> (nil)
2020-08-20 19:53:53.236 [any:XDEB]   rt_free() ../../src/net.c:879 -> (nil)
2020-08-20 19:53:53.236 [any:XDEB]   rt_free() ../../src/net.c:880 -> (nil)
2020-08-20 19:53:53.236 [any:XDEB]   rt_free() ../../src/net.c:881 -> (nil)
2020-08-20 19:53:53.236 [any:XDEB]   rt_free() ../../src/net.c:885 -> (nil)
2020-08-20 19:53:53.236 [TCE:INFO] INFOS reconnect backoff 0s (retry 0)
2020-08-20 19:53:53.237 [any:XDEB]   rt_free() ../../src/net.c:875 -> (nil)
2020-08-20 19:53:53.237 [any:XDEB]   rt_free() ../../src/net.c:876 -> (nil)
2020-08-20 19:53:53.237 [any:XDEB]   rt_free() ../../src/net.c:879 -> (nil)
2020-08-20 19:53:53.237 [any:XDEB]   rt_free() ../../src/net.c:880 -> (nil)
2020-08-20 19:53:53.237 [any:XDEB]   rt_free() ../../src/net.c:881 -> (nil)
2020-08-20 19:53:53.237 [any:XDEB]   rt_free() ../../src/net.c:885 -> (nil)
2020-08-20 19:53:53.238 [any:XDEB]   rt_free() ../../src/tc.c:299 -> 0xd9620
2020-08-20 19:53:53.238 [any:XDEB]   rt_malloc(41336) ../../src/tc.c:276 -> 0xd9620
2020-08-20 19:53:53.239 [any:XDEB]   rt_malloc(36) ../../src/sys.c:149 -> 0xd90b8
2020-08-20 19:53:53.239 [any:XDEB]   rt_free() ../../src/sys.c:267 -> 0xd90b8
2020-08-20 19:53:53.239 [any:XDEB]   rt_malloc(220) ../../src/tls.c:112 -> 0xe3858
2020-08-20 19:53:53.239 [any:XDEB]   rt_malloc(312) ../../src/tls.c:172 -> 0xedd50
2020-08-20 19:53:53.240 [any:XDEB]   rt_malloc(1648) ../../src/sys.c:149 -> 0xe3cf0
2020-08-20 19:53:53.240 [any:XDEB]   rt_free() ../../src/sys.c:222 -> 0xede90
2020-08-20 19:53:53.242 [any:INFO] /root/tc.trust:
cert. version     : 3
serial number     : 0A:01:41:42:00:00:01:53:85:73:6A:0B:85:EC:A7:08
issuer name       : O=Digital Signature Trust Co., CN=DST Root CA X3
subject name      : C=US, O=Let's Encrypt, CN=Let's Encrypt Authority X3
issued  on        : 2016-03-17 16:40:46
expires on        : 2021-03-17 16:40:46
signed using      : RSA with SHA-256
RSA key size      : 2048 bits
basic constraints : CA=true, max_pathlen=0
key usage         : Digital Signature2020-08-20 19:53:53.242 [any:XDEB]   rt_free() ../../src/tls.c:197 -> 0xe3cf0
2020-08-20 19:53:53.242 [AIO:INFO] tc has no key+cert configured - running server auth only
2020-08-20 19:53:53.242 [any:XDEB]   rt_malloc(264) ../../src/tls.c:266 -> 0xede90
19:53:53.276839 IP 44.137.2.25.39217 > 52.169.76.203.443: Flags [S], seq 2299284170, win 14600, options [mss 1460,nop,nop,sackOK,nop,wscale 4], length 0
19:53:53.313672 IP 52.169.76.203.443 > 44.137.2.25.39217: Flags [S.], seq 2380667322, ack 2299284171, win 29200, options [mss 1280,nop,nop,sackOK,nop,wscale 7], length 0
19:53:54.273009 IP 44.137.2.25.39217 > 52.169.76.203.443: Flags [S], seq 2299284170, win 14600, options [mss 1460,nop,nop,sackOK,nop,wscale 4], length 0
19:53:54.314908 IP 52.169.76.203.443 > 44.137.2.25.39217: Flags [S.], seq 2380667322, ack 2299284171, win 29200, options [mss 1280,nop,nop,sackOK,nop,wscale 7], length 0
19:53:54.315305 IP 52.169.76.203.443 > 44.137.2.25.39217: Flags [S.], seq 2380667322, ack 2299284171, win 29200, options [mss 1280,nop,nop,sackOK,nop,wscale 7], length 0
19:53:56.272964 IP 44.137.2.25.39217 > 52.169.76.203.443: Flags [S], seq 2299284170, win 14600, options [mss 1460,nop,nop,sackOK,nop,wscale 4], length 0
19:53:56.309608 IP 52.169.76.203.443 > 44.137.2.25.39217: Flags [S.], seq 2380667322, ack 2299284171, win 29200, options [mss 1280,nop,nop,sackOK,nop,wscale 7], length 0
19:53:58.308763 IP 52.169.76.203.443 > 44.137.2.25.39217: Flags [S.], seq 2380667322, ack 2299284171, win 29200, options [mss 1280,nop,nop,sackOK,nop,wscale 7], length 0

On network level, a connection is made, but I guess on application level my session is not accepted or something like that.
However, there is no real error response thrown, is this ‘debugable’ on the TTN server side?

Best regards,

Ron

TTN usually does not debug for individual gateway owners. There are too many within too many issues, it would take them a couple of full time fte’s to help everyone.
You could try to install the V3 stack in the cloud and watch that log, it is different to the (current) community install but could help you at least some.

Hi Jac,

Thanks for the feedback, I will look into hyour suggestion.

While troubleshooting, I noticed one thing.

2020-08-20 20:56:59.997 [any:INFO] /root/tc.trust:
cert. version : 3
serial number : 0A:01:41:42:00:00:01:53:85:73:6A:0B:85:EC:A7:08
issuer name : O=Digital Signature Trust Co., CN=DST Root CA X3
subject name : C=US, O=Let’s Encrypt, CN=Let’s Encrypt Authority X3

which seems OK.

While reading this article:

it shows in their debug:
ssl_tls.c:4524 MBEDTLS[3]: subject name : CN=lns.in.thethings.network
ssl_tls.c:4524 MBEDTLS[3]: subject alt name : lns.in.thethings.network

In their example , both the CN, and SubjectAltName are the ‘lns’, not the CA X3.
I am trying to achieve the same debug output (from lib mbedtls), but mine does not seem to print as theirs when using:
STATION_TLSDBG=9 /usr/bin//station --home=/root &

Do you have any suggestion for that?

Thanks,

Ron

Sorry, can’t help you. I haven’t looked at Basic Station for well over a year as TTN Community network support is not really there yet. (I don’t like the ‘legacy’ registration)
I’m waiting for the community network to switch to V3 before I want to spend time on it again.

May-be @jmarcelino knowns what might be wrong?

That all seems fine including the certificate information until obviously you reach:

But this is happening very early in the connection phase. Are you sure the gateway is able to access the server and port? Have you looked at the traffic and do you see any TLS negotiation actually taking place?

Hi Jose,

Looking at the TCP packets on a router within our domain (transit router), I do see the packets passing by, just like a manual curl or wget from another host (this is a capture on a Mikrotik):

[admin@gw.pi1vbg.ampr.org] > /tool sniffer quick ip-address=52.169.76.203 port=443
INTERFACE                                                                          TIME    NUM DIR SRC-MAC           DST-MAC           VLAN   SRC-ADDRESS                         DST-ADDRESS                         PROTOCOL   SIZE CPU FP
eth2-PI8HGL                                                                       3.309      1 <-  D4:CA:6D:C9:F9:53 6C:3B:6B:B5:78:BD        44.137.2.25:42746                   52.169.76.203:443 (https)           ip:tcp       66   0 no
ether10-PE1RFR                                                                    3.309      2 ->  E4:8D:8C:73:1A:4A D4:CA:6D:C9:F9:55        44.137.2.25:42746                   52.169.76.203:443 (https)           ip:tcp       66   0 no
eth1-PI1DFT                                                                       3.357      3 <-  4C:5E:0C:54:D5:35 6C:3B:6B:B5:78:BC        52.169.76.203:443 (https)           44.137.2.25:42746                   ip:tcp       66   0 no
eth2-PI8HGL                                                                       3.357      4 ->  6C:3B:6B:B5:78:BD D4:CA:6D:C9:F9:53        52.169.76.203:443 (https)           44.137.2.25:42746                   ip:tcp       66   0 no
eth2-PI8HGL                                                                       4.306      5 <-  D4:CA:6D:C9:F9:53 6C:3B:6B:B5:78:BD        44.137.2.25:42746                   52.169.76.203:443 (https)           ip:tcp       66   0 no
ether10-PE1RFR                                                                    4.306      6 ->  E4:8D:8C:73:1A:4A D4:CA:6D:C9:F9:55        44.137.2.25:42746                   52.169.76.203:443 (https)           ip:tcp       66   0 no
eth1-PI1DFT                                                                       4.344      7 <-  4C:5E:0C:54:D5:35 6C:3B:6B:B5:78:BC        52.169.76.203:443 (https)           44.137.2.25:42746                   ip:tcp       66   0 no
eth2-PI8HGL                                                                       4.345      8 ->  6C:3B:6B:B5:78:BD D4:CA:6D:C9:F9:53        52.169.76.203:443 (https)           44.137.2.25:42746                   ip:tcp       66   0 no
eth1-PI1DFT                                                                       5.063      9 <-  4C:5E:0C:54:D5:35 6C:3B:6B:B5:78:BC        52.169.76.203:443 (https)           44.137.2.25:42745                   ip:tcp       66   0 no
eth2-PI8HGL                                                                       5.063     10 ->  6C:3B:6B:B5:78:BD D4:CA:6D:C9:F9:53        52.169.76.203:443 (https)           44.137.2.25:42745                   ip:tcp       66   0 no
eth1-PI1DFT                                                                       5.344     11 <-  4C:5E:0C:54:D5:35 6C:3B:6B:B5:78:BC        52.169.76.203:443 (https)           44.137.2.25:42746                   ip:tcp       66   0 no
eth2-PI8HGL                                                                       5.344     12 ->  6C:3B:6B:B5:78:BD D4:CA:6D:C9:F9:53        52.169.76.203:443 (https)           44.137.2.25:42746                   ip:tcp       66   0 no

I will perform a capture on the Kerlink itself, so I can pass it to Wireshark and see if something is shown for TLS.

Screenshot 2020-08-21 at 20.33.21

Hi Jose,

I’m not sure what is going on, but something interesting is going on.
If I interpret the packets correctly:

  • A TCP SYN is initiated from the Kerlink device to the LNS on port 443
  • a TCP SYN ACK is received from the LNS
  • a re-transmit is performed from the Kerlink for the same TCP SYN
  • two SYN ACK’s are received from the LNS
  • the above cycle is repeated once
  • another new session is started (new TCP source port is used)
  • repeat all of the above…

It sounds a bit as if the Kerlink does not respond correctly to the received SYN ACK.

Would you agree to this?

Best regards,

Ron

I don’t know much about Kerlinks but this page suggests there is some form of firewall enabled by default, can it be the case it is interfering here?

“ When using the wirnet_v3.1 firmware, the firewall is activated by default. In some cases the firewall might interfere with downlinks or SSH access. ”

https://www.thethingsnetwork.org/docs/gateways/kerlink/station/config.html

Hi Jose,

I did check the firewall, it is setup to simply allow everything out.
However, after disabling the firewall, it seems to allow more. (this seems a bit stupid).

2020-08-21 19:13:14.097 [SYS:INFO] Logging     : stderr (maxsize=10000000, rotate=3)
2020-08-21 19:13:14.100 [SYS:INFO] Station Ver : 2.0.5(kerlink/std) 2020-08-20 20:14:28
2020-08-21 19:13:14.102 [SYS:INFO] Package Ver : (null)
2020-08-21 19:13:14.103 [SYS:INFO] proto EUI   : 0:24b:806:5f0	(/sys/class/net/eth0/address)
2020-08-21 19:13:14.103 [SYS:INFO] prefix EUI  : ::1	(builtin)
2020-08-21 19:13:14.104 [SYS:INFO] Station EUI : 24b:8ff:fe06:5f0
2020-08-21 19:13:14.104 [SYS:INFO] Station home: /root/	(--home)
2020-08-21 19:13:14.104 [SYS:INFO] Station temp: /var/tmp/	(builtin)
2020-08-21 19:13:14.104 [SYS:WARN] Station in NO-CUPS mode
2020-08-21 19:13:14.307 [TCE:INFO] Starting TC engine
2020-08-21 19:13:14.326 [any:INFO] /root/tc.trust:
cert. version     : 3
serial number     : 0A:01:41:42:00:00:01:53:85:73:6A:0B:85:EC:A7:08
issuer name       : O=Digital Signature Trust Co., CN=DST Root CA X3
subject name      : C=US, O=Let's Encrypt, CN=Let's Encrypt Authority X3
issued  on        : 2016-03-17 16:40:46
expires on        : 2021-03-17 16:40:46
signed using      : RSA with SHA-256
RSA key size      : 2048 bits
basic constraints : CA=true, max_pathlen=0
key usage         : Digital Signature2020-08-21 19:13:14.326 [AIO:INFO] tc has no key+cert configured - running server auth only
2020-08-21 19:13:14.408 [AIO:XDEB] [3] ws_connecting state=1
2020-08-21 19:13:14.410 [TCE:INFO] Connecting to INFOS: wss://lns.eu.thethings.network:443
2020-08-21 19:13:14.451 [AIO:XDEB] [3] ws_connecting state=1
2020-08-21 19:13:14.455 [AIO:XDEB] [3] ws_connecting state=1
2020-08-21 19:13:15.246 [AIO:XDEB] [3] ws_connecting state=1
2020-08-21 19:13:15.250 [AIO:XDEB] [3] ws_connecting state=2
2020-08-21 19:13:15.294 [AIO:XDEB] [3] ws_connecting state=3
2020-08-21 19:13:15.295 [AIO:XDEB] [3|WS] > {"router":"24b:8ff:fe06:5f0"}
2020-08-21 19:13:15.341 [AIO:XDEB] [3|WS] < {"router":"24b:8ff:fe06:5f0","muxs":"muxs-::0","uri":"wss://lns.eu.thethings.network:443/traffic/eui-024B08FFFE0605F0"}
2020-08-21 19:13:15.341 [TCE:INFO] Infos: 24b:8ff:fe06:5f0 muxs-::0 wss://lns.eu.thethings.network:443/traffic/eui-024B08FFFE0605F0
2020-08-21 19:13:15.341 [AIO:DEBU] [3] ws_close reason=1000
2020-08-21 19:13:15.342 [AIO:ERRO] Recv failed: SSL - The peer notified us that the connection is going to be closed
2020-08-21 19:13:15.342 [AIO:DEBU] [3] WS connection shutdown...
2020-08-21 19:13:15.345 [any:INFO] /root/tc.trust:
cert. version     : 3
serial number     : 0A:01:41:42:00:00:01:53:85:73:6A:0B:85:EC:A7:08
issuer name       : O=Digital Signature Trust Co., CN=DST Root CA X3
subject name      : C=US, O=Let's Encrypt, CN=Let's Encrypt Authority X3
issued  on        : 2016-03-17 16:40:46
expires on        : 2021-03-17 16:40:46
signed using      : RSA with SHA-256
RSA key size      : 2048 bits
basic constraints : CA=true, max_pathlen=0
key usage         : Digital Signature2020-08-21 19:13:15.346 [AIO:INFO] tc has no key+cert configured - running server auth only
2020-08-21 19:13:15.404 [AIO:XDEB] [3] ws_connecting state=1
2020-08-21 19:13:15.406 [TCE:VERB] Connecting to MUXS...
2020-08-21 19:13:15.453 [AIO:XDEB] [3] ws_connecting state=1
2020-08-21 19:13:16.236 [AIO:XDEB] [3] ws_connecting state=1
2020-08-21 19:13:16.239 [AIO:XDEB] [3] ws_connecting state=2
2020-08-21 19:13:16.275 [AIO:XDEB] [3] ws_connecting state=3
2020-08-21 19:13:16.276 [TCE:VERB] Connected to MUXS.
2020-08-21 19:13:16.276 [AIO:XDEB] [3|WS] > {"msgtype":"version","station":"2.0.5(kerlink/std)","firmware":null,"package":null,"model":"kerlink","protocol":2,"features":"rmtsh"}
2020-08-21 19:13:16.325 [AIO:XDEB] [3|WS] < {"msgtype":"router_config","NetID":null,"JoinEui":null,"region":"EU863","hwspec":"sx1301/1","freq_range":[863000000,870000000],"DRs":[[12,125,0],[11,125,0],[10,125,0],[9,125,0],[8,125,0],[7,125,0],[7,250,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],"sx1301_conf":[{"lorawan_public":true,"clksrc":1,"antenna_gain":0,"radio_0":{"enable":true,"freq":867500000,"rssi_offset":-166,"tx_enable":true},"radio_1":{"enable":true,"freq":86850
2020-08-21 19:13:16.325 [AIO:XDEB] [3|WS] . 0000,"rssi_offset":-166,"tx_enable":false},"chan_multiSF_0":{"enable":true,"radio":1,"if":-400000},"chan_multiSF_1":{"enable":true,"radio":1,"if":-200000},"chan_multiSF_2":{"enable":true,"radio":1,"if":0},"chan_multiSF_3":{"enable":true,"radio":0,"if":-400000},"chan_multiSF_4":{"enable":true,"radio":0,"if":-200000},"chan_multiSF_5":{"enable":true,"radio":0,"if":0},"chan_multiSF_6":{"enable":true,"radio":0,"if":200000},"chan_multiSF_7":{"enable":true,"radio":
2020-08-21 19:13:16.325 [AIO:XDEB] [3|WS] . 0,"if":400000},"chan_Lora_std":{"enable":true,"radio":1,"if":-200000,"bandwidth":250000,"spread_factor":7},"chan_FSK":{"enable":true,"radio":1,"if":300000,"bandwidth":125000,"datarate":50000}}],"nocca":true,"nodc":true,"nodwell":true,"MuxTime":1598037196.3065543}
2020-08-21 19:13:16.307 [RAL:WARN] Ignoring unsupported/unknown field: antenna_gain
2020-08-21 19:13:16.308 [RAL:INFO] Lora gateway library version: Version: 5.0.1;
2020-08-21 19:13:16.327 [RAL:VERB] Connecting to device: /dev/spidev0.0
2020-08-21 19:13:16.327 [RAL:DEBU] SX130x txlut table (0 entries)
2020-08-21 19:13:16.327 [RAL:VERB] SX1301 rxrfchain 0: enable=1 freq=867.5MHz rssi_offset=-166.000000 type=2 tx_enable=1 tx_notch_freq=0
2020-08-21 19:13:16.328 [RAL:VERB] SX1301 rxrfchain 1: enable=1 freq=868.5MHz rssi_offset=-166.000000 type=2 tx_enable=0 tx_notch_freq=0
2020-08-21 19:13:16.328 [RAL:VERB] SX1301 ifchain  0: enable=1 rf_chain=1 freq=-400000 bandwidth=0 datarate=0 sync_word=0/0
2020-08-21 19:13:16.328 [RAL:VERB] SX1301 ifchain  1: enable=1 rf_chain=1 freq=-200000 bandwidth=0 datarate=0 sync_word=0/0
2020-08-21 19:13:16.328 [RAL:VERB] SX1301 ifchain  2: enable=1 rf_chain=1 freq=0 bandwidth=0 datarate=0 sync_word=0/0
2020-08-21 19:13:16.328 [RAL:VERB] SX1301 ifchain  3: enable=1 rf_chain=0 freq=-400000 bandwidth=0 datarate=0 sync_word=0/0
2020-08-21 19:13:16.329 [RAL:VERB] SX1301 ifchain  4: enable=1 rf_chain=0 freq=-200000 bandwidth=0 datarate=0 sync_word=0/0
2020-08-21 19:13:16.329 [RAL:VERB] SX1301 ifchain  5: enable=1 rf_chain=0 freq=0 bandwidth=0 datarate=0 sync_word=0/0
2020-08-21 19:13:16.329 [RAL:VERB] SX1301 ifchain  6: enable=1 rf_chain=0 freq=200000 bandwidth=0 datarate=0 sync_word=0/0
2020-08-21 19:13:16.329 [RAL:VERB] SX1301 ifchain  7: enable=1 rf_chain=0 freq=400000 bandwidth=0 datarate=0 sync_word=0/0
2020-08-21 19:13:16.329 [RAL:VERB] SX1301 ifchain  8: enable=1 rf_chain=1 freq=-200000 bandwidth=2 datarate=2 sync_word=0/0
2020-08-21 19:13:16.330 [RAL:VERB] SX1301 ifchain  9: enable=1 rf_chain=1 freq=300000 bandwidth=3 datarate=50000 sync_word=0/0
2020-08-21 19:13:16.330 [RAL:VERB] SX130x LBT not enabled
2020-08-21 19:13:16.330 [RAL:VERB] Station device: /dev/spidev0.0 (PPS capture disabled)
2020-08-21 19:13:16.335 [RAL:ERRO] Concentrator start failed: lgw_start
2020-08-21 19:13:16.335 [RAL:ERRO] ral_config failed with status 0x08
2020-08-21 19:13:16.335 [any:ERRO] Closing connection to muxs - error in s2e_onMsg
2020-08-21 19:13:16.336 [AIO:DEBU] [3] ws_close reason=1000
2020-08-21 19:13:16.336 [AIO:XDEB] [3] ws_closing_w state=5
2020-08-21 19:13:16.336 [AIO:DEBU] Echoing close - reason=1000
2020-08-21 19:13:16.370 [AIO:DEBU] [3|WS] Server sent close: reason=1000
2020-08-21 19:13:16.370 [AIO:DEBU] [3] WS connection shutdown...
2020-08-21 19:13:16.374 [TCE:VERB] Connection to MUXS closed in state -1
2020-08-21 19:13:16.374 [TCE:INFO] INFOS reconnect backoff 10s (retry 1)

I need to check what is the next step, but this is a step further!

Best regards,

Ron

Looking good possibly the concentrator is not being reset properly.

Good old SX1301 and its quirks.

There must be some reset script around which you need to run before starting station

Gents,

This starts to look promising, although I do not see the received packets in my TTN Console for this specific gateway yet:

2020-08-21 21:13:04.232 [TCE:VERB] Connecting to MUXS...
2020-08-21 21:13:04.296 [AIO:XDEB] [4] ws_connecting state=1
2020-08-21 21:13:04.298 [AIO:XDEB] [4] ws_connecting state=1
2020-08-21 21:13:05.041 [AIO:XDEB] [4] ws_connecting state=1
2020-08-21 21:13:05.044 [AIO:XDEB] [4] ws_connecting state=2
2020-08-21 21:13:05.087 [AIO:XDEB] [4] ws_connecting state=3
2020-08-21 21:13:05.087 [TCE:VERB] Connected to MUXS.
2020-08-21 21:13:05.088 [AIO:XDEB] [4|WS] > {"msgtype":"version","station":"2.0.5(kerlink/std)","firmware":null,"package":null,"model":"kerlink","protocol":2,"features":"rmtsh"}
2020-08-21 21:13:05.131 [AIO:XDEB] [4|WS] < {"msgtype":"router_config","NetID":null,"JoinEui":null,"region":"EU863","hwspec":"sx1301/1","freq_range":[863000000,870000000],"DRs":[[12,125,0],[11,125,0],[10,125,0],[9,125,0],[8,125,0],[7,125,0],[7,250,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],"sx1301_conf":[{"lorawan_public":true,"clksrc":1,"antenna_gain":0,"radio_0":{"enable":true,"freq":867500000,"rssi_offset":-166,"tx_enable":true},"radio_1":{"enable":true,"freq":86850
2020-08-21 21:13:05.131 [AIO:XDEB] [4|WS] . 0000,"rssi_offset":-166,"tx_enable":false},"chan_multiSF_0":{"enable":true,"radio":1,"if":-400000},"chan_multiSF_1":{"enable":true,"radio":1,"if":-200000},"chan_multiSF_2":{"enable":true,"radio":1,"if":0},"chan_multiSF_3":{"enable":true,"radio":0,"if":-400000},"chan_multiSF_4":{"enable":true,"radio":0,"if":-200000},"chan_multiSF_5":{"enable":true,"radio":0,"if":0},"chan_multiSF_6":{"enable":true,"radio":0,"if":200000},"chan_multiSF_7":{"enable":true,"radio":
2020-08-21 21:13:05.131 [AIO:XDEB] [4|WS] . 0,"if":400000},"chan_Lora_std":{"enable":true,"radio":1,"if":-200000,"bandwidth":250000,"spread_factor":7},"chan_FSK":{"enable":true,"radio":1,"if":300000,"bandwidth":125000,"datarate":50000}}],"nocca":true,"nodc":true,"nodwell":true,"MuxTime":1598044385.111531}
2020-08-21 21:13:05.112 [RAL:WARN] Ignoring unsupported/unknown field: antenna_gain
2020-08-21 21:13:05.114 [RAL:INFO] Lora gateway library version: Version: 5.0.1;
2020-08-21 21:13:05.144 [RAL:VERB] Connecting to device: /dev/spidev32766.0
2020-08-21 21:13:05.144 [RAL:DEBU] SX130x txlut table (0 entries)
2020-08-21 21:13:05.144 [RAL:VERB] SX1301 rxrfchain 0: enable=1 freq=867.5MHz rssi_offset=-166.000000 type=2 tx_enable=1 tx_notch_freq=0
2020-08-21 21:13:05.144 [RAL:VERB] SX1301 rxrfchain 1: enable=1 freq=868.5MHz rssi_offset=-166.000000 type=2 tx_enable=0 tx_notch_freq=0
2020-08-21 21:13:05.145 [RAL:VERB] SX1301 ifchain  0: enable=1 rf_chain=1 freq=-400000 bandwidth=0 datarate=0 sync_word=0/0
2020-08-21 21:13:05.145 [RAL:VERB] SX1301 ifchain  1: enable=1 rf_chain=1 freq=-200000 bandwidth=0 datarate=0 sync_word=0/0
2020-08-21 21:13:05.145 [RAL:VERB] SX1301 ifchain  2: enable=1 rf_chain=1 freq=0 bandwidth=0 datarate=0 sync_word=0/0
2020-08-21 21:13:05.145 [RAL:VERB] SX1301 ifchain  3: enable=1 rf_chain=0 freq=-400000 bandwidth=0 datarate=0 sync_word=0/0
2020-08-21 21:13:05.166 [RAL:VERB] SX1301 ifchain  4: enable=1 rf_chain=0 freq=-200000 bandwidth=0 datarate=0 sync_word=0/0
2020-08-21 21:13:05.166 [RAL:VERB] SX1301 ifchain  5: enable=1 rf_chain=0 freq=0 bandwidth=0 datarate=0 sync_word=0/0
2020-08-21 21:13:05.166 [RAL:VERB] SX1301 ifchain  6: enable=1 rf_chain=0 freq=200000 bandwidth=0 datarate=0 sync_word=0/0
2020-08-21 21:13:05.166 [RAL:VERB] SX1301 ifchain  7: enable=1 rf_chain=0 freq=400000 bandwidth=0 datarate=0 sync_word=0/0
2020-08-21 21:13:05.166 [RAL:VERB] SX1301 ifchain  8: enable=1 rf_chain=1 freq=-200000 bandwidth=2 datarate=2 sync_word=0/0
2020-08-21 21:13:05.166 [RAL:VERB] SX1301 ifchain  9: enable=1 rf_chain=1 freq=300000 bandwidth=3 datarate=50000 sync_word=0/0
2020-08-21 21:13:05.167 [RAL:VERB] SX130x LBT not enabled
2020-08-21 21:13:05.167 [RAL:VERB] Station device: /dev/spidev32766.0 (PPS capture disabled)
2020-08-21 21:13:08.087 [RAL:VERB] Concentrator started (2s919ms)
2020-08-21 21:13:08.087 [S2E:INFO] Configuring for region: EU863 -- 863.0MHz..870.0MHz
2020-08-21 21:13:08.088 [S2E:VERB]   DR0  SF12/BW125
2020-08-21 21:13:08.088 [S2E:VERB]   DR1  SF11/BW125
2020-08-21 21:13:08.088 [S2E:VERB]   DR2  SF10/BW125
2020-08-21 21:13:08.088 [S2E:VERB]   DR3  SF9/BW125
2020-08-21 21:13:08.088 [S2E:VERB]   DR4  SF8/BW125
2020-08-21 21:13:08.088 [S2E:VERB]   DR5  SF7/BW125
2020-08-21 21:13:08.088 [S2E:VERB]   DR6  SF7/BW250
2020-08-21 21:13:08.088 [S2E:VERB]   DR7  FSK
2020-08-21 21:13:08.089 [S2E:VERB]   DR8  FSK
2020-08-21 21:13:08.089 [S2E:VERB]   DR9  FSK
2020-08-21 21:13:08.089 [S2E:VERB]   DR10 FSK
2020-08-21 21:13:08.089 [S2E:VERB]   DR11 FSK
2020-08-21 21:13:08.089 [S2E:VERB]   DR12 FSK
2020-08-21 21:13:08.089 [S2E:VERB]   DR13 FSK
2020-08-21 21:13:08.089 [S2E:VERB]   DR14 FSK
2020-08-21 21:13:08.089 [S2E:VERB]   DR15 FSK
2020-08-21 21:13:08.089 [S2E:VERB]   TX power: 16.0 dBm EIRP
2020-08-21 21:13:08.090 [S2E:VERB]             27.0 dBm EIRP for 869.4MHz..869.65MHz
2020-08-21 21:13:08.090 [S2E:VERB]   JoinEui list: 0 entries
2020-08-21 21:13:08.090 [S2E:VERB]   NetID filter: FFFFFFFF-FFFFFFFF-FFFFFFFF-FFFFFFFF
2020-08-21 21:13:08.090 [S2E:VERB]   Dev/test settings: nocca=1 nodc=1 nodwell=1
2020-08-21 21:13:19.478 [any:XDEB] RX mod=LORA f=867500000 bw=125 sz=255 dr=8 737E07FC7E73E4E1805F636912F6B1D7373985775B87B0B557AEB298D35CE119B3D8FF6163A13E7922E33D0406997BCDD20D74387E280B29D977B77854ED48CE77021D8AF166B09160DEC07A2BAB0A03A92AB88EBDA378649F731B97E428A208756C5AF4F9A23D00392B9F3891D174CC197C4ABF6C4FD8E8904637A528E3BFD9B84C3D3563ABE859C2C7C82D2891E7AE5AAAE1EFBFC9DC7D28C39D41ECDBA09FF60B81072028BA30733CDAAB4CA2FA84CC8B949D64C24BE49CE4D0A2B18037BC187AAC3A9315028A520FAB39486CB2EFA8F5AD4BD139363D82020-08-21 21:13:19.479 [any:XDEB] Dropped frame without CRC or with broken CRC
2020-08-21 21:13:21.210 [any:XDEB] RX mod=LORA f=867900000 bw=125 sz=16 dr=2 807FF11A00800D0001DFD7A397B825CA
2020-08-21 21:13:21.210 [S2E:VERB] RX 867.9MHz DR5 SF7/BW125 snr=7.0 rssi=-108 xtime=0x38000000EC9534 - updf mhdr=80 DevAddr=001AF17F FCtrl=80 FCnt=13 FOpts=[] 01DFD7A3 mic=-903497577 (16 bytes)
2020-08-21 21:13:21.211 [AIO:XDEB] [4|WS] > {"msgtype":"updf","MHdr":128,"DevAddr":1765759,"FCtrl":128,"FCnt":13,"FOpts":"","FPort":1,"FRMPayload":"DFD7A3","MIC":-903497577,"RefTime":1598044401.211339,"DR":5,"Freq":867900000,"upinfo":{"rctx":0,"xtime":15762598711301428,"gpstime":0,"fts":-1,"rssi":-108,"snr":7,"rxtime":1598044401.211364}}
2020-08-21 21:13:21.374 [any:XDEB] RX mod=LORA f=868100000 bw=125 sz=16 dr=64 8056E71A00800100013E754A31409567
2020-08-21 21:13:21.375 [S2E:VERB] RX 868.1MHz DR0 SF12/BW125 snr=-9.5 rssi=-118 xtime=0x38000000EEA2DC - updf mhdr=80 DevAddr=001AE756 FCtrl=80 FCnt=1 FOpts=[] 013E754A mic=1737834545 (16 bytes)
2020-08-21 21:13:21.376 [AIO:XDEB] [4|WS] > {"msgtype":"updf","MHdr":128,"DevAddr":1763158,"FCtrl":128,"FCnt":1,"FOpts":"","FPort":1,"FRMPayload":"3E754A","MIC":1737834545,"RefTime":1598044401.376009,"DR":0,"Freq":868100000,"upinfo":{"rctx":0,"xtime":15762598711435996,"gpstime":0,"fts":-1,"rssi":-118,"snr":-9.5,"rxtime":1598044401.376036}}
2020-08-21 21:13:23.270 [any:XDEB] RX mod=LORA f=868100000 bw=125 sz=16 dr=64 8031E81A008001000100428A2EFFCB1C
2020-08-21 21:13:23.270 [S2E:VERB] RX 868.1MHz DR0 SF12/BW125 snr=9.0 rssi=-99 xtime=0x380000010B97AC - updf mhdr=80 DevAddr=001AE831 FCtrl=80 FCnt=1 FOpts=[] 0100428A mic=483131182 (16 bytes)
2020-08-21 21:13:23.271 [AIO:XDEB] [4|WS] > {"msgtype":"updf","MHdr":128,"DevAddr":1763377,"FCtrl":128,"FCnt":1,"FOpts":"","FPort":1,"FRMPayload":"00428A","MIC":483131182,"RefTime":1598044403.271455,"DR":0,"Freq":868100000,"upinfo":{"rctx":0,"xtime":15762598713333676,"gpstime":0,"fts":-1,"rssi":-99,"snr":9,"rxtime":1598044403.271484}}
2020-08-21 21:13:27.611 [any:XDEB] RX mod=LORA f=867300000 bw=125 sz=30 dr=2 80778FD50082801503070533F451999DABCD414A24672EC095F1B1E1839E
1 Like

Don’t trust TTN Console’s gateway Traffic page if you don’t see anything. What about the application’s or device’s Data page? Or better yet: MQTT, or the HTTP Integration?

Thanks you all guys, it looks like it’s spinning now !

I needed to adopt the following two lines in my config:

"routerid": "0000:024b:0806:05f0",
"euiprefix": "0000",

to have it exactly the same as with the UDP packet forwarder. Packets are correctly passed to the applications, and also the console status is ‘connected’ and traffic is visible in the console.

So far happy with the result, and will further test this on some other gateways next week…

Ron

Hi All,

I trying to migrate one of these Kerlink Wirnet stations using the basic station, from TTN v2 to v3.

After downloading the isrg root certificate (tcx.trust), and changing the URL in tc.uri into :
wss://eu1.cloud.thethings.network:8887
the gateway does not register.

I keep getting this error :

2021-01-30 19:21:51.524 [AIO:ERRO] [3] WS upgrade failed with HTTP status code: 401
2021-01-30 19:21:51.526 [TCE:INFO] INFOS reconnect backoff 10s (retry 1)

I found some similar reported issues, but not yet resolved.

Am I doing something wrong? Below a demo of the program start, combined with tcpdump:

[root@Wirnet_XXXXXX ~]# /usr/bin/station --home=/root

2021-01-30 19:32:39.785 [SYS:INFO] Logging : stderr (maxsize=10485760, rotate=3)
2021-01-30 19:32:39.787 [SYS:INFO] Station Ver : 2.0.5(kerlink/std) 2020-08-20 20:14:28
2021-01-30 19:32:39.790 [SYS:INFO] Package Ver : (null)
2021-01-30 19:32:39.792 [SYS:INFO] proto EUI : 0:XXXXXX (station.conf)
2021-01-30 19:32:39.793 [SYS:INFO] prefix EUI : ::0 (station.conf)
2021-01-30 19:32:39.793 [SYS:INFO] Station EUI : 0:XXXXXX
2021-01-30 19:32:39.793 [SYS:INFO] Station home: /root/ (–home)
2021-01-30 19:32:39.793 [SYS:INFO] Station temp: /var/tmp/ (builtin)
2021-01-30 19:32:39.793 [SYS:WARN] Station in NO-CUPS mode
19:32:40.038736 IP 192.168.1.86.48968 > 52.212.223.226.8887: Flags [S], seq 2047597429, win 14600, options [mss 1460,nop,nop,sackOK,nop,wscale 4], length 0
19:32:40.060027 IP 52.212.223.226.8887 > 192.168.1.86.48968: Flags [S.], seq 886814081, ack 2047597430, win 26883, options [mss 1460,nop,nop,sackOK,nop,wscale 12], length 0
19:32:40.060577 IP 192.168.1.86.48968 > 52.212.223.226.8887: Flags [.], ack 1, win 913, length 0
19:32:40.067294 IP 192.168.1.86.48968 > 52.212.223.226.8887: Flags [P.], seq 1:421, ack 1, win 913, length 420
19:32:40.087962 IP 52.212.223.226.8887 > 192.168.1.86.48968: Flags [.], ack 421, win 7, length 0
19:32:40.088347 IP 52.212.223.226.8887 > 192.168.1.86.48968: Flags [P.], seq 1:101, ack 421, win 7, length 100
19:32:40.088733 IP 192.168.1.86.48968 > 52.212.223.226.8887: Flags [.], ack 101, win 913, length 0
19:32:40.088889 IP 52.212.223.226.8887 > 192.168.1.86.48968: Flags [.], seq 101:1561, ack 421, win 7, length 1460
19:32:40.089289 IP 192.168.1.86.48968 > 52.212.223.226.8887: Flags [.], ack 1561, win 1095, length 0
19:32:40.089428 IP 52.212.223.226.8887 > 192.168.1.86.48968: Flags [.], seq 1561:3021, ack 421, win 7, length 1460
19:32:40.089844 IP 192.168.1.86.48968 > 52.212.223.226.8887: Flags [.], ack 3021, win 1278, length 0
19:32:40.433851 IP 192.168.1.86.48968 > 52.212.223.226.8887: Flags [P.], seq 421:496, ack 4521, win 1643, length 75
2021-01-30 19:32:39.996 [TCE:INFO] Starting TC engine
2021-01-30 19:32:40.014 [any:INFO] /root/tc.trust:
cert. version : 3
serial number : 82:10:CF:B0:D2:40:E3:59:44:63:E0:BB:63:82:8B:00
issuer name : C=US, O=Internet Security Research Group, CN=ISRG Root X1
subject name : C=US, O=Internet Security Research Group, CN=ISRG Root X1
issued on : 2015-06-04 11:04:38
expires on : 2035-06-04 11:04:38
signed using : RSA with SHA-256
RSA key size : 4096 bits
basic constraints : CA=true
key usage : Key Cert Sign, CRL2021-01-30 19:32:40.015 [AIO:INFO] tc has no key+cert configured - running server auth only
2021-01-30 19:32:40.070 [TCE:INFO] Connecting to INFOS: wss://eu1.cloud.thethings.network:8887
19:32:40.454293 IP 52.212.223.226.8887 > 192.168.1.86.48968: Flags [.], ack 496, win 7, length 0
19:32:40.454731 IP 192.168.1.86.48968 > 52.212.223.226.8887: Flags [P.], seq 496:547, ack 4521, win 1643, length 51
19:32:40.475108 IP 52.212.223.226.8887 > 192.168.1.86.48968: Flags [.], ack 547, win 7, length 0
19:32:40.475447 IP 52.212.223.226.8887 > 192.168.1.86.48968: Flags [P.], seq 4521:4640, ack 547, win 7, length 119
19:32:40.475826 IP 192.168.1.86.48968 > 52.212.223.226.8887: Flags [.], ack 4640, win 1643, length 0
19:32:40.475969 IP 52.212.223.226.8887 > 192.168.1.86.48968: Flags [P.], seq 4640:4691, ack 547, win 7, length 51
19:32:40.476344 IP 192.168.1.86.48968 > 52.212.223.226.8887: Flags [.], ack 4691, win 1643, length 0
19:32:40.486511 IP 192.168.1.86.48968 > 52.212.223.226.8887: Flags [P.], seq 547:758, ack 4691, win 1643, length 211
19:32:40.507406 IP 52.212.223.226.8887 > 192.168.1.86.48968: Flags [P.], seq 4691:4849, ack 758, win 8, length 158
19:32:40.508960 IP 192.168.1.86.48968 > 52.212.223.226.8887: Flags [P.], seq 758:819, ack 4849, win 1825, length 61
19:32:40.536344 IP 52.212.223.226.8887 > 192.168.1.86.48968: Flags [P.], seq 4849:4998, ack 819, win 8, length 149
19:32:40.536705 IP 52.212.223.226.8887 > 192.168.1.86.48968: Flags [P.], seq 4998:5029, ack 819, win 8, length 31
19:32:40.543178 IP 192.168.1.86.48968 > 52.212.223.226.8887: Flags [.], ack 5029, win 2008, length 0
19:32:40.543965 IP 192.168.1.86.48968 > 52.212.223.226.8887: Flags [F.], seq 819, ack 5029, win 2008, length 0
19:32:40.552027 IP 192.168.1.86.43014 > 63.34.215.128.8887: Flags [S], seq 1939885378, win 14600, options [mss 1460,nop,nop,sackOK,nop,wscale 4], length 0
19:32:40.564714 IP 52.212.223.226.8887 > 192.168.1.86.48968: Flags [F.], seq 5029, ack 820, win 8, length 0
19:32:40.565164 IP 192.168.1.86.48968 > 52.212.223.226.8887: Flags [.], ack 5030, win 2008, length 0
19:32:40.572348 IP 63.34.215.128.8887 > 192.168.1.86.43014: Flags [S.], seq 2549848218, ack 1939885379, win 26883, options [mss 1460,nop,nop,sackOK,nop,wscale 12], length 0
19:32:40.572862 IP 192.168.1.86.43014 > 63.34.215.128.8887: Flags [.], ack 1, win 913, length 0
19:32:40.576615 IP 192.168.1.86.43014 > 63.34.215.128.8887: Flags [P.], seq 1:421, ack 1, win 913, length 420
19:32:40.596242 IP 63.34.215.128.8887 > 192.168.1.86.43014: Flags [.], ack 421, win 7, length 0
19:32:40.596590 IP 63.34.215.128.8887 > 192.168.1.86.43014: Flags [P.], seq 1:101, ack 421, win 7, length 100
19:32:40.596962 IP 192.168.1.86.43014 > 63.34.215.128.8887: Flags [.], ack 101, win 913, length 0
19:32:40.597114 IP 63.34.215.128.8887 > 192.168.1.86.43014: Flags [.], seq 101:1561, ack 421, win 7, length 1460
19:32:40.597510 IP 192.168.1.86.43014 > 63.34.215.128.8887: Flags [.], ack 1561, win 1095, length 0
19:32:40.597647 IP 63.34.215.128.8887 > 192.168.1.86.43014: Flags [.], seq 1561:3021, ack 421, win 7, length 1460
19:32:40.598065 IP 192.168.1.86.43014 > 63.34.215.128.8887: Flags [.], ack 3021, win 1278, length 0
19:32:40.925474 IP 192.168.1.86.43014 > 63.34.215.128.8887: Flags [P.], seq 421:496, ack 4521, win 1643, length 75
2021-01-30 19:32:40.542 [TCE:INFO] Infos: XXXXXX muxs-::0 wss://eu1.cloud.thethings.network:8887/traffic/eui-0000024BXXXXXX
2021-01-30 19:32:40.543 [AIO:ERRO] Recv failed: SSL - The peer notified us that the connection is going to be closed
2021-01-30 19:32:40.546 [any:INFO] /root/tc.trust:
cert. version : 3
serial number : 82:10:CF:B0:D2:40:E3:59:44:63:E0:BB:63:82:8B:00
issuer name : C=US, O=Internet Security Research Group, CN=ISRG Root X1
subject name : C=US, O=Internet Security Research Group, CN=ISRG Root X1
issued on : 2015-06-04 11:04:38
expires on : 2035-06-04 11:04:38
signed using : RSA with SHA-256
RSA key size : 4096 bits
basic constraints : CA=true
key usage : Key Cert Sign, CRL2021-01-30 19:32:40.546 [AIO:INFO] tc has no key+cert configured - running server auth only
19:32:40.944881 IP 63.34.215.128.8887 > 192.168.1.86.43014: Flags [.], ack 496, win 7, length 0
19:32:40.945358 IP 192.168.1.86.43014 > 63.34.215.128.8887: Flags [P.], seq 496:547, ack 4521, win 1643, length 51
19:32:40.964683 IP 63.34.215.128.8887 > 192.168.1.86.43014: Flags [.], ack 547, win 7, length 0
19:32:40.965057 IP 63.34.215.128.8887 > 192.168.1.86.43014: Flags [P.], seq 4521:4640, ack 547, win 7, length 119
19:32:40.965442 IP 192.168.1.86.43014 > 63.34.215.128.8887: Flags [.], ack 4640, win 1643, length 0
19:32:40.965585 IP 63.34.215.128.8887 > 192.168.1.86.43014: Flags [P.], seq 4640:4691, ack 547, win 7, length 51
19:32:40.965961 IP 192.168.1.86.43014 > 63.34.215.128.8887: Flags [.], ack 4691, win 1643, length 0
19:32:40.968001 IP 192.168.1.86.43014 > 63.34.215.128.8887: Flags [P.], seq 547:775, ack 4691, win 1643, length 228
19:32:40.995690 IP 63.34.215.128.8887 > 192.168.1.86.43014: Flags [P.], seq 4691:5003, ack 775, win 8, length 312
19:32:40.997131 IP 192.168.1.86.43014 > 63.34.215.128.8887: Flags [F.], seq 775, ack 5003, win 1825, length 0
19:32:41.016663 IP 63.34.215.128.8887 > 192.168.1.86.43014: Flags [P.], seq 5003:5034, ack 776, win 8, length 31
19:32:41.017186 IP 192.168.1.86.43014 > 63.34.215.128.8887: Flags [R], seq 1939886154, win 0, length 0
19:32:41.017326 IP 63.34.215.128.8887 > 192.168.1.86.43014: Flags [F.], seq 5034, ack 776, win 8, length 0
19:32:41.017734 IP 192.168.1.86.43014 > 63.34.215.128.8887: Flags [R], seq 1939886154, win 0, length 0
2021-01-30 19:32:40.996 [AIO:ERRO] [3] WS upgrade failed with HTTP status code: 401
2021-01-30 19:32:40.998 [TCE:INFO] INFOS reconnect backoff 10s (retry 1)

I got things more progressed, by using a API key on the gateway, which was not required in V2.

In the new V3 console created a API key (and safe stored it), and from this created a tc.key file and located this on the gateway.

1 Like

Many will need this transition over time.

1 Like

See How to format your forum post?