Issue:
The Lora Packet Forwarder now runs for about 4 hours before it stops with errors:
lgw_setup_sx125x:407: Note: SX125x #0 version register returned 0x60 (see below sudo ./util_spi_stress)
lgw_setup_sx125x:415: Note: SX125x #0 clock output disabled
lgw_setup_sx125x:469: Note: SX125x #0 PLL start (attempt 1)
lgw_setup_sx125x:469: Note: SX125x #0 PLL start (attempt 2)
lgw_setup_sx125x:469: Note: SX125x #0 PLL start (attempt 3)
lgw_setup_sx125x:469: Note: SX125x #0 PLL start (attempt 4)
lgw_setup_sx125x:469: Note: SX125x #0 PLL start (attempt 5)
FAIL TO LOCK PLL
Failed to setup sx125x radio for RF chain 0
I runned the sudo ./util_spi_stress with this output:
Cycle 0 > error during the 1th iteration: write 0x67, read 0x60
Repeat read of target register: 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60
I can see in the code a random number is send (i.e 0x67 and 0x60 is returned.)
Setup:
I followed the steps from:
Quickstart page for the link see bel
Server:
RaspberryPI zero (PI 3) with SLES15.2
Details:
I try to install this module and can’t get the Lora Packet Forwarder to work.
I’ve following 2 steps. (see below for details)
1 Adapting install.sh to get the Lora Packet Forwarder installed.
2 Adapting installation files to get the Lora Packet Forwarder to run
1 Adapting install.sh to get the Lora Packet Forwarder installed
I followed the steps from:
(It was a slightly older page that got obsolete at 10 oct, I checked the difference.
NOTE: (on this page)
“If you want to connect the RAK2247 mPCIe board to the Linux PC directly, make sure to have the PERST# signal (Pin 22) pulled down.”
I did not know how to accomplish this, but read that is was taken care of by the software(loragw_spi.ftdi.c#L75):
a) I changed the install.sh to match Sles15.2
Changed:
apt-get -y install git libftdi-dev libusb-dev
To:
zypper install -y git libgcrypt-devel glib2-devel
b) In install gcc and make (needed by install.sh)
sudo zypper install gcc
sudo zypper install make
c) error: missing libftdi header files
No provider of ‘libftdi’ found
sudo zypper install libftdi0-devel
d) error: /usr/include/usb.h:81:2: unknown type name ‘u_int8_t’ u_int8_t bLength;
/usr/include/usb.h:184:2: error: unknown type name ‘u_int16_t’ u_int16_t bcdDevice;
sudo nano /usr/include/usb.h
#include <sys/types.h>
e) error: ‘PATH_MAX’ undeclared here (not in a function); did you mean ‘INT8_MAX’?
char filename[PATH_MAX + 1];
sudo nano /usr/include/usb.h
changed #include <limits.h> to #include <linux/limits.h>
2 Adapting installation files to get the Lora Packet Forwarder to run
ERROR: [main] failed to start the concentrator
f) Changed library.cfg to activate debug messages
DEBUG_HAL= 1
ERROR: FAIL TO CONNECT BOARD
Error in loragw_hal.c from functie lgw_connect();
lgw_connect is from loragw_reg.c
DEBUG_REG= 1
ERROR CONNECTING CONCENTRATOR
Error in loragw_reg.c from functie lgw_spi_open();
lgw_spi_open from loragw_spi.h used in:
loragw_spi.native.c en loragw_spi.ftdi.c
DEBUG_SPI= 1
ERROR: MPSSE OPEN FUNCTION FAILED
Error in loragw_spi.ftdi.c OpenIndex(VID,PID,SPI0, SIX_MHZ, MSB, IFACE_A, NULL, NULL, 0);
Error in OpenIndex() zit in mpsse.c
Seems that VID and PID are differend from what found with lsusb command.
lsusb: Bus 001 Device 004: ID 0403:6015 Future Technology Devices International, Ltd Bridge
Changed in loragw_spi.ftdi.c:
/* — PRIVATE CONSTANTS ---------------------------------------------------- /
/ parameters for a FT2232H */ changed to ->> FT2245
#define VID 0x0403
#define PID 0x6010 changed to ->> 0x6015
Now for the first time the package forwarder starts but stop with two errors:
ID: 0x6015
VID: 0x0403
clock: 6000000
Libmpsse version: 0x13
Note: SPI read success
lgw_connect:532: INFO: no FPGA detected or version not supported (v96)
Note: SPI read success
lgw_connect:555: ERROR: NOT EXPECTED CHIP VERSION (v96)
g) Try different things (suggestion I got form Internet search)
Adapt speed in loragw_spi.ftdi.c naar TWO_MHZ and ONE_MHZ
mpsse = OpenIndex(VID,PID,SPI0, SIX_MHZ, MSB, IFACE_A, NULL, NULL, 0);
NO difference
h) Adapt in rak2247_usb/libmpsse/src/mpsse.c to add the rak2247 to List of known FT2232-based devices
NO difference
i) Finally I put in printf() commando to see what values where expected in stead of the (V96) above, and adapted the install files with that values:
Adapt loragw_reg.c (Adapt install.sh to copy my version after git clone)
Adapt:
const uint8_t FPGA_VERSION = { 31, 33 }; /* several versions could be supported /
To:
const uint8_t FPGA_VERSION[] = { 31, 33, 96 }; / several versions could be supported */
This error was gone:
lgw_connect:532: INFO: no FPGA detected or version not supported (v96)
j) Adapt loragw_reg.c (install.sh is already adapted to copy my version after git clone)
Adapt:
On the third line of the register in this file
{-1,1,0,0,8,1,103}, /* VERSION /
To:
{-1,1,0,0,8,1,96}, / VERSION */
Now the package forwarder starts but stop after several hours, in the meanwhile put some messages on the screen:
l) lgw_fpga_configure:138: WARNING: FPGA TX notch frequency is out
of range (0 - [126000…250000]), setting it to default (129000)
Solve in global_conf.json added:
–>> “tx_notch_freq”: 129000,
m) lgw_setup_sx125x:407: Note: SX125x #0 version register returned
0x60 (see below sudo ./util_spi_stress)
n) lgw_setup_sx125x:415: Note: SX125x #0 clock output disabled
o) lgw_setup_sx125x:469: Note: SX125x #0 PLL start (attempt 1)
lgw_setup_sx125x:469: Note: SX125x #0 PLL start (attempt 2)
lgw_setup_sx125x:469: Note: SX125x #0 PLL start (attempt 3)
lgw_setup_sx125x:469: Note: SX125x #0 PLL start (attempt 4)
lgw_setup_sx125x:469: Note: SX125x #0 PLL start (attempt 5)
FAIL TO LOCK PLL
p) Failed to setup sx125x radio for RF chain 0
I runned the sudo ./util_spi_stress with this output:
Cycle 0 > error during the 1th iteration: write 0x67, read 0x60
Repeat read of target register: 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60
I Can see in the code a random number is send (i.e 0x67 and 0x60 is returned.