Running Basic Station on Conduit

Code base and documentation


mPower 5.3 includes UI configuration and basic station packages

Credentials

Select LNS or CUPS depending on server requirements. The LNS protocol will downlink the channel plan from a server. The CUPS protocol and redirect the station process to a network server end-point.

URI

Set the URI field to point to a network, in this example a TTI private instance is used.

wss://multitech.eu1.cloud.thethings.industries:8887

Connecting to TTN Community

TTN Instructions

Replace “us” with “au”, “eu” or “in” for the desired region.

wss://lns.us.thethings.network:443

Station Conf

The default station configuration can be used as the network will configure the channels based on the selected channel plan in the TTI configuration.

Server Certificate

Use the following command to view the certificate used by the server.

openssl s_client -showcerts -servername multitech.eu1.cloud.thethings.industries -connect multitech.eu1.cloud.thethings.industries:8887

Use the second certificate output by the open ssl command

-----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-----

TTN Community certificates

Replace “us” with “au”, “eu” or “in” for the desired region.

openssl s_client -showcerts -servername lns.us.thethings.network -connect lns.us.thethings.network:443

Use the second certificate output by the open ssl command

-----BEGIN CERTIFICATE-----
MIIEkjCCA3qgAwIBAgIQCgFBQgAAA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
MDGgL6AthitodHRwOi8vY3JsLmlkZW50cnVzdC5jb20vRFNUUk9PVENBWDNDUkwu
Y3JsMB0GA1UdDgQWBBSoSmpjBH3duubRObemRWXv86jsoTANBgkqhkiG9w0BAQsF
AAOCAQEA3TPXEfNjWDjdGBX7CVW+dla5cEilaUcne8IkCJLxWh9KEik3JHRRHGJo
uM2VcGfl96S8TihRzZvoroed6ti6WqEBmtzw3Wodatg+VyOeph4EYpr/1wXKtx8/
wApIvJSwtmVi4MFU5aMqrSDE6ea73Mj2tcMyo5jMd6jmeWUHK8so/joWUoHOUgwu
X4Po1QYz+3dszkDqMp4fklxBwXRsW10KXzPMTZ+sOPAveyxindmjkW8lGy+QsRlG
PfZ+G6Z6h7mjem0Y+iWlkYcV4PIWL1iwBi8saCbGS5jN2p8M+X+Q7UNKEkROb3N6
KOqkqm57TH2H3eDJAkSnh6/DNFu0Qg==
-----END CERTIFICATE-----

Gateway Certificate

If a TLS client cert is required to connect to the server provide a certificate. Otherwise leave this field blank.

Gateway Key

The Gateway Key can be used to populate the authorization header field or be a TLS client key depending on connection method. The Gateway Key needs to be formatted correctly to be used. In The Things Industries v3 GUI, create an API Key with Link as Gateway permissions and copy the key to the text box preceded by “Authorization: ”

Authorization: NNSXS.XXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

TTN Community gateway key

Currently the TTN Community servers to not authenticate the gateway key. Any value can be set, the file needs have proper contents to allow parsing by the basic station daemon.

Authorization: NNSXS.XXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Click Save and Apply and the station will be started.

Troubleshooting

If there are issues and the station needs to be run manually, you can ssh into the gateway and issue these commands to see output. The station.conf logging feature can also be used to get messages to find any issue details.

$ /etc/init.d/lora-networks-server stop
$ cd /var/run/lora/1
$ sudo ./station


Installation on MTCDT/MTCAP

Install the Basic Station from downloads.

$ sudo -s
# wget http://www.multitech.net/downloads/lora-basic-station_2.0.3-r1.0_arm926ejste.ipk
# opkg install lora-basic-station_2.0.3-r1.0_arm926ejste.ipk

The /opt/lora/station binary will be installed.

Basic Station to Packet Forwarder

This example python script shows how to send a channel configuration to the connection basic station gateway. It is useful for getting started and ensuring the gateway is functioning.
Basic Station Examples

TTI Configuration

The Things Industries provide private server instances that Basic Station can connect to. Visit TTI for details.

tc.uri

wss://<ORG>.<REGION>.cloud.thethings.industries:8887
wss://multitech.eu1.cloud.thethings.industries:8887

tc.key – Gateway Token

The tc.key file needs to be formatted correctly to be used and can be created with this command. In The Things Industries v3 GUI, create an API Key with Link as Gateway permissions and copy the key to the tc.key file.

echo -en "Authorization: NNSXS.XXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\r\n" > tc.key

tc.trust

Use the following command to view the certificate used by the server.

