Deploy a LoRa Basics™ Station gateway with TTN and balena

Please use the thread below to discuss the related blog post:

Hello! Feel free to add you comments here if you have questions, feedback or anything else that you would like to share :slight_smile:

In case it helps anyone else out there: One of the screenshots shows the service name as “main”, but in the latest version (at the time of this writing) the service name was renamed to “basicstation”. If you see “basicstation” in your dashboard, it is nothing to worry about. :slight_smile:

1 Like

Hi all, thanks for the wonderful job! I’m new to the Balena and TTN worlds. So, following the instructions described, I was able to set up the Raspberry Pi LoRa gateway with TTN and balena.

Now, the next task for me is to configure the TTN nodes and send data to the gateway. Could you please help with any documentation explaining the procedure? Any other guidance would also be appreciated.

Kind regards to you,
Adam, Shuaibu Musa

1 Like

I deleted a gateway from TTN not realizing that I couldn’t recreate it with the same EUI. Is there a way of changing the RAK2245 EUI on belena?

@kennym64 welcome to the balena community!

I strongly recommend to use this repo now GitHub - xoseperez/basicstation: Basics™ Station Packet Forward protocol using Docker and try to add a new EUI using the Device Variable GATEWAY_EUI. Read the README where this process is documented, if i’m not wrong.

Let me know if this works :slight_smile:

@kennym64 did this work on your side?

Hi Marc

It did, but…

I didn’t work at first and I spent another hour or so trying to get it to work and then suddenly it connected. I don’t know if it just took a long time or was something I changed.

Cheers

Ken

1 Like

@kennym64 glad to hear that this worked!

Hi, I don’t know if the guide is outdated, some things confuse me:

  1. once the device is flashed and running, I cannot access the variables anymore, such as GW_RESET_PIN and others.
  2. the EUI was not filled in automatically. I added a tag EUI, with value of the rPi’s Ethernet port’s MAC address, plus FFFE at the end. Still, I cannot see my unit in TTN. I did the API Key thing as described.
1 Like

Hello @Ostervall sorry for replying this late and let me welcome to the balena community!

My recommendation is to use this repo GitHub - xoseperez/basicstation: Basics™ Station Packet Forward protocol using Docker

Could you please confirm which one are you using?

Thanks

I have a RAK 2287 using Balena as the Basic Station. In UDP packet forwarder mode, the TTN server allows me to register the gateway, but the end devices are not able to join. I tried switching to Basic Station mode, but it doesn’t connect. Here are my logs:

