LoRa Basics™ Station 2.0.5 documentation

Quick Start

The following is a three-step Quick-Start guide for building and running a LoRa Basics™ Station on the target platform itself.

Step 1: Clone the Station Repository

git clone https://github.com/lorabasics/basicstation.git

For Corcell Platfrom (Raspberry Pi as HOST + SX1302CxxxGW1 Concentrator)

Note: Check the SPI device for the radio, as shown in example/corecell/lns-ttn/station.conf.

The example configuration connects to a TTN LNS server, lns.us.thethings.network, through which the Station fetches all required credentials, as well as a channel plan matching your region (as determined by LNS. Provided there are active LoRa devices in proximity, received LoRa frames are printed in the log output on stderr.

The invocation output is shown below.

Using variant=debug, lns_config='./lns-ttn'
 Starting Station ...
2020-05-26 17:42:24.638 [SYS:INFO] Logging     : stderr (maxsize=10000000, rotate=3)
2020-05-26 17:42:24.638 [SYS:INFO] Station Ver : 2.0.4(corecell/debug) 2020-05-11 18:10:12
2020-05-26 17:42:24.638 [SYS:INFO] Package Ver : 2.0.4
2020-05-26 17:42:24.639 [SYS:INFO] proto EUI   : 0:b827:eb04:ea40       (/sys/class/net/eth0/address)
2020-05-26 17:42:24.639 [SYS:INFO] prefix EUI  : ::1    (builtin)
2020-05-26 17:42:24.639 [SYS:INFO] Station EUI : b827:ebff:fe04:ea40
2020-05-26 17:42:24.639 [SYS:INFO] Station home: ./lns-ttn/     (--home)
2020-05-26 17:42:24.639 [SYS:INFO] Station temp: /var/tmp/      (builtin)
2020-05-26 17:42:24.639 [SYS:WARN] Station in NO-CUPS mode
2020-05-26 17:42:24.842 [TCE:INFO] Starting TC engine
2020-05-26 17:42:24.844 [any:INFO] ./lns-ttn/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 Signa2020-05-26 17:42:24.844 [AIO:INFO] tc has no key+cert configured - running server auth only
2020-05-26 17:42:24.897 [TCE:INFO] Connecting to INFOS: wss://lns.us.thethings.network:443
2020-05-26 17:42:25.272 [TCE:INFO] Infos: b827:ebff:fe04:ea40 muxs-::0 wss://lns.us.thethings.network:443/traffic/eui-B827EBFFFE04EA40
2020-05-26 17:42:25.272 [AIO:DEBU] [3] ws_close reason=1000
2020-05-26 17:42:25.272 [AIO:ERRO] Recv failed: SSL - The peer notified us that the connection is going to be closed
2020-05-26 17:42:25.272 [AIO:DEBU] [3] WS connection shutdown...
2020-05-26 17:42:25.273 [any:INFO] ./lns-ttn/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 Signa2020-05-26 17:42:25.273 [AIO:INFO] tc has no key+cert configured - running server auth only
2020-05-26 17:42:25.317 [TCE:VERB] Connecting to MUXS...
2020-05-26 17:42:25.621 [TCE:VERB] Connected to MUXS.
2020-05-26 17:42:25.653 [S2E:ERRO]
2020-05-26 17:42:25.629 [SYS:VERB] rinit.sh: Forked, waiting...
CoreCell reset through GPIO23...
CoreCell power enable through GPIO18...
2020-05-26 17:42:26.613 [SYS:INFO] Process rinit.sh (pid=1212) completed
ERROR: Failed to stop TX trigger
ERROR: Failed to stop TX trigger
ERROR: failed to close I2C device (err=-1)
2020-05-26 17:42:26.613 [RAL:INFO] Lora gateway library version: Version: 1.0.5;
2020-05-26 17:42:26.619 [RAL:VERB] Connecting to device: /dev/spidev0.0
2020-05-26 17:42:26.619 [RAL:DEBU] SX130x txlut table (16 entries)
2020-05-26 17:42:26.619 [RAL:VERB] SX1302 txlut  0:  rf_power=12 pa_gain=0 pwr_idx=15
2020-05-26 17:42:26.619 [RAL:VERB] SX1302 txlut  1:  rf_power=13 pa_gain=0 pwr_idx=16
2020-05-26 17:42:26.619 [RAL:VERB] SX1302 txlut  2:  rf_power=14 pa_gain=0 pwr_idx=17
2020-05-26 17:42:26.619 [RAL:VERB] SX1302 txlut  3:  rf_power=15 pa_gain=0 pwr_idx=19
2020-05-26 17:42:26.619 [RAL:VERB] SX1302 txlut  4:  rf_power=16 pa_gain=0 pwr_idx=20
2020-05-26 17:42:26.619 [RAL:VERB] SX1302 txlut  5:  rf_power=17 pa_gain=0 pwr_idx=22
2020-05-26 17:42:26.619 [RAL:VERB] SX1302 txlut  6:  rf_power=18 pa_gain=1 pwr_idx=1
2020-05-26 17:42:26.619 [RAL:VERB] SX1302 txlut  7:  rf_power=19 pa_gain=1 pwr_idx=2
2020-05-26 17:42:26.619 [RAL:VERB] SX1302 txlut  8:  rf_power=20 pa_gain=1 pwr_idx=3
2020-05-26 17:42:26.620 [RAL:VERB] SX1302 txlut  9:  rf_power=21 pa_gain=1 pwr_idx=4
2020-05-26 17:42:26.620 [RAL:VERB] SX1302 txlut 10:  rf_power=22 pa_gain=1 pwr_idx=5
2020-05-26 17:42:26.620 [RAL:VERB] SX1302 txlut 11:  rf_power=23 pa_gain=1 pwr_idx=6
2020-05-26 17:42:26.620 [RAL:VERB] SX1302 txlut 12:  rf_power=24 pa_gain=1 pwr_idx=7
2020-05-26 17:42:26.620 [RAL:VERB] SX1302 txlut 13:  rf_power=25 pa_gain=1 pwr_idx=9
2020-05-26 17:42:26.620 [RAL:VERB] SX1302 txlut 14:  rf_power=26 pa_gain=1 pwr_idx=11
2020-05-26 17:42:26.620 [RAL:VERB] SX1302 txlut 15:  rf_power=27 pa_gain=1 pwr_idx=14
2020-05-26 17:42:26.620 [RAL:VERB] SX1302 rssi_tcomp: coeff_a=0.000 coeff_b=0.000 coeff_c=20.410 coeff_d=2162.560 coeff_e=0.000
2020-05-26 17:42:26.620 [RAL:VERB] SX1302 rxrfchain 0: enable=1 freq=904.3MHz rssi_offset=-166.000000 type=5 tx_enable=1
2020-05-26 17:42:26.620 [RAL:VERB] SX1302 rxrfchain 1: enable=1 freq=905.0MHz rssi_offset=-166.000000 type=5 tx_enable=0
2020-05-26 17:42:26.620 [RAL:VERB] SX1302 ifchain  0: enable=1 rf_chain=0 freq=-400000 bw=0 SF=0 sync_word=0/0
2020-05-26 17:42:26.620 [RAL:VERB] SX1302 ifchain  1: enable=1 rf_chain=0 freq=-200000 bw=0 SF=0 sync_word=0/0
2020-05-26 17:42:26.620 [RAL:VERB] SX1302 ifchain  2: enable=1 rf_chain=0 freq=0 bw=0 SF=0 sync_word=0/0
2020-05-26 17:42:26.620 [RAL:VERB] SX1302 ifchain  3: enable=1 rf_chain=0 freq=200000 bw=0 SF=0 sync_word=0/0
2020-05-26 17:42:26.620 [RAL:VERB] SX1302 ifchain  4: enable=1 rf_chain=1 freq=-300000 bw=0 SF=0 sync_word=0/0
2020-05-26 17:42:26.620 [RAL:VERB] SX1302 ifchain  5: enable=1 rf_chain=1 freq=-100000 bw=0 SF=0 sync_word=0/0
2020-05-26 17:42:26.620 [RAL:VERB] SX1302 ifchain  6: enable=1 rf_chain=1 freq=100000 bw=0 SF=0 sync_word=0/0
2020-05-26 17:42:26.620 [RAL:VERB] SX1302 ifchain  7: enable=1 rf_chain=1 freq=300000 bw=0 SF=0 sync_word=0/0
2020-05-26 17:42:26.620 [RAL:VERB] SX1302 ifchain  8: enable=1 rf_chain=0 freq=300000 bw=6 SF=8 sync_word=0/0 [STD] Explicit header
2020-05-26 17:42:26.620 [RAL:VERB] SX1302 ifchain  9: enable=0 rf_chain=0 freq=0 bw=0 SF=0 sync_word=0/0
2020-05-26 17:42:26.620 [RAL:VERB] Station device: /dev/spidev0.0 (PPS capture disabled)
2020-05-26 17:42:29.008 [RAL:VERB] Concentrator started (2s387ms)
2020-05-26 17:42:29.008 [S2E:INFO] Configuring for region: US902 -- 923.0MHz..928.0MHz
2020-05-26 17:42:29.008 [S2E:VERB]   DR0  SF10/BW125
2020-05-26 17:42:29.008 [S2E:VERB]   DR1  SF9/BW125
2020-05-26 17:42:29.008 [S2E:VERB]   DR2  SF8/BW125
2020-05-26 17:42:29.008 [S2E:VERB]   DR3  SF7/BW125
2020-05-26 17:42:29.008 [S2E:VERB]   DR4  SF8/BW500
2020-05-26 17:42:29.008 [S2E:VERB]   DR5  FSK
2020-05-26 17:42:29.008 [S2E:VERB]   DR6  FSK
2020-05-26 17:42:29.008 [S2E:VERB]   DR7  FSK
2020-05-26 17:42:29.008 [S2E:VERB]   DR8  SF12/BW500
2020-05-26 17:42:29.008 [S2E:VERB]   DR9  SF11/BW500
2020-05-26 17:42:29.008 [S2E:VERB]   DR10 SF10/BW500
2020-05-26 17:42:29.008 [S2E:VERB]   DR11 SF9/BW500
2020-05-26 17:42:29.008 [S2E:VERB]   DR12 SF8/BW500
2020-05-26 17:42:29.008 [S2E:VERB]   DR13 SF7/BW500
2020-05-26 17:42:29.008 [S2E:VERB]   DR14 FSK
2020-05-26 17:42:29.008 [S2E:VERB]   DR15 FSK
2020-05-26 17:42:29.008 [S2E:VERB]   TX power: 30.0 dBm EIRP
2020-05-26 17:42:29.008 [S2E:VERB]   JoinEui list: 0 entries
2020-05-26 17:42:29.008 [S2E:VERB]   NetID filter: FFFFFFFF-FFFFFFFF-FFFFFFFF-FFFFFFFF
2020-05-26 17:42:29.008 [S2E:VERB]   Dev/test settings: nocca=1 nodc=1 nodwell=1
2020-05-26 17:42:29.799 [S2E:VERB] RX 904.5MHz DR3 SF7/BW125 snr=13.8 rssi=0 xtime=0x560000000E96B0 - updf mhdr=40 DevAddr=26022EB9 FCtrl=80 FCnt=532 FOpts=[] 665FDCF3..B6C7 mic=2031530568 (24 bytes)
2020-05-26 17:42:32.806 [S2E:VERB] RX 903.9MHz DR3 SF7/BW125 snr=13.8 rssi=0 xtime=0x560000003C7666 - updf mhdr=40 DevAddr=26022EB9 FCtrl=80 FCnt=533 FOpts=[] 66F7D4D7..3922 mic=-2031323186 (24 bytes)
2020-05-26 17:42:35.999 [S2E:VERB] RX 904.9MHz DR3 SF7/BW125 snr=13.0 rssi=0 xtime=0x560000006D299F - updf mhdr=40 DevAddr=26022EB9 FCtrl=80 FCnt=534 FOpts=[] 660876AC..1DDE mic=-2069238750 (24 bytes)
2020-05-26 17:42:39.958 [S2E:VERB] RX 905.3MHz DR3 SF7/BW125 snr=14.0 rssi=0 xtime=0x56000000A98948 - updf mhdr=40 DevAddr=26022EB9 FCtrl=80 FCnt=535 FOpts=[] 663A17E9..04DF mic=-469224351 (24 bytes)
2020-05-26 17:42:44.240 [S2E:VERB] RX 904.3MHz DR3 SF7/BW125 snr=10.0 rssi=0 xtime=0x56000000EAF80C - updf mhdr=40 DevAddr=26022EB9 FCtrl=80 FCnt=536 FOpts=[] 660AF913..1C31 mic=-1394099330 (24 bytes)
2020-05-26 17:42:48.596 [S2E:VERB] RX 905.1MHz DR3 SF7/BW125 snr=13.5 rssi=0 xtime=0x560000012D4F1E - updf mhdr=40 DevAddr=26022EB9 FCtrl=80 FCnt=537 FOpts=[] 66F7B162..1F5D mic=1524365778 (24 bytes)
2020-05-26 17:42:52.493 [S2E:VERB] RX 904.1MHz DR3 SF7/BW125 snr=13.5 rssi=0 xtime=0x5600000168D2BC - updf mhdr=40 DevAddr=26022EB9 FCtrl=80 FCnt=538 FOpts=[] 662B169A..2225 mic=1357337334 (24 bytes)
2020-05-26 17:42:56.026 [S2E:VERB] RX 904.7MHz DR3 SF7/BW125 snr=13.8 rssi=0 xtime=0x560000019EB03C - updf mhdr=40 DevAddr=26022EB9 FCtrl=80 FCnt=539 FOpts=[] 665D259F..C25A mic=-1409567253 (24 bytes)

For Raspberry Pi with an IMST shield and the v1.5 Concentrator

Step 2: Compile the Station Binary

cd basicstation
make platform=rpi variant=std

Step 3: Run the Example Configuration

cd examples/live-s2.sm.tc
RADIODEV=/dev/spidev0.0 ../../build-rpi-std/bin/station

Note: The SPI device for the radio may be passed as an environment variable using RADIODEV.

The example configuration connects to a public test server, s2.sm.tc, through which the Station fetches all required credentials, as well as a channel plan matching the region which is determined from the IP address of the gateway. Provided there are active LoRa devices in proximity, received LoRa frames are printed in the log output on stderr.

The output of the invocation on a Kerlink gateway is shown below. Note: For Kerlink, the RADIODEV environment variable is set to /dev/spidev32766.0 as the SPI device path.

[@Wirgrid_0b03044f live-s2.sm.tc]# RADIODEV=/dev/spidev32766.0 ./station
2018-11-09 10:25:49.004 [SYS:INFO] Logging     : stderr (maxsize=10000000, rotate=3)
2018-11-09 10:25:49.007 [SYS:INFO] Station Ver : TrackStation_2.0-484-g143c1fe(kerlink/std) 2018-11-08T15:24Z
2018-11-09 10:25:49.010 [SYS:INFO] Package Ver : 1.0.0
2018-11-09 10:25:49.012 [SYS:INFO] proto EUI   : 0:24b:b03:44f       (/sys/class/net/eth0/address)
2018-11-09 10:25:49.014 [SYS:INFO] prefix EUI  : ::1 (builtin)
2018-11-09 10:25:49.014 [SYS:INFO] Station EUI : 24b:bff:fe03:44f
2018-11-09 10:25:49.015 [SYS:INFO] Station home: ./  (builtin)
2018-11-09 10:25:49.015 [SYS:INFO] Station temp: /var/tmp/   (builtin)
2018-11-09 10:25:49.219 [TCE:INFO] Starting TC engine
2018-11-09 10:25:49.220 [TCE:ERRO] No TC URI configured
2018-11-09 10:25:49.221 [CUP:INFO] Starting a CUPS session
2018-11-09 10:25:49.221 [CUP:ERRO] No CUPS URI configured
2018-11-09 10:25:49.222 [TCE:INFO] INFOS reconnect backoff 0s (retry 0)
2018-11-09 10:25:49.224 [TCE:ERRO] No TC URI configured
2018-11-09 10:25:49.224 [TCE:INFO] INFOS reconnect backoff 10s (retry 1)
2018-11-09 10:25:50.222 [CUP:INFO] Starting a CUPS session
2018-11-09 10:25:50.223 [CUP:ERRO] No CUPS-bak URI configured
2018-11-09 10:25:51.223 [CUP:INFO] Starting a CUPS session
2018-11-09 10:25:51.224 [CUP:INFO] Connecting to CUPS-boot ... https://s2.sm.tc:7007 (try #3)
2018-11-09 10:25:51.251 [any:INFO] cert. version     : 1
serial number     : 0C
issuer name       : CN=Root CA, OU=TrackCentral (eiaPoUc9), O=TrackNet.io, C=CH
subject name      : CN=Root CA, OU=TrackCentral (eiaPoUc9), O=TrackNet.io, C=CH
issued  on        : 2018-11-08 12:42:00
expires on        : 2024-11-06 12:42:00
signed using      : ECDSA with SHA256
EC key size       : 256 bits
2018-11-09 10:25:51.329 [any:INFO] cert. version     : 3
serial number     : 10
issuer name       : CN=Root CA, OU=TrackCentral (eiaPoUc9), O=TrackNet.io, C=CH
subject name      : CN=gwprov-::0, OU=TrackCentral, O=TrackNet.io, C=CH
issued  on        : 2018-11-08 12:43:52
expires on        : 2020-11-07 12:43:52
signed using      : ECDSA with SHA256
RSA key size      : 2048 bits
2018-11-09 10:25:51.329 [AIO:INFO]
2018-11-09 10:25:51.391 [CUP:VERB] Retrieving update-info from CUPS-boot https://s2.sm.tc:7007...
2018-11-09 10:25:53.921 [CUP:INFO] CUPS URI updated: https://s2.sm.tc:7007
2018-11-09 10:25:53.925 [CUP:INFO] TC URI updated: wss://s2.sm.tc:7000
2018-11-09 10:25:53.925 [CUP:INFO] CUPS credentials segment (956 bytes)
2018-11-09 10:25:53.925 [any:INFO] credComplete - trust_off=   0, trust_len= 412            30 82 01 97  30 82 01 3c
2018-11-09 10:25:53.926 [any:INFO] credComplete - cert_off = 412, cert_len = 420  f4 e1 69 00  30 82 01 a0  30 82 01 46
2018-11-09 10:25:53.926 [any:INFO] credComplete - key_off  = 832, key_len  = 124  87 bc 92 de  30 77 02 01  01 04 20 9c
2018-11-09 10:25:53.937 [CUP:INFO] CUPS credentials updated (956 bytes)
2018-11-09 10:25:53.937 [CUP:INFO] TC credentials segment (956 bytes)
2018-11-09 10:25:53.937 [any:INFO] credComplete - trust_off=   0, trust_len= 412            30 82 01 97  30 82 01 3c
2018-11-09 10:25:53.937 [any:INFO] credComplete - cert_off = 412, cert_len = 420  f4 e1 69 00  30 82 01 a0  30 82 01 46
2018-11-09 10:25:53.938 [any:INFO] credComplete - key_off  = 832, key_len  = 124  87 bc 92 de  30 77 02 01  01 04 20 9c
2018-11-09 10:25:53.949 [CUP:INFO] TC credentials updated (956 bytes)
2018-11-09 10:25:53.968 [AIO:DEBU] [3] HTTP connection shutdown...
2018-11-09 10:25:53.971 [CUP:INFO] CUPS provided TC updates (uri) - restarting TC engine
2018-11-09 10:25:53.971 [TCE:INFO] Terminating TC engine
2018-11-09 10:25:53.972 [CUP:INFO] CUPS provided CUPS updates (uri) - reconnecting in 1s
2018-11-09 10:25:53.972 [TCE:INFO] Starting TC engine
2018-11-09 10:25:53.974 [any:INFO] cert. version     : 1
serial number     : 0C
issuer name       : CN=Root CA, OU=TrackCentral (eiaPoUc9), O=TrackNet.io, C=CH
subject name      : CN=Root CA, OU=TrackCentral (eiaPoUc9), O=TrackNet.io, C=CH
issued  on        : 2018-11-08 12:42:00
expires on        : 2024-11-06 12:42:00
signed using      : ECDSA with SHA256
EC key size       : 256 bits
2018-11-09 10:25:53.976 [any:INFO] cert. version     : 3
serial number     : 14
issuer name       : CN=Root CA, OU=TrackCentral (eiaPoUc9), O=TrackNet.io, C=CH
subject name      : CN=router-24b:bff:fe03:44f, OU=TrackCentral, O=TrackNet.io, C=CH
issued  on        : 2018-11-08 13:14:46
expires on        : 2020-11-07 13:14:46
signed using      : ECDSA with SHA256
EC key size       : 256 bits
2018-11-09 10:25:53.977 [AIO:INFO]
2018-11-09 10:25:54.020 [TCE:INFO] Connecting to INFOS: wss://s2.sm.tc:7000
2018-11-09 10:25:54.842 [TCE:INFO] Infos: router-24b:bff:fe03:44f muxs-::0 wss://s2.sm.tc:7001/router-24b:bff:fe03:44f
2018-11-09 10:25:54.843 [AIO:DEBU] [3] ws_close reason=1000
2018-11-09 10:25:54.844 [AIO:DEBU] [3] Server sent close: reason=1000
2018-11-09 10:25:54.844 [AIO:DEBU] [3] WS connection shutdown...
2018-11-09 10:25:54.847 [any:INFO] cert. version     : 1
serial number     : 0C
issuer name       : CN=Root CA, OU=TrackCentral (eiaPoUc9), O=TrackNet.io, C=CH
subject name      : CN=Root CA, OU=TrackCentral (eiaPoUc9), O=TrackNet.io, C=CH
issued  on        : 2018-11-08 12:42:00
expires on        : 2024-11-06 12:42:00
signed using      : ECDSA with SHA256
EC key size       : 256 bits
2018-11-09 10:25:54.849 [any:INFO] cert. version     : 3
serial number     : 14
issuer name       : CN=Root CA, OU=TrackCentral (eiaPoUc9), O=TrackNet.io, C=CH
subject name      : CN=router-24b:bff:fe03:44f, OU=TrackCentral, O=TrackNet.io, C=CH
issued  on        : 2018-11-08 13:14:46
expires on        : 2020-11-07 13:14:46
signed using      : ECDSA with SHA256
EC key size       : 256 bits
2018-11-09 10:25:54.849 [AIO:INFO]
2018-11-09 10:25:54.893 [TCE:VERB] Connecting to MUXS...
2018-11-09 10:25:55.809 [CUP:INFO] Starting a CUPS session
2018-11-09 10:25:55.810 [CUP:INFO] Connecting to CUPS ... https://s2.sm.tc:7007 (try #1)
2018-11-09 10:25:55.812 [any:INFO] cert. version     : 1
serial number     : 0C
issuer name       : CN=Root CA, OU=TrackCentral (eiaPoUc9), O=TrackNet.io, C=CH
subject name      : CN=Root CA, OU=TrackCentral (eiaPoUc9), O=TrackNet.io, C=CH
issued  on        : 2018-11-08 12:42:00
expires on        : 2024-11-06 12:42:00
signed using      : ECDSA with SHA256
EC key size       : 256 bits
2018-11-09 10:25:55.814 [any:INFO] cert. version     : 3
serial number     : 14
issuer name       : CN=Root CA, OU=TrackCentral (eiaPoUc9), O=TrackNet.io, C=CH
subject name      : CN=router-24b:bff:fe03:44f, OU=TrackCentral, O=TrackNet.io, C=CH
issued  on        : 2018-11-08 13:14:46
expires on        : 2020-11-07 13:14:46
signed using      : ECDSA with SHA256
EC key size       : 256 bits
2018-11-09 10:25:55.814 [AIO:INFO]
2018-11-09 10:25:55.858 [CUP:VERB] Retrieving update-info from CUPS https://s2.sm.tc:7007...
2018-11-09 10:25:57.092 [TCE:VERB] Connected to MUXS.
2018-11-09 10:25:57.117 [S2E:WARN] Unknown field in router_config - ignored: regionid (0xE6FFB211)
2018-11-09 10:25:57.117 [S2E:WARN] Unknown field in router_config - ignored: upchannels (0x7FCAA9EB)
2018-11-09 10:25:57.118 [S2E:WARN] Unknown field in router_config - ignored: config (0xF7A3E35F)
2018-11-09 10:25:57.118 [S2E:WARN] Unknown field in router_config - ignored: protocol (0xFD309030)
2018-11-09 10:25:57.118 [S2E:WARN] Unknown field in router_config - ignored: bcning (0x1EE5E245)
2018-11-09 10:25:55.985 [RAL:INFO] Lora gateway library version: Version: 5.0.1;
2018-11-09 10:25:55.985 [RAL:DEBU] SX1301 txlut table (0 entries)
2018-11-09 10:25:55.985 [RAL:VERB] SX1301 rxrfchain 0: enable=1 freq=868300000 rssi_offset=-166.000000 type=2 tx_enable=1 tx_notch_freq=0
2018-11-09 10:25:55.986 [RAL:VERB] SX1301 rxrfchain 1: enable=0 freq=0 rssi_offset=-166.000000 type=2 tx_enable=0 tx_notch_freq=0
2018-11-09 10:25:55.986 [RAL:VERB] SX1301 ifchain  0: enable=1 rf_chain=0 freq=-200000 bandwidth=0 datarate=0 sync_word=0/0
2018-11-09 10:25:55.987 [RAL:VERB] SX1301 ifchain  1: enable=1 rf_chain=0 freq=0 bandwidth=0 datarate=0 sync_word=0/0
2018-11-09 10:25:55.987 [RAL:VERB] SX1301 ifchain  2: enable=1 rf_chain=0 freq=200000 bandwidth=0 datarate=0 sync_word=0/0
2018-11-09 10:25:55.987 [RAL:VERB] SX1301 ifchain  3: enable=0 rf_chain=0 freq=0 bandwidth=0 datarate=0 sync_word=0/0
2018-11-09 10:25:55.987 [RAL:VERB] SX1301 ifchain  4: enable=0 rf_chain=0 freq=0 bandwidth=0 datarate=0 sync_word=0/0
2018-11-09 10:25:55.988 [RAL:VERB] SX1301 ifchain  5: enable=0 rf_chain=0 freq=0 bandwidth=0 datarate=0 sync_word=0/0
2018-11-09 10:25:55.988 [RAL:VERB] SX1301 ifchain  6: enable=0 rf_chain=0 freq=0 bandwidth=0 datarate=0 sync_word=0/0
2018-11-09 10:25:55.988 [RAL:VERB] SX1301 ifchain  7: enable=0 rf_chain=0 freq=0 bandwidth=0 datarate=0 sync_word=0/0
2018-11-09 10:25:55.988 [RAL:VERB] SX1301 ifchain  8: enable=0 rf_chain=0 freq=0 bandwidth=0 datarate=0 sync_word=0/0
2018-11-09 10:25:55.988 [RAL:VERB] SX1301 ifchain  9: enable=0 rf_chain=0 freq=0 bandwidth=0 datarate=0 sync_word=0/0
2018-11-09 10:25:55.989 [RAL:VERB] SX1301 LBT not enabled
2018-11-09 10:25:55.989 [RAL:INFO] Station device: /dev/spidev32766.0 (PPS capture disabled)
2018-11-09 10:25:58.907 [S2E:INFO] Configuring for region: EU863 -- 863.0MHz..870.0MHz
2018-11-09 10:25:58.907 [S2E:VERB]   DR0  SF12/BW125
2018-11-09 10:25:58.908 [S2E:VERB]   DR1  SF11/BW125
2018-11-09 10:25:58.908 [S2E:VERB]   DR2  SF10/BW125
2018-11-09 10:25:58.908 [S2E:VERB]   DR3  SF9/BW125
2018-11-09 10:25:58.908 [S2E:VERB]   DR4  SF8/BW125
2018-11-09 10:25:58.908 [S2E:VERB]   DR5  SF7/BW125
2018-11-09 10:25:58.908 [S2E:VERB]   DR6  SF7/BW250
2018-11-09 10:25:58.909 [S2E:VERB]   DR7  FSK
2018-11-09 10:25:58.909 [S2E:VERB]   DR8  undefined
2018-11-09 10:25:58.909 [S2E:VERB]   DR9  undefined
2018-11-09 10:25:58.909 [S2E:VERB]   DR10 undefined
2018-11-09 10:25:58.909 [S2E:VERB]   DR11 undefined
2018-11-09 10:25:58.910 [S2E:VERB]   DR12 undefined
2018-11-09 10:25:58.910 [S2E:VERB]   DR13 undefined
2018-11-09 10:25:58.910 [S2E:VERB]   DR14 undefined
2018-11-09 10:25:58.910 [S2E:VERB]   DR15 undefined
2018-11-09 10:25:58.910 [S2E:VERB]   TX power: 16.0 dBm EIRP
2018-11-09 10:25:58.910 [S2E:VERB]             27.0 dBm EIRP for 869.4MHz..869.65MHz
2018-11-09 10:25:58.911 [S2E:VERB]   JoinEui list: 0 entries
2018-11-09 10:25:58.911 [S2E:VERB]   NetID filter: FFFFFFFF-FFFFFFFF-FFFFFFFF-FFFFFFFF
2018-11-09 10:25:58.911 [S2E:VERB]   Dev/test settings: nocca=0 nodc=1 nodwell=0
2018-11-09 10:25:59.840 [AIO:DEBU] [4] HTTP connection shutdown...
2018-11-09 10:25:59.843 [CUP:INFO] Interaction with CUPS done (no updates) - next regular check in 1d
2018-11-09 10:26:40.932 [SYN:INFO] MCU/SX1301 drift stats: min: 0.0ppm  q50: -3.3ppm  q80: 6.7ppm  max: -90.4ppm - threshold q90: -8.6ppm
2018-11-09 10:26:40.933 [SYN:INFO] Avg MCU drift vs SX1301#0: 1.0ppm
2018-11-09 10:26:55.637 [SYN:INFO] Time sync qualities: min=108 q90=184 max=665 (previous q90=2147483647)
2018-11-09 10:27:00.889 [SYN:VERB] Time sync rejected: quality=244 threshold=184
2018-11-09 10:27:13.514 [SYN:VERB] Time sync rejected: quality=228 threshold=184
2018-11-09 10:27:15.615 [SYN:VERB] Time sync rejected: quality=235 threshold=184
2018-11-09 10:27:19.816 [SYN:VERB] Time sync rejected: quality=239 threshold=184
2018-11-09 10:27:26.118 [SYN:INFO] MCU/SX1301 drift stats: min: 0.5ppm  q50: 4.8ppm  q80: 10.5ppm  max: 10.9ppm - threshold q90: -10.9ppm
2018-11-09 10:27:26.118 [SYN:INFO] Avg MCU drift vs SX1301#0: 1.0ppm
2018-11-09 10:27:34.520 [SYN:VERB] Time sync rejected: quality=227 threshold=184
2018-11-09 10:27:36.621 [SYN:VERB] Time sync rejected: quality=232 threshold=184
2018-11-09 10:27:38.722 [SYN:VERB] Time sync rejected: quality=230 threshold=184
2018-11-09 10:27:56.576 [SYN:INFO] Time sync qualities: min=132 q90=235 max=244 (previous q90=184)
2018-11-09 10:28:07.079 [SYN:VERB] Time sync rejected: quality=258 threshold=235
2018-11-09 10:28:11.282 [SYN:VERB] Time sync rejected: quality=244 threshold=235
2018-11-09 10:28:14.838 [S2E:VERB] RX 868.1MHz DR5 SF7/BW125 snr=9.8 rssi=-63 xtime=0x290000083EAD83 - updf mhdr=40 DevAddr=3634B654 FCtrl=80 FCnt=3865 FOpts=[] 9320EB48..C977 mic=71511833 (24 bytes)
2018-11-09 10:28:15.483 [SYN:INFO] MCU/SX1301 drift stats: min: 0.0ppm  q50: -2.3ppm  q80: -10.5ppm  max: 17.6ppm - threshold q90: -13.8ppm
2018-11-09 10:28:15.484 [SYN:INFO] Avg MCU drift vs SX1301#0: 1.0ppm
2018-11-09 10:28:24.936 [SYN:VERB] Time sync rejected: quality=237 threshold=235
2018-11-09 10:28:35.439 [SYN:VERB] Time sync rejected: quality=253 threshold=235
2018-11-09 10:32:32.208 [S2E:VERB] RX 868.3MHz DR5 SF7/BW125 snr=7.8 rssi=-77 xtime=0x2900001795C233 - updf mhdr=40 DevAddr=0124504D FCtrl=80 FCnt=22225 FOpts=[] 660BB08A..881B mic=1015568105 (21 bytes)

Next Steps

Next, consult the Help menu of the Station binary and inspect the station.conf and cups-boot.* example configuration files.

Built-in Help Menu

The Station binary accepts the following command-line options:

./station --help
Usage: station [OPTION...]

  -d, --daemon               First, check to see whether another process is still alive.
                             If so, do nothing and exit. Otherwise, fork a worker
                             process to operate the radios and network
                             protocols. If the subprocess died, respawn it with
                             an appropriate back-off.
  -f, --force                If a station process is already running, kill it
                             before continuing with the requested operation mode.
  -h, --home=DIR             Home directory for configuration files. The default is
                             the current working directory. Overrides
                             environment STATION_DIR.
  -i, --radio-init=cmd       Program/script to run before reinitializing the radio
                             hardware. By default nothing is being executed.
                             Overrides environment STATION_RADIOINIT.
  -k, --kill                 Kill a currently-running station process.
  -l, --log-level=LVL|0..7   Set a log level LVL=#loglvls# or use a numeric
                             value. Overrides environment STATION_LOGLEVEL.
  -L, --log-file=FILE[,SIZE[,ROT]]
                             Write log entries to FILE. If FILE is '-' then
                             write to stderr. Optionally this may be followed by a maximum
                             file SIZE and a number of rotation files. If ROT is 0,
                             then keep only FILE. If ROT is 1 then keep one
                             more old log file around. Overrides environment
                             STATION_LOGFILE.
  -N, --no-tc                Do not connect to an LNS. Only run CUPS
                             functionality.
  -p, --params               Print current parameter settings.
  -t, --temp=DIR             Temp directory for frequently-written files.
                             Default is /tmp. Overrides environment variable
                             STATION_TEMPDIR.
  -x, --eui-prefix=id6       Turn MAC address into an EUI by adding this prefix.
                             If the argument has value ff:fe00:0 then the EUI
                             is formed by inserting FFFE in the middle. If
                             absent, use the MAC or routerid as-is. Overrides
                             environment variable STATION_EUIPREFIX.
  -?, --help                 Display this Help list
      --usage                Display a short usage message
  -v, --version              Print Station version.

Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.

Example Configuration

The minimum required configuration for retrieving credentials and the URI of the LNS are the bootstrap credentials and bootstrap URI as described in Files Related to Station.

For the s2.sm.tc example test server, these are as follows:

cat cups-boot.uri
 https://s2.sm.tc:7007

cat cups-boot.crt
 -----BEGIN CERTIFICATE-----
 MIIBkzCCATmgAwIBAgIBQTAKBggqhkjOPQQDAjBXMRAwDgYDVQQDDAdSb290IENB
 MSAwHgYDVQQLDBdUcmFja0NlbnRyYWwgKGVpYVBvVWM5KTEUMBIGA1UECgwLVHJh
 Y2tOZXQuaW8xCzAJBgNVBAYTAkNIMB4XDTE5MDMwNzE1MjgwNVoXDTIxMDMwNjE1
 MjgwNVowTzETMBEGA1UEAwwKZ3dwcm92LTo6MDEVMBMGA1UECwwMVHJhY2tDZW50
 cmFsMRQwEgYDVQQKDAtUcmFja05ldC5pbzELMAkGA1UEBhMCQ0gwWTATBgcqhkjO
 PQIBBggqhkjOPQMBBwNCAASFyfmqBPkza9kd2IkrbU3zSRIriq5vOcgwfilctZVs
 j8Z7XVBMdNLjriSjchVgyBTJfvMVMbvYTdzD7w5GBSNwMAoGCCqGSM49BAMCA0gA
 MEUCIQCFGgSlP6GYM6uXd6KXuEwc098p5orHP/dxupGAZifquwIgbUh9UAR8tgAi
 8TH36s9z+mz27ea7ezcmH8aM4W3Meng=
 -----END CERTIFICATE-----

cat cups-boot.key
 -----BEGIN EC PRIVATE KEY-----
 MHcCAQEEIJbt0pUj24UIWS6HngUqJtP3uPpweSIqhB4TRoyHdzdqoAoGCCqGSM49
 AwEHoUQDQgAEhcn5qgT5M2vZHdiJK21N80kSK4qubznIMH4pXLWVbI/Ge11QTHTS
 464ko3IVYMgUyX7zFTG72E3cw+8ORgUjcA==
 -----END EC PRIVATE KEY-----

The station.conf configuration file contains the minimum set of parameters required for configuring and starting the SX1301. The actual channel plan configuration is received from the LNS, as mentioned before.

Example configuration:

{
    /* 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_file":  "stderr",
        "log_level": "DEBUG",  /* XDEBUG,DEBUG,VERBOSE,INFO,NOTICE,WARNING,ERROR,CRITICAL */
        "log_size":  10000000,
        "log_rotate":  3
    }
}