Problems connecting LoRa basics station to TTN V3

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?

What do you think?

Garry

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?

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

1 Like

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

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

G

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

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

1 Like

@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 :slight_smile:

1 Like

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

1 Like

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

1 Like

Awesome @GryKyo :slight_smile:

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

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

1 Like

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.

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

1 Like

Hello @n8bradshaw welcome to the balena community!

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

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!

1 Like

Hey @n8bradshaw

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

do you have any problem?

let me know how it works on your side :slight_smile:

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…

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

1 Like

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.

1 Like

That’s great news @n8bradshaw

Looking forward to get more insights and feedback from you :slight_smile:

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?

1 Like

@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 :slight_smile:

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.
Any help would be appreciated.

1 Like