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
AQ8AMIIBCgKCAQEAnNMM8FrlLke3cl03g7NoYzD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fklxBwXRsW10KXzPMTZ+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