# Problems connecting LoRa basics station to TTN V3

**URL:** <https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768>\
**Category:** Project help\
**Created:** [May 19, 2021, 2:26pm UTC](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768 "2021-05-19T14:26:03Z")\
**Posts on this page:** 20\
**Page:** 5

<div class="post-metadata">

**Author:** ![GryKyo](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/grykyo/32/7268_2.png) [@GryKyo](https://forums.balena.io/u/GryKyo)\
**Post date:** [January 17, 2022, 12:07pm UTC](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768/108 "2022-01-17T12:07:26Z")

</div>

Hi Marc,  
This is a hardware trial using a Pi Zero 2 W with a RAK831 concentrator. I have had only good results with the 831 and 2245’s from RAK.

Here is an image from the TTS console. Gateway connected right away with the randomly generated EUI but for some reason the persistent EUI that is generated by the `start.sh` script is not the EUI submitted during registration? It seems to be a randomly generated 8 bytes each restart?

 ![TTS_1_2022-01-17](https://global.discourse-cdn.com/balena/original/2X/c/cf8b47aa1db10dd3c49724da083860c4e349d994.jpeg)

What do you think?

Garry

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [January 17, 2022, 12:30pm UTC](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768/109 "2022-01-17T12:30:46Z")

</div>

got it… probably you are getting a virtual mac interface @GryKyo i’m testing something to solve the problem!

BTW the RAK831 is a USB or SPI based concentrator?

---

<div class="post-metadata">

**Author:** ![GryKyo](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/grykyo/32/7268_2.png) [@GryKyo](https://forums.balena.io/u/GryKyo)\
**Post date:** [January 17, 2022, 12:35pm UTC](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768/110 "2022-01-17T12:35:50Z")

</div>

Thanks Marc.

It is the SPI version with a simple interface board. IIRC the PCB is possibly from Jak Kersing, I had this in service before with a RPI3  
In any case, the only new part here is the Pi Zero.

Garry

---

<div class="post-metadata">

**Author:** ![GryKyo](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/grykyo/32/7268_2.png) [@GryKyo](https://forums.balena.io/u/GryKyo)\
**Post date:** [January 20, 2022, 11:12am UTC](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768/111 "2022-01-20T11:12:24Z")

</div>

Do you have any ideas I can try Marc?

It would be nice to get a few weeks stable behaviour from this device, it may be deployed in Islas Canarias for next phase of testing, very remote deployment for an Irish man 😬

It would be nice to have the usual Balena robustness for remote management 😁

G

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [January 20, 2022, 11:24am UTC](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768/112 "2022-01-20T11:24:47Z")

</div>

Since yesterday I’m testing with my Raspberry Pi Zero 1 W @GryKyo

the system gives priority to the `sys/class/net/balena0/address` instead of `wlan0`. This is why we get different values as this interface is virtual. So EUI is not the same that we are trying to push on the `start.sh`.

I’m now deep diving on this [basicstation/sys\_linux.c at 54dbf22b1af440345bf852cbb8e801840dce1c89 · mpous/basicstation · GitHub](https://github.com/mpous/basicstation/blob/54dbf22b1af440345bf852cbb8e801840dce1c89/src-linux/sys_linux.c#L179)

let me know if you can help here to solve this issue. I will keep researching this afternoon 🙂

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [January 21, 2022, 2:56pm UTC](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768/114 "2022-01-21T14:56:31Z")

</div>

@GryKyo i made a PR on the `basicstation` repo and now it might work!

Test it and let me know if the `wlan0` is selected as `EUI` 🙂

---

<div class="post-metadata">

**Author:** ![GryKyo](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/grykyo/32/7268_2.png) [@GryKyo](https://forums.balena.io/u/GryKyo)\
**Post date:** [January 24, 2022, 9:51am UTC](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768/115 "2022-01-24T09:51:35Z")

</div>

Thanks again Marc, I will try this later and let you know.

---

<div class="post-metadata">

**Author:** ![GryKyo](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/grykyo/32/7268_2.png) [@GryKyo](https://forums.balena.io/u/GryKyo)\
**Post date:** [January 24, 2022, 7:26pm UTC](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768/116 "2022-01-24T19:26:12Z")

</div>

Yes, you have fixed it Marc, many thanks for your help. The main service is now  
named `basicstation`, it automatically constructs the correct gateway EUI with `FF FE` bytes inserted into the hardware MAC of the Pi Zero 2 W.

I have pinned to this release and have restarted the machine and it seems robust, automatically registers with TTS etc.

Many thanks again  
Garry

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [January 25, 2022, 7:57am UTC](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768/117 "2022-01-25T07:57:26Z")

</div>

Awesome @GryKyo 🙂

take into account that i introduced a new variable `EUI_ADDRESS` that if you leave it blank will show the `eth0` EUI and if you add `wlan0` will generate the `wlan0` EUI. That means that you can have a fleet on the same release only playing with the Fleet/Device Variables.

Let me know if that works for you and looking forward to see the gateways in Canary Island 🏝

---

<div class="post-metadata">

**Author:** ![GryKyo](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/grykyo/32/7268_2.png) [@GryKyo](https://forums.balena.io/u/GryKyo)\
**Post date:** [January 25, 2022, 1:52pm UTC](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768/118 "2022-01-25T13:52:27Z")

</div>

Thanks Marc. Actually I was curious enough (as an amateur) to try and see what magic dust you used! I had spotted the change I believe you made in `start.sh` as you mention here. A question I considered asking; can I unpin from a custom release and have the device evolve with basicstation main branch?

I currently have the only TTN gateway on Lanzarote, an indoor Things Industries gateway so not hard to find on a TTN map! Of the five remaining gateways/concentrators I have in Ireland I have this Pi Zero2 W is earmarked for Lanzarote with a good antenna. I will run it for 3-4 weeks more to test, but the Pi Zero2 W appears to handle the task well and is running circa 24° above ambient with no cooling at all. I think this will work well and management on [Balena.io](http://Balena.io) is really good.

Thanks again for your help in solving this, I will put a post here once it is live in Islas Canarias!

Garry

---

<div class="post-metadata">

**Author:** ![n8bradshaw](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@n8bradshaw](https://forums.balena.io/u/n8bradshaw)\
**Post date:** [January 27, 2022, 7:43pm UTC](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768/119 "2022-01-27T19:43:10Z")

</div>

Hello,  
I am having trouble connecting my RAK2245 to the TTN V3. This is my first device for the Things network and I have followed all the steps to get the Gateway up and running but I have ran into a few issues.

The device connects to the network and the quickly disconnects.

```auto
flash_off
13:42:40
Disconnect gateway
network_check
13:42:40
Receive gateway status

Versions
    firmware"1.0.0"package"1.0.0"platform"rpi - Firmware 1.0.0 - Protocol 2"station"2.0.5(rpi/std)"

flash_on
13:42:40
Connect gateway
flash_off
13:42:28
Disconnect gateway
network_check
13:42:28
Receive gateway status

Versions
    firmware"1.0.0"package"1.0.0"platform"rpi - Firmware 1.0.0 - Protocol 2"station"2.0.5(rpi/std)"

flash_on
13:42:28
Connect gateway
flash_off
13:42:17
Disconnect gateway

```

```auto
icstation issuer name : O=Digital Signature Trust Co., CN=DST Root CA X3
 basicstation subject name : O=Digital Signature Trust Co., CN=DST Root CA X3
 basicstation issued on : 2000-09-30 21:12:19
 basicstation expires on : 2021-09-30 14:01:15
 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 2022-01-27 19:38:25.777 [AIO:INFO] tc has no cert configured - running server auth and client auth with token
 basicstation 2022-01-27 19:38:25.830 [TCE:VERB] Connecting to MUXS...
 basicstation 2022-01-27 19:38:26.522 [TCE:VERB] Connected to MUXS.
 basicstation 2022-01-27 19:38:26.579 [RAL:INFO] Lora gateway library version: Version: 5.0.1;
 basicstation 2022-01-27 19:38:26.580 [RAL:VERB] Connecting to device: /dev/spidev0.0
 basicstation 2022-01-27 19:38:26.580 [RAL:DEBU] SX130x txlut table (0 entries)
 basicstation 2022-01-27 19:38:26.580 [RAL:VERB] SX1301 rxrfchain 0: enable=1 freq=904.3MHz rssi_offset=-166.000000 type=2 tx_enable=1 tx_notch_freq=0
 basicstation 2022-01-27 19:38:26.580 [RAL:VERB] SX1301 rxrfchain 1: enable=1 freq=905.0MHz rssi_offset=-166.000000 type=2 tx_enable=0 tx_notch_freq=0
 basicstation 2022-01-27 19:38:26.580 [RAL:VERB] SX1301 ifchain 0: enable=1 rf_chain=0 freq=-400000 bandwidth=0 datarate=0 sync_word=0/0
 basicstation 2022-01-27 19:38:26.580 [RAL:VERB] SX1301 ifchain 1: enable=1 rf_chain=0 freq=-200000 bandwidth=0 datarate=0 sync_word=0/0
 basicstation 2022-01-27 19:38:26.580 [RAL:VERB] SX1301 ifchain 2: enable=1 rf_chain=0 freq=0 bandwidth=0 datarate=0 sync_word=0/0
 basicstation 2022-01-27 19:38:26.580 [RAL:VERB] SX1301 ifchain 3: enable=1 rf_chain=0 freq=200000 bandwidth=0 datarate=0 sync_word=0/0
 basicstation 2022-01-27 19:38:26.580 [RAL:VERB] SX1301 ifchain 4: enable=1 rf_chain=1 freq=-300000 bandwidth=0 datarate=0 sync_word=0/0
 basicstation 2022-01-27 19:38:26.580 [RAL:VERB] SX1301 ifchain 5: enable=1 rf_chain=1 freq=-100000 bandwidth=0 datarate=0 sync_word=0/0
 basicstation 2022-01-27 19:38:26.580 [RAL:VERB] SX1301 ifchain 6: enable=1 rf_chain=1 freq=100000 bandwidth=0 datarate=0 sync_word=0/0
 basicstation 2022-01-27 19:38:26.580 [RAL:VERB] SX1301 ifchain 7: enable=1 rf_chain=1 freq=300000 bandwidth=0 datarate=0 sync_word=0/0
 basicstation 2022-01-27 19:38:26.580 [RAL:VERB] SX1301 ifchain 8: enable=1 rf_chain=0 freq=300000 bandwidth=1 datarate=4 sync_word=0/0
 basicstation 2022-01-27 19:38:26.580 [RAL:VERB] SX1301 ifchain 9: enable=0 rf_chain=0 freq=0 bandwidth=0 datarate=0 sync_word=0/0
 basicstation 2022-01-27 19:38:26.580 [RAL:VERB] SX130x LBT not enabled
 basicstation 2022-01-27 19:38:26.580 [RAL:VERB] Station device: /dev/spidev0.0 (PPS capture disabled)
 basicstation 2022-01-27 19:38:26.583 [RAL:ERRO] Concentrator start failed: lgw_start
 basicstation 2022-01-27 19:38:26.583 [RAL:ERRO] ral_config failed with status 0x08
 basicstation 2022-01-27 19:38:26.583 [any:ERRO] Closing connection to muxs - error in s2e_onMsg
 basicstation 2022-01-27 19:38:26.583 [AIO:DEBU] [3] ws_close reason=1000
 basicstation 2022-01-27 19:38:26.583 [AIO:DEBU] Echoing close - reason=1000
 basicstation 2022-01-27 19:38:26.640 [AIO:DEBU] [3|WS] Server sent close: reason=1000
 basicstation 2022-01-27 19:38:26.640 [AIO:DEBU] [3] WS connection shutdown...
 basicstation 2022-01-27 19:38:26.640 [TCE:VERB] Connection to MUXS closed in state -1
 basicstation 2022-01-27 19:38:26.640 [TCE:INFO] INFOS reconnect backoff 10s (retry 1)

```

I’ve looked at many examples of people with this same problem and haven’t been able to get it solved on my end. Any help on this problem would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [January 27, 2022, 9:02pm UTC](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768/120 "2022-01-27T21:02:31Z")

</div>

Hello @n8bradshaw welcome to the balena community!

> [@n8bradshaw](#):
>
> `Concentrator start failed: lgw_start`

this error is a mess! it’s usually related to issues on the spi connectivity.

Could you please share the Device Variables that you have defined on your fleet? Thanks

---

<div class="post-metadata">

**Author:** ![n8bradshaw](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@n8bradshaw](https://forums.balena.io/u/n8bradshaw)\
**Post date:** [January 28, 2022, 8:59pm UTC](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768/121 "2022-01-28T20:59:13Z")

</div>

Hey! thank you for responding, I eventually got it figured out. I’ll be honest, I am not sure what I did to get it to work. After I got it to work, I moved to working on starting the Things Stack in balena with LoRa basics station. I am still working on getting it all set up, but I’ll let you know if I have anymore questions. Thank you!

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [January 29, 2022, 3:25pm UTC](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768/122 "2022-01-29T15:25:35Z")

</div>

Hey @n8bradshaw

> [@n8bradshaw](#):
>
> I eventually got it figured out. I’ll be honest, I am not sure what I did to get it to work.

Happy you made it work! this is the reset of the SPI, sometimes it’s not properly reset! don’t ask me why 😛

> [@n8bradshaw](#):
>
> I moved to working on starting the Things Stack in balena with LoRa basics station. I am still working on getting it all set up

do you have any problem?

let me know how it works on your side 🙂

---

<div class="post-metadata">

**Author:** ![n8bradshaw](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@n8bradshaw](https://forums.balena.io/u/n8bradshaw)\
**Post date:** [January 31, 2022, 3:35pm UTC](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768/123 "2022-01-31T15:35:54Z")

</div>

Hello,  
I think I have everything connected correctly, but I am not seeing any output from the gateway device (RAK2245) in the things stack console. I am using the balena things stack with basic station activated The logs don’t appear to have any errors, except for a time sync message that I keep getting…

 ![image](https://global.discourse-cdn.com/balena/original/2X/e/e0fca6333c79585247e9b64096e07ec8ff627096.png)

Do you have any idea of what is keeping the gateway from connecting?

---

<div class="post-metadata">

**Author:** ![n8bradshaw](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@n8bradshaw](https://forums.balena.io/u/n8bradshaw)\
**Post date:** [January 31, 2022, 4:57pm UTC](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768/124 "2022-01-31T16:57:33Z")

</div>

I figured out the issue I forgot to write down the gw\_EUI, once I added that, the gateway started to work. Now the issue that I am running into is that the end devices that I set up aren’t showing in the application side of the things stack.  
EDIT: I got the problem worked out. I had the device previously connected to TTN and i needed to wait a little while after deleting it for it to work locally.

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [February 1, 2022, 10:30am UTC](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768/125 "2022-02-01T10:30:39Z")

</div>

That’s great news @n8bradshaw

Looking forward to get more insights and feedback from you 🙂

---

<div class="post-metadata">

**Author:** ![n8bradshaw](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@n8bradshaw](https://forums.balena.io/u/n8bradshaw)\
**Post date:** [February 1, 2022, 3:03pm UTC](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768/126 "2022-02-01T15:03:25Z")

</div>

hey @mpous,  
I am working on a completely local LoRaWAN service. I would like to be able to send the data from the things stack to another balena process, would you recommend running a webhook or mqtt service along side the balena things stack service, or is there a better way to go about this problem that I am not thinking of?

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [February 1, 2022, 4:23pm UTC](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768/127 "2022-02-01T16:23:52Z")

</div>

@n8bradshaw that’s great!

i did this but i never tested this seriously! so just give it a try and feel free to PR on your repo 🙂

> <https://github.com/mpous/the-things-stack-basicstation-influxdb-grafana-balena/blob/master/docker-compose-nodered.yml>

---

<div class="post-metadata">

**Author:** ![cem26](https://avatars.discourse-cdn.com/v4/letter/c/ee59a6/32.png) [@cem26](https://forums.balena.io/u/cem26)\
**Post date:** [March 25, 2022, 12:28am UTC](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768/129 "2022-03-25T00:28:29Z")

</div>

Hello. I’m trying to make a lorawan gateway using the raspberry pi 3b and rak2245 HAT. However, I get this error.  
basicstation 2022-03-25 00:24:25.872 [any:INFO] ./tc.trust:  
basicstation cert. version : 3  
basicstation serial number : 44:AF:B0:80:D6:A3:27:BA:89:30:39:86:2E:F8:40:6B  
basicstation issuer name : O=Digital Signature Trust Co., CN=DST Root CA X3  
basicstation subject name : O=Digital Signature Trust Co., CN=DST Root CA X3  
basicstation issued on : 2000-09-30 21:12:19  
basicstation expires on : 2021-09-30 14:01:15  
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 2022-03-25 00:24:25.872 [AIO:INFO] tc has no cert configured - running server auth and client auth with token  
basicstation 2022-03-25 00:24:25.902 [TCE:INFO] Connecting to INFOS: wss://eu1.cloud.thethings.network:8887  
basicstation 2022-03-25 00:24:26.047 [TCE:ERRO] Infos error: ::0 Failed to fetch gateway: error:pkg/gatewayserver:gateway\_eui\_not\_registered (gateway EUI `XXXXXXXXXXXXXXXX` is not registered)  
basicstation 2022-03-25 00:24:26.047 [AIO:DEBU] [3] ws\_close reason=1000  
basicstation 2022-03-25 00:24:26.047 [AIO:ERRO] Recv failed: SSL - The peer notified us that the connection is going to be closed  
basicstation 2022-03-25 00:24:26.047 [AIO:DEBU] [3] WS connection shutdown…  
basicstation 2022-03-25 00:24:26.048 [TCE:INFO] INFOS reconnect backoff 60s (retry 72)

This is the repository that I have used [GitHub - mpous/basicstation: LoRa Basics™ Station - The LoRaWAN Gateway Software](https://github.com/mpous/basicstation).  
Any help would be appreciated.

[Previous page](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768.md?page=4)

[Next page](https://forums.balena.io/t/problems-connecting-lora-basics-station-to-ttn-v3/318768.md?page=6)