basicstation 2024-10-04 05:15:56.205 [AIO:INFO] ./tc.trust:
basicstation cert. version : 3
basicstation serial number : 04:00:00:00:00:01:15:4B:5A:C3:94
basicstation issuer name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation subject name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation issued on : 1998-09-01 12:00:00
basicstation expires on : 2028-01-28 12:00:00
basicstation signed using : RSA with SHA1
basicstation RSA key size : 2048 bits
basicstation basic constraints : CA=true
basicstation key usage : Key Cert Sign, CRL Sign
basicstation 2024-10-04 05:15:56.205 [TCE:INFO] Connecting to INFOS: wss://localhost:8887
basicstation 2024-10-04 05:15:56.221 [AIO:INFO] TLS server certificate verification failed: The certificate is not correctly signed by the trusted CA
basicstation 2024-10-04 05:15:56.221 [AIO:DEBU] [4] WS connection shutdown…
basicstation 2024-10-04 05:15:56.222 [TCE:INFO] INFOS reconnect backoff 60s (retry 50)
basicstation 2024-10-04 05:16:56.288 [AIO:INFO] ./tc.trust:
basicstation cert. version : 3
basicstation serial number : 04:00:00:00:00:01:15:4B:5A:C3:94
basicstation issuer name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation subject name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation issued on : 1998-09-01 12:00:00
basicstation expires on : 2028-01-28 12:00:00
basicstation signed using : RSA with SHA1
basicstation RSA key size : 2048 bits
basicstation basic constraints : CA=true
basicstation key usage : Key Cert Sign, CRL Sign
basicstation 2024-10-04 05:16:56.288 [TCE:INFO] Connecting to INFOS: wss://localhost:8887
basicstation 2024-10-04 05:16:56.306 [AIO:INFO] TLS server certificate verification failed: The certificate is not correctly signed by the trusted CA
basicstation 2024-10-04 05:16:56.306 [AIO:DEBU] [4] WS connection shutdown…
basicstation 2024-10-04 05:16:56.307 [TCE:INFO] INFOS reconnect backoff 60s (retry 51)
basicstation 2024-10-04 05:17:56.374 [AIO:INFO] ./tc.trust:
basicstation cert. version : 3
basicstation serial number : 04:00:00:00:00:01:15:4B:5A:C3:94
basicstation issuer name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation subject name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation issued on : 1998-09-01 12:00:00
basicstation expires on : 2028-01-28 12:00:00
basicstation signed using : RSA with SHA1
basicstation RSA key size : 2048 bits
basicstation basic constraints : CA=true
basicstation key usage : Key Cert Sign, CRL Sign
basicstation 2024-10-04 05:17:56.374 [TCE:INFO] Connecting to INFOS: wss://localhost:8887
basicstation 2024-10-04 05:17:56.390 [AIO:INFO] TLS server certificate verification failed: The certificate is not correctly signed by the trusted CA
basicstation 2024-10-04 05:17:56.390 [AIO:DEBU] [4] WS connection shutdown…
basicstation 2024-10-04 05:17:56.391 [TCE:INFO] INFOS reconnect backoff 60s (retry 52)
basicstation 2024-10-04 05:18:56.458 [AIO:INFO] ./tc.trust:
basicstation cert. version : 3
basicstation serial number : 04:00:00:00:00:01:15:4B:5A:C3:94
basicstation issuer name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation subject name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation issued on : 1998-09-01 12:00:00
basicstation expires on : 2028-01-28 12:00:00
basicstation signed using : RSA with SHA1
basicstation RSA key size : 2048 bits
basicstation basic constraints : CA=true
basicstation key usage : Key Cert Sign, CRL Sign
basicstation 2024-10-04 05:18:56.458 [TCE:INFO] Connecting to INFOS: wss://localhost:8887
basicstation 2024-10-04 05:18:56.473 [AIO:INFO] TLS server certificate verification failed: The certificate is not correctly signed by the trusted CA
basicstation 2024-10-04 05:18:56.473 [AIO:DEBU] [4] WS connection shutdown…
basicstation 2024-10-04 05:18:56.474 [TCE:INFO] INFOS reconnect backoff 60s (retry 53)
basicstation 2024-10-04 05:19:56.544 [AIO:INFO] ./tc.trust:
basicstation cert. version : 3
basicstation serial number : 04:00:00:00:00:01:15:4B:5A:C3:94
basicstation issuer name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation subject name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation issued on : 1998-09-01 12:00:00
basicstation expires on : 2028-01-28 12:00:00
basicstation signed using : RSA with SHA1
basicstation RSA key size : 2048 bits
basicstation basic constraints : CA=true
basicstation key usage : Key Cert Sign, CRL Sign
basicstation 2024-10-04 05:19:56.544 [TCE:INFO] Connecting to INFOS: wss://localhost:8887
basicstation 2024-10-04 05:19:56.560 [AIO:INFO] TLS server certificate verification failed: The certificate is not correctly signed by the trusted CA
basicstation 2024-10-04 05:19:56.560 [AIO:DEBU] [4] WS connection shutdown…
basicstation 2024-10-04 05:19:56.561 [TCE:INFO] INFOS reconnect backoff 60s (retry 54)
basicstation 2024-10-04 05:20:56.627 [AIO:INFO] ./tc.trust:
basicstation cert. version : 3
basicstation serial number : 04:00:00:00:00:01:15:4B:5A:C3:94
basicstation issuer name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation subject name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation issued on : 1998-09-01 12:00:00
basicstation expires on : 2028-01-28 12:00:00
basicstation signed using : RSA with SHA1
basicstation RSA key size : 2048 bits
basicstation basic constraints : CA=true
basicstation key usage : Key Cert Sign, CRL Sign
basicstation 2024-10-04 05:20:56.628 [TCE:INFO] Connecting to INFOS: wss://localhost:8887
basicstation 2024-10-04 05:20:56.643 [AIO:INFO] TLS server certificate verification failed: The certificate is not correctly signed by the trusted CA
basicstation 2024-10-04 05:20:56.643 [AIO:DEBU] [4] WS connection shutdown…
basicstation 2024-10-04 05:20:56.643 [TCE:INFO] INFOS reconnect backoff 60s (retry 55)
basicstation 2024-10-04 05:21:56.707 [AIO:INFO] ./tc.trust:
basicstation cert. version : 3
basicstation serial number : 04:00:00:00:00:01:15:4B:5A:C3:94
basicstation issuer name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation subject name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation issued on : 1998-09-01 12:00:00
basicstation expires on : 2028-01-28 12:00:00
basicstation signed using : RSA with SHA1
basicstation RSA key size : 2048 bits
basicstation basic constraints : CA=true
basicstation key usage : Key Cert Sign, CRL Sign
basicstation 2024-10-04 05:21:56.708 [TCE:INFO] Connecting to INFOS: wss://localhost:8887
basicstation 2024-10-04 05:21:56.723 [AIO:INFO] TLS server certificate verification failed: The certificate is not correctly signed by the trusted CA
basicstation 2024-10-04 05:21:56.723 [AIO:DEBU] [4] WS connection shutdown…
basicstation 2024-10-04 05:21:56.724 [TCE:INFO] INFOS reconnect backoff 60s (retry 56)
basicstation 2024-10-04 05:22:56.790 [AIO:INFO] ./tc.trust:
basicstation cert. version : 3
basicstation serial number : 04:00:00:00:00:01:15:4B:5A:C3:94
basicstation issuer name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation subject name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation issued on : 1998-09-01 12:00:00
basicstation expires on : 2028-01-28 12:00:00
basicstation signed using : RSA with SHA1
basicstation RSA key size : 2048 bits
basicstation basic constraints : CA=true
basicstation key usage : Key Cert Sign, CRL Sign
basicstation 2024-10-04 05:22:56.790 [TCE:INFO] Connecting to INFOS: wss://localhost:8887
basicstation 2024-10-04 05:22:56.806 [AIO:INFO] TLS server certificate verification failed: The certificate is not correctly signed by the trusted CA
basicstation 2024-10-04 05:22:56.806 [AIO:DEBU] [4] WS connection shutdown…
basicstation 2024-10-04 05:22:56.808 [TCE:INFO] INFOS reconnect backoff 60s (retry 57)
basicstation 2024-10-04 05:23:56.875 [AIO:INFO] ./tc.trust:
basicstation cert. version : 3
basicstation serial number : 04:00:00:00:00:01:15:4B:5A:C3:94
basicstation issuer name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation subject name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation issued on : 1998-09-01 12:00:00
basicstation expires on : 2028-01-28 12:00:00
basicstation signed using : RSA with SHA1
basicstation RSA key size : 2048 bits
basicstation basic constraints : CA=true
basicstation key usage : Key Cert Sign, CRL Sign
basicstation 2024-10-04 05:23:56.875 [TCE:INFO] Connecting to INFOS: wss://localhost:8887
basicstation 2024-10-04 05:23:56.891 [AIO:INFO] TLS server certificate verification failed: The certificate is not correctly signed by the trusted CA
basicstation 2024-10-04 05:23:56.891 [AIO:DEBU] [4] WS connection shutdown…
basicstation 2024-10-04 05:23:56.892 [TCE:INFO] INFOS reconnect backoff 60s (retry 58)
basicstation 2024-10-04 05:24:56.958 [AIO:INFO] ./tc.trust:
basicstation cert. version : 3
basicstation serial number : 04:00:00:00:00:01:15:4B:5A:C3:94
basicstation issuer name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation subject name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation issued on : 1998-09-01 12:00:00
basicstation expires on : 2028-01-28 12:00:00
basicstation signed using : RSA with SHA1
basicstation RSA key size : 2048 bits
basicstation basic constraints : CA=true
basicstation key usage : Key Cert Sign, CRL Sign
basicstation 2024-10-04 05:24:56.958 [TCE:INFO] Connecting to INFOS: wss://localhost:8887
basicstation 2024-10-04 05:24:56.973 [AIO:INFO] TLS server certificate verification failed: The certificate is not correctly signed by the trusted CA
basicstation 2024-10-04 05:24:56.973 [AIO:DEBU] [4] WS connection shutdown…
basicstation 2024-10-04 05:24:56.974 [TCE:INFO] INFOS reconnect backoff 60s (retry 59)
basicstation 2024-10-04 05:25:57.041 [AIO:INFO] ./tc.trust:
basicstation cert. version : 3
basicstation serial number : 04:00:00:00:00:01:15:4B:5A:C3:94
basicstation issuer name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation subject name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation issued on : 1998-09-01 12:00:00
basicstation expires on : 2028-01-28 12:00:00
basicstation signed using : RSA with SHA1
basicstation RSA key size : 2048 bits
basicstation basic constraints : CA=true
basicstation key usage : Key Cert Sign, CRL Sign
basicstation 2024-10-04 05:25:57.041 [TCE:INFO] Connecting to INFOS: wss://localhost:8887
basicstation 2024-10-04 05:25:57.055 [AIO:INFO] TLS server certificate verification failed: The certificate is not correctly signed by the trusted CA
basicstation 2024-10-04 05:25:57.055 [AIO:DEBU] [4] WS connection shutdown…
basicstation 2024-10-04 05:25:57.056 [TCE:INFO] INFOS reconnect backoff 60s (retry 60)
basicstation 2024-10-04 05:26:57.122 [AIO:INFO] ./tc.trust:
basicstation cert. version : 3
basicstation serial number : 04:00:00:00:00:01:15:4B:5A:C3:94
basicstation issuer name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation subject name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation issued on : 1998-09-01 12:00:00
basicstation expires on : 2028-01-28 12:00:00
basicstation signed using : RSA with SHA1
basicstation RSA key size : 2048 bits
basicstation basic constraints : CA=true
basicstation key usage : Key Cert Sign, CRL Sign
basicstation 2024-10-04 05:26:57.122 [TCE:INFO] Connecting to INFOS: wss://localhost:8887
basicstation 2024-10-04 05:26:57.139 [AIO:INFO] TLS server certificate verification failed: The certificate is not correctly signed by the trusted CA
basicstation 2024-10-04 05:26:57.139 [AIO:DEBU] [4] WS connection shutdown…
basicstation 2024-10-04 05:26:57.139 [TCE:INFO] INFOS reconnect backoff 60s (retry 61)
basicstation 2024-10-04 05:27:57.205 [AIO:INFO] ./tc.trust:
basicstation cert. version : 3
basicstation serial number : 04:00:00:00:00:01:15:4B:5A:C3:94
basicstation issuer name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation subject name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation issued on : 1998-09-01 12:00:00
basicstation expires on : 2028-01-28 12:00:00
basicstation signed using : RSA with SHA1
basicstation RSA key size : 2048 bits
basicstation basic constraints : CA=true
basicstation key usage : Key Cert Sign, CRL Sign
basicstation 2024-10-04 05:27:57.205 [TCE:INFO] Connecting to INFOS: wss://localhost:8887
basicstation 2024-10-04 05:27:57.220 [AIO:INFO] TLS server certificate verification failed: The certificate is not correctly signed by the trusted CA
basicstation 2024-10-04 05:27:57.220 [AIO:DEBU] [4] WS connection shutdown…
basicstation 2024-10-04 05:27:57.221 [TCE:INFO] INFOS reconnect backoff 60s (retry 62)
basicstation 2024-10-04 05:28:57.286 [AIO:INFO] ./tc.trust:
basicstation cert. version : 3
basicstation serial number : 04:00:00:00:00:01:15:4B:5A:C3:94
basicstation issuer name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation subject name : C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
basicstation issued on : 1998-09-01 12:00:00
basicstation expires on : 2028-01-28 12:00:00
basicstation signed using : RSA with SHA1
basicstation RSA key size : 2048 bits
basicstation basic constraints : CA=true
basicstation key usage : Key Cert Sign, CRL Sign
basicstation 2024-10-04 05:28:57.287 [TCE:INFO] Connecting to INFOS: wss://localhost:8887
basicstation 2024-10-04 05:28:57.301 [AIO:INFO] TLS server certificate verification failed: The certificate is not correctly signed by the trusted CA
basicstation 2024-10-04 05:28:57.301 [AIO:DEBU] [4] WS connection shutdown…
basicstation 2024-10-04 05:28:57.302 [TCE:INFO] INFOS reconnect backoff 60s (retry 63)

Maybe @xoseperez can help here?

@rojasyal what devices are you using here?

UC-300 milesinght and T1000 tracker sensecap but the gateway en basic station does not conect