Connection problem to TTN server using BasicStation

Hi guys,

I can connect my gateway to TTN server using lora_pkt_forwarder package but , i could not connect using basicstation. I face error below.

And i see datas below on live data section on ttn server simultaneously.

  • 10:22:09 Disconnect gateway

  • 10:22:09 Receive gateway status

  • 10:22:09 Connect gateway

  • 10:21:57 Disconnect gateway

Hello,
can you tell us what device and OS version you are using?

i use onion omega device and openwrt

Thank you

I’m assuming you are using an SX1301-based concentrator, maybe an RAK2247 or RAK2245. Given the error (SPI READ FAILURE) I would check several things, in order:

  • lower the SPI bus speed to 2000000 (2MHz instead of 8MHz), see if the LORAGW_SPI_SPEED env variable is available
  • double check the device is connected to /dev/spidev0.1
  • double check the reset GPIO is 41

Thanks for quick response,

Yes i use rak2247. Device is connected to spidev0.1 and GPIO41 is reset pin.

I can connect my gateway to server, if i use udp packet forwarder.
When i tried to use with basic station, i faced this error.

is the only way try to 2Mhz spi speed ?

I would certainly try that. In my experience SX1301 concentrators struggle at 8MHz. Official basicstation code has the option to change the SPI speed via a environment variable, see:

https://github.com/lorabasics/basicstation/blob/ba4f85d80a438a5c2b659e568cd2d0f0de08e5a7/deps/lgw/v5.0.1-linux.patch#L981-L984

Should be as simple as: LORAGW_SPI_SPEED=2000000 /<path-to-binary>/station

Unfortunetaly, i face still same error.

@xoseperez i also tried test_loragw_spi package on my board and i face spi read failure.

I guess the problem is about using loragw library because Basic station also use this module.

But UPD packet forwarder also uses that library since that is the HAL for the SX1301.

Not sure what is going on here but since you said UDP packet forwarder was working OK for you I’d check that again to see what differences are there (library version? reset GPIO, SPI port,…)

1 Like

I share with you packet forwarder log screen, maybe it can help you.

At the same time RX_LED on rak2247 module has been lighting up.

There is little information there :sweat_smile:

Can you share the code you are building and running there (maybe a link to the sources)? And the modifications you did to it if any?

Actually this part of project already done when i started. I also built pkt_forwarder but i did not need to use instead of this since i started.

I will try pkt_forwarder built by me, if it works i will share details. :slightly_smiling_face:

Connection fail,

I might be wrong since I don’t have experience with the Omega board, but according to the documentation there is no GPIO41… (Onion Omega2 | Onion Omega2 Documentation).

Hi @xoseperez i guess i found what must do, but i don’t know how to do.

I must modify libloragw library for my own hardware.
i.e #define SPI_DEV_PATH spidev0.1 and there are a few more like this.

How to modify before basicstation scripts pull the library from git ?

Usually by applying a patch right after pulling the code from Github. You can see this approach here: https://github.com/xoseperez/basicstation/blob/b8f5801c553b261936552eaf4fa8731f41017933/builder/build.sh#L11-L23

Hi @xoseperez

I create and apply patch file but still same error :frowning:

How will i continue, any suggestion?

Not really… not sure what else to test. This error usually happens when the concentrator is not properly reset and that depends on the RESET_GPIO. If that’s OK it could be the concentrator type (corecell or not corecell), the port (/dev/spidev0.1 in your case) or maybe the concentrator stopped working…

@xoseperez

I added new patch file to configure loragw library then basicstation works properly. Thanks for your all help. I have another issue btw :slight_smile:

I can connect to ttn server using basicstation or udp_packet_forwarder but cannot connect to chirpstack server using basicstation and chirpstack gateway bridge. I do not know how to modify basicstation files and gateway bridge.toml for this.

If you have experience, please guide me

From your UDP packet broker you just have to set the server to the IP or nomain name where the ChirpStack Gateway Bridge is running. The Bridge should be connected to the same MQTT broker the Network Server is connected to.
For Basic Station it’s a little more involved since you have to have a TLS certificate and key and a CA certificate (a known own or a self signed one).

There are quite a few options here to configure. I recommend you to read the documentation on the Bridge (Introduction - ChirpStack open-source LoRaWAN<sup>®</sup> Network Server) and also check out your current configuration (you can get it by running chirpstack-gateway-bridge configfile on the machine the bridge is running.