openssl s_client -showcerts -servername multitech.eu1.cloud.thethings.industries -connect multitech.eu1.cloud.thethings.industries:8887
-----BEGIN CERTIFICATE-----
MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDANBgkqhkiG9w0BAQsFADA/
MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT
DkRTVCBSb290IENBIFgzMB4XDTE2MDMxNzE2NDA0NloXDTIxMDMxNzE2NDA0Nlow
SjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUxldCdzIEVuY3J5cHQxIzAhBgNVBAMT
GkxldCdzIEVuY3J5cHQgQXV0aG9yaXR5IFgzMIIBIjANBgkqhkiG9w0BAQEFAAOC
AQ8AMIIBCgKCAQEAnNMM8FrlLke3cl03g7NoYzDq1zUmGSXhvb418XCSL7e4S0EF
q6meNQhY7LEqxGiHC6PjdeTm86dicbp5gWAf15Gan/PQeGdxyGkOlZHP/uaZ6WA8
SMx+yk13EiSdRxta67nsHjcAHJyse6cF6s5K671B5TaYucv9bTyWaN8jKkKQDIZ0
Z8h/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E-----


Configuration files

  • Adjust the station.conf file for the desired frequencies, see examples.

    Download station.conf

    Use the routerid and euiprefix fields to assign the Gateway EUI.
    See Basic Station Doc for EUI.

  • Configure tc.uri to point to the network server web socket port
    ws://192.168.52.72:6090
  • For secure web sockets use wss and provide tc.key or tc.trust and tc.crt files
    wss://192.168.52.72:6090


Running the Basic Station

root@mtcdt:/opt/lora$ sudo ./station 
2020-02-26 16:56:02.698 [SYS:WARN] Ignoring field: region
2020-02-26 16:56:02.700 [SYS:INFO] Logging     : stderr (maxsize=10000000, rotate=3)
2020-02-26 16:56:02.700 [SYS:INFO] Station Ver : 2.0.3(mlinux/std) 2020-01-24 16:54:44
2020-02-26 16:56:02.700 [SYS:INFO] Package Ver : (null)
2020-02-26 16:56:02.701 [SYS:INFO] proto EUI   : ::1    (station.conf)
2020-02-26 16:56:02.701 [SYS:INFO] prefix EUI  : ::0    (station.conf)
2020-02-26 16:56:02.701 [SYS:INFO] Station EUI : ::1
2020-02-26 16:56:02.701 [SYS:INFO] Station home: ./     (builtin)
2020-02-26 16:56:02.701 [SYS:INFO] Station temp: /var/tmp/      (builtin)
2020-02-26 16:56:02.701 [SYS:WARN] Station in NO-CUPS mode
2020-02-26 16:56:02.903 [TCE:INFO] Starting TC engine
2020-02-26 16:56:02.908 [TCE:INFO] Connecting to INFOS: ws://192.168.52.72:6090
2020-02-26 16:56:02.912 [TCE:INFO] Infos: ::1 muxs-::0 ws://192.168.52.72:6092/router-::1
2020-02-26 16:56:02.912 [AIO:DEBU] [3] ws_close reason=1000
2020-02-26 16:56:02.913 [AIO:DEBU] [3] Server sent close: reason=1000
2020-02-26 16:56:02.913 [AIO:DEBU] [3] WS connection shutdown...
2020-02-26 16:56:02.916 [TCE:VERB] Connecting to MUXS...
2020-02-26 16:56:02.917 [TCE:VERB] Connected to MUXS.
INFO: FPGA supported features: [TX filter]  [Spectral Scan]  [LBT] 
2020-02-26 16:56:03.219 [S2E:WARN] Unknown field in router_config - ignored: bcning (0x1EE5E245)
2020-02-26 16:56:03.219 [S2E:WARN] Unknown field in router_config - ignored: config (0xF7A3E35F)
2020-02-26 16:56:03.219 [S2E:WARN] Unknown field in router_config - ignored: protocol (0xFD309030)
2020-02-26 16:56:03.220 [S2E:WARN] Unknown field in router_config - ignored: regionid (0xE6FFB211)
2020-02-26 16:56:03.220 [S2E:WARN] Unknown field in router_config - ignored: upchannels (0x7FCAA9EB)
2020-02-26 23:08:46.995 [RAL:WARN] Ignoring unsupported/unknown field: lbt_conf
2020-02-26 23:08:47.049 [RAL:INFO] Lora gateway library version: Version: 5.0.1-mts-1;
2020-02-26 23:08:47.049 [RAL:DEBU] SX1301 txlut table (2 entries)
2020-02-26 23:08:47.049 [RAL:VERB] SX1301 txlut  0:  dig_gain=0 pa_gain=0 dac_gain=3 mix_gain=11 rf_power=-6
2020-02-26 23:08:47.049 [RAL:VERB] SX1301 txlut  1:  dig_gain=0 pa_gain=0 dac_gain=3 mix_gain=13 rf_power=-3
2020-02-26 23:08:47.049 [RAL:VERB] SX1301 rxrfchain 0: enable=1 freq=868475000 rssi_offset=-162.000000 type=2 tx_enable=1 tx_notch_freq=0
2020-02-26 23:08:47.049 [RAL:VERB] SX1301 rxrfchain 1: enable=1 freq=869287500 rssi_offset=-162.000000 type=2 tx_enable=0 tx_notch_freq=0
2020-02-26 23:08:47.049 [RAL:VERB] SX1301 ifchain  0: enable=1 rf_chain=0 freq=-375000 bandwidth=0 datarate=0 sync_word=0/0
2020-02-26 23:08:47.050 [RAL:VERB] SX1301 ifchain  1: enable=1 rf_chain=0 freq=-175000 bandwidth=0 datarate=0 sync_word=0/0
2020-02-26 23:08:47.050 [RAL:VERB] SX1301 ifchain  2: enable=1 rf_chain=0 freq=25000 bandwidth=0 datarate=0 sync_word=0/0
2020-02-26 23:08:47.050 [RAL:VERB] SX1301 ifchain  3: enable=1 rf_chain=0 freq=375000 bandwidth=0 datarate=0 sync_word=0/0
2020-02-26 23:08:47.050 [RAL:VERB] SX1301 ifchain  4: enable=1 rf_chain=1 freq=-237500 bandwidth=0 datarate=0 sync_word=0/0
2020-02-26 23:08:47.050 [RAL:VERB] SX1301 ifchain  5: enable=1 rf_chain=1 freq=237500 bandwidth=0 datarate=0 sync_word=0/0
2020-02-26 23:08:47.050 [RAL:VERB] SX1301 ifchain  6: enable=0 rf_chain=1 freq=200000 bandwidth=0 datarate=0 sync_word=0/0
2020-02-26 23:08:47.050 [RAL:VERB] SX1301 ifchain  7: enable=0 rf_chain=1 freq=400000 bandwidth=0 datarate=0 sync_word=0/0
2020-02-26 23:08:47.050 [RAL:VERB] SX1301 ifchain  8: enable=0 rf_chain=0 freq=-200000 bandwidth=2 datarate=2 sync_word=0/0
2020-02-26 23:08:47.051 [RAL:VERB] SX1301 ifchain  9: enable=0 rf_chain=0 freq=300000 bandwidth=3 datarate=50000 sync_word=0/0
2020-02-26 23:08:47.051 [RAL:VERB] SX1301 LBT not enabled
2020-02-26 23:08:47.051 [RAL:INFO] Station device: /dev/spidev0.0 (PPS capture enabled)
2020-02-26 23:08:50.049 [S2E:INFO] Configuring for region: EU863 -- 863.0MHz..870.0MHz
2020-02-26 23:08:50.049 [S2E:VERB]   DR0  SF12/BW125 
2020-02-26 23:08:50.049 [S2E:VERB]   DR1  SF11/BW125 
2020-02-26 23:08:50.049 [S2E:VERB]   DR2  SF10/BW125 
2020-02-26 23:08:50.049 [S2E:VERB]   DR3  SF9/BW125 
2020-02-26 23:08:50.049 [S2E:VERB]   DR4  SF8/BW125 
2020-02-26 23:08:50.049 [S2E:VERB]   DR5  SF7/BW125 
2020-02-26 23:08:50.049 [S2E:VERB]   DR6  SF7/BW250 
2020-02-26 23:08:50.049 [S2E:VERB]   DR7  FSK 
2020-02-26 23:08:50.049 [S2E:VERB]   DR8  undefined
2020-02-26 23:08:50.049 [S2E:VERB]   DR9  undefined
2020-02-26 23:08:50.049 [S2E:VERB]   DR10 undefined
2020-02-26 23:08:50.049 [S2E:VERB]   DR11 undefined
2020-02-26 23:08:50.050 [S2E:VERB]   DR12 undefined
2020-02-26 23:08:50.050 [S2E:VERB]   DR13 undefined
2020-02-26 23:08:50.050 [S2E:VERB]   DR14 undefined
2020-02-26 23:08:50.050 [S2E:VERB]   DR15 undefined
2020-02-26 23:08:50.050 [S2E:VERB]   TX power: 16.0 dBm EIRP
2020-02-26 23:08:50.050 [S2E:VERB]             27.0 dBm EIRP for 869.4MHz..869.65MHz
2020-02-26 23:08:50.050 [S2E:VERB]   JoinEui list: 0 entries
2020-02-26 23:08:50.050 [S2E:VERB]   NetID filter: FFFFFFFF-FFFFFFFF-FFFFFFFF-FFFFFFFF
2020-02-26 23:08:50.050 [S2E:VERB]   Dev/test settings: nocca=0 nodc=0 nodwell=0