Compiling lora_gateway for RAK7249

(.) #1

Hi,

I’m trying to compile and run the lora_gateway tools for the RAK7249 platform. I’m using the OpenWrt SDK found on the Document Download page to cross-compile. The following logs contain output from the default applications compiled with all debug flags enabled and SPI_DEV_PATH set to “/dev/spidev32766.1”.

test_loragw_spi manage to read and write:

[email protected]:~# ./test_loragw_spi
Beginning of test for loragw_spi.c
Note: SPI port opened and configured ok
WARNING: SPI address > 127
Note: SPI write success
Note: SPI read success
lgw_spi_wb:310: BURST WRITE: to trans 16 # chunk 16 # transferred 16
Note: SPI burst write success
lgw_spi_rb:372: BURST READ: to trans 16 # chunk 16 # transferred 16
Note: SPI burst read success
lgw_spi_wb:310: BURST WRITE: to trans 2500 # chunk 1024 # transferred 1024
lgw_spi_wb:310: BURST WRITE: to trans 1476 # chunk 1024 # transferred 2048
lgw_spi_wb:310: BURST WRITE: to trans 452 # chunk 452 # transferred 2500
Note: SPI burst write success
lgw_spi_rb:372: BURST READ: to trans 2500 # chunk 1024 # transferred 1024
lgw_spi_rb:372: BURST READ: to trans 1476 # chunk 1024 # transferred 2048
lgw_spi_rb:372: BURST READ: to trans 452 # chunk 452 # transferred 2500
Note: SPI burst read success
Note: SPI read success
data received (simple read): 0
Note: SPI port closed
End of test for loragw_spi.c

However, all applicatons using lgw_connect complain about the chip version and exit:

ro[email protected]:~# ./test_loragw_reg
Beginning of test for loragw_reg.c
Note: SPI port opened and configured ok
Note: SPI read success
lgw_connect:532: INFO: no FPGA detected or version not supported (v103)
Note: SPI read success
lgw_connect:555: ERROR: NOT EXPECTED CHIP VERSION (v0 != v103)
ERROR: CONCENTRATOR UNCONNECTED
ERROR: CONCENTRATOR UNCONNECTED
ERROR: CONCENTRATOR UNCONNECTED
ERROR: CONCENTRATOR UNCONNECTED
ERROR: CONCENTRATOR UNCONNECTED
IMPLICIT_PAYLOAD_LENGHT = 2004566944 (should be 197)
ERROR: CONCENTRATOR UNCONNECTED
ERROR: CONCENTRATOR UNCONNECTED
FRAME_SYNCH_PEAK2_POS = 2004566944 (should be 11)
ERROR: CONCENTRATOR UNCONNECTED
ERROR: CONCENTRATOR UNCONNECTED
PREAMBLE_SYMB1_NB = 2004566944 (should be 49253)
ERROR: CONCENTRATOR UNCONNECTED
ERROR: CONCENTRATOR UNCONNECTED
ADJUST_MODEM_START_OFFSET_SF12_RDX4 = 2004566944 (should be 3173)
ERROR: CONCENTRATOR UNCONNECTED
ERROR: CONCENTRATOR UNCONNECTED
IF_FREQ_1 = 2004566944 (should be -1947)
ERROR: CONCENTRATOR UNCONNECTED
ERROR: CONCENTRATOR UNCONNECTED
Note: SPI port closed
Note: success disconnecting the concentrator
End of test for loragw_reg.c
  • I use this OpenWrt package.
  • Lower SPI speed did not solve the problem.
  • The default applications (test_loragw_reg, etc) from the firmware image (1.1.0035_Release r150 20190329) works correctly.
  • The base feed in the SDK (svn://39.106.204.135/IoT-Gateway/wrt) is user/password protected. Maybe a RAK7249 specific lora-gateway package might be found here?

So what am I missing?

(yutao) #2

You can try to compile your software using this SDK: http://docs.rakwireless.com/en/LoRa/DIY-Gateway-RAK7249/Software-Development/OpenWrt-SDK_for_DIY_Gateway_RAK7249.tar.bz2
This SDK provides a cross-compilation toolchain and the necessary libraries. Please use libloragw.a in the SDK as your LoRa HAL Library.

In addition, How did you get the svn address?

(.) #3

I found the SVN address in the feeds.conf.default file from the SDK that you linked.

Would it be possible to get access to the complete OpenWRT build system for RAK7249?