RAK2245 does not work with lora_gateway and lora_pkt_fwd

Hi everybody,

I connected a RAK2245 with a RPi 3B and my purpose is to forward LoRaWAN packets to a Network Server which I personally developed. So, nor TTN neither loraserver.io have been employed.

Basically, I exploit the lora_gateway library (https://github.com/Lora-net/lora_gateway) and the codes belonging to the packet_forwarder project (it can be found on Lora-net GitHub too). I correctly built the library and the lora_pkt_fwd. I also developed a bash script for the reset of the SX1301 via the GPIO17 of the RPi which I run before the execution of the lora_pkt_fwd. In addition, the global_conf.json has been correctly updated.

Such a project as well as the relative routines work very well with RAK831. Unfortunately, though, the lora_pkt_fwd cannot be executed when RAK2245 is employed since it throws the error “failed to start the concentrator”. Hence, I forced the code to execute the reset bash script whenever such an error occurs but the concentrator still cannot start (also this procedure works very well with the RAK831).

Does anyone have an idea on how I can get through?

Thank you all.

iot240

You probably need to reduce the SPI clock speed in the setup of the lora_gateway library.

Unfortunately, the new generation of concentrator cards have an entirely unnecessary SPI level shifter on them, and it is slow.

Try 1 MHz. You might be able to get 2, but start with 1 MHz and make sure that works.

And run the spi stress test in the lora library before you worry about running a packet forwarder.

@RAK please, please, please go back to designs like the RAK833 that didn’t have that level shifter slowing things down.

Hi @iot240
You have to reduce the SPI speed in loragw_spi.native.c to
#define SPI_SPEED 2000000
Compile, reboot and everything should start to work.
(https://github.com/RAKWireless/RAK2245-RAK831-LoRaGateway-RPi-Raspbian-OS/blob/master/lora/loragw_spi.native.c)

Regards,
Todor

Hi everybody,

Thank you for your valuable replies. I tried setting the SPI speed at 2 MHz and now everything works fine.

iot240

Thanks for the tip Chris.

I ran into the same problem even though the source now uses 2 MHz (the only way that I could get lora_pkt_fwd to run was to use CPU frequency scaling to reduce the CPU speed to minimum), so I reduced it to 1 MHz, which immediately solved the problem.