Tektelic Kona Micro BSP 4.0.2 - Cups Provisionning

Hello community,

I contact you because I have some difficulties to configure the CUPS files on the Tektelic Kona Micro gateway.

Indeed i configured correctly the cups.uri, the cups.key and the cert.trust file but this seems not been working.

Do you have an example of files that be previously written for working with the cups protocol ?

Thanks for your answers

What is the error?

The only error is that the gateway is unable to connect to the LNS, even if the files are correctly configured.

So you dont see an error “mesage”? indicating a problem or telling you what may be wrong?

No, I don’t have anything.

I written the caps.uri, caps.key and caps.trust files.

I installed previously BSP firmware in the version 4.0.2 and I have also restarted Tektelic Packet Forwarder, but this seems to be insufficient.

What do your logs show? Any errors/events/alarms/warnings there?

I’m sorry, I didn’t watch the good logs.

So, I have this :

Mar 28 08:46:00 kona-micro-0078DC tek_bstn[6826]: [6826][DEBUG ] bridge_bstn_cups.c:1002 CUPS request body: { “router”: “647f:daff:fe00:78dc”, “cupsUri”: “https://eu1.cloud.thethings.network:443”, “cupsCredCrc”: 1418635315, “tcCredCrc”: 1, “station”: “Tektelic Kona gateway”, “model”: “micro”, “package”: “Tektelic Basic Station” }

Mar 28 08:46:00 kona-micro-0078DC tek_bstn[6826]: [6826][DEBUG ] bridge_bstn_cups.c:1012 using CUPS request URI: https://eu1.cloud.thethings.network:443/update-info

Mar 28 08:46:00 kona-micro-0078DC tek_bstn[6826]: [6826][DEBUG ] bridge_bstn_cups.c:1057 performing CUPS request

Mar 28 08:46:00 kona-micro-0078DC tek_bstn[6826]: [6826][DEBUG ] bridge_bstn_cups.c:1082 using token for client auth

Mar 28 08:46:00 kona-micro-0078DC tek_bstn[6826]: [6826][DEBUG ] bridge_bstn_cups.c:1102 constructed auth header: “Authorization: Bearer D2RR5XC4OZZ7R36NNKZZTR5UOL6PEFGQCJHMDLA”
Mar 28 08:46:00 kona-micro-0078DC tek_bstn[6826]: [6826][DEBUG ] bridge_bstn_cups.c:1150 CUPS response code: 401

Mar 28 08:46:00 kona-micro-0078DC tek_bstn[6826]: [6826][WARN ] bridge_bstn_cups.c:1234 CUPS main credentials auth error: trying backup creds instead

Mar 28 08:46:00 kona-micro-0078DC tek_bstn[6826]: [6826][ERROR ] bridge_bstn_cups.c:890 missing mandatory key file /etc/bstn/cups.bak.key from backup set

Mar 28 08:46:00 kona-micro-0078DC tek_bstn[6826]: [6826][WARN ] main_bstn.c:171 non-critical error raised: [-2]

Ok so what rights have you given to the CUPS API Key?

I give to her the right to retrieve secrets associated with a gateway and to edit basic gateway settings.

Did you also add the View Gateway Information right?

Yes, this is checked.

And here you have hidden the rest of the API Key for security in this post right?

Also which trust certificates are you using?

This is my problem, on the TTN documentation, it’s write that we’ve to put the CUPS API KEY in a cups.key file in the folder /etc/bstn/, but we have also a LNS key that is much longer onthe console of TTN and I would like to know if this is this key that we’ve to use instead of the cups api key.
Because here, you have my cups key on your screen.

For the certificates, i use this file provided on the TTN doc :

https://curl.haxx.se/ca/cacert.pem

Thanks for your help

An API Key has three parts

NNSXS.<ID>.<HASH>

You need to use the entire CUPS key here and not just this part; D2RR5XC4OZZ7R36NNKZZTR5UOL6PEFGQCJHMDLA . This is just the <ID> section.

You don’t need to use the LNS Key in the gateway. It will be automatically sent by the server.

Okay, I have registered the gateway again.

I entered the cups key again with NNSXS.ID.HASH and now, I have an 409 http error.

Please paste the entire log. And remove the API Key when you paste the log.

Mar 29 08:23:57 kona-micro-0078DC tek_bstn[18991]: [18991][DEBUG ] bridge_bstn_cups.c:1276 retrying to connect within 15 seconds
Mar 29 08:24:12 kona-micro-0078DC tek_bstn[18991]: [18991][DEBUG ] bridge_bstn_cups.c:456 failed to open a file /etc/bstn/tc.trust: No such file or directory
Mar 29 08:24:12 kona-micro-0078DC tek_bstn[18991]: [18991][DEBUG ] bridge_bstn_cups.c:456 failed to open a file /etc/bstn/tc.key: No such file or directory
Mar 29 08:24:12 kona-micro-0078DC tek_bstn[18991]: [18991][DEBUG ] bridge_utils.c:298 failed to open a file /etc/bstn/tc.uri: No such file or directory
Mar 29 08:24:12 kona-micro-0078DC tek_bstn[18991]: [18991][DEBUG ] bridge_bstn_cups.c:966 LNS endpoint file is missing, must be downloaded via CUPS
Mar 29 08:24:12 kona-micro-0078DC tek_bstn[18991]: [18991][DEBUG ] bridge_bstn_cups.c:1002 CUPS request body: { “router”: “647f:daff:fe00:78dc”, “cupsUri”: “https://eu1.cloud.thethings.network:443”, “cupsCredCrc”: 3042594549, “tcCredCrc”: 1, “station”: “Tektelic Kona gateway”, “model”: “micro”, “package”: “Tektelic Basic Station” }
Mar 29 08:24:12 kona-micro-0078DC tek_bstn[18991]: [18991][DEBUG ] bridge_bstn_cups.c:1012 using CUPS request URI: https://eu1.cloud.thethings.network:443/update-info
Mar 29 08:24:12 kona-micro-0078DC tek_bstn[18991]: [18991][DEBUG ] bridge_bstn_cups.c:1057 performing CUPS request
Mar 29 08:24:12 kona-micro-0078DC tek_bstn[18991]: [18991][DEBUG ] bridge_bstn_cups.c:1082 using token for client auth
Mar 29 08:24:12 kona-micro-0078DC tek_bstn[18991]: [18991][DEBUG ] bridge_bstn_cups.c:1102 constructed auth header: "Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
"
Mar 29 08:24:13 kona-micro-0078DC tek_bstn[18991]: [18991][DEBUG ] bridge_bstn_cups.c:1150 CUPS response code: 409
Mar 29 08:24:13 kona-micro-0078DC tek_bstn[18991]: [18991][DEBUG ] bridge_bstn_cups.c:1276 retrying to connect within 15 seconds

Have you setup the LNS properly? Configuration and Update Server (CUPS) | The Things Stack for LoRaWAN

Yes, I followed this steps