RAK831 + ftdi + ubuntu



  • Hi @KhaiNguyen

    Can you share the error output from make tool here. I'll have a look through the logs for you.

    Regards
    Naresh K



  • Thank you for your reply!

    You can find the error logs here. Please note that I cloned the whole packet_forwarder directory from https://github.com/Lora-net/packet_forwarder.git, because when I added just folder lora_pkt_fwd, make command couldn't find out file libraries.cfg

    gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -D VERSION_STRING=""cat ../VERSION"" -I../../lora_gateway/libloragw/inc src/lora_pkt_fwd.c -o obj/lora_pkt_fwd.o
    src/lora_pkt_fwd.c: In function ‘parse_SX1301_configuration’:
    src/lora_pkt_fwd.c:284:29: error: storage size of ‘boardconf’ isn’t known
    struct lgw_conf_board_s boardconf;
    ^
    src/lora_pkt_fwd.c:285:27: error: storage size of ‘lbtconf’ isn’t known
    struct lgw_conf_lbt_s lbtconf;
    ^
    src/lora_pkt_fwd.c:324:9: warning: implicit declaration of function ‘lgw_board_setconf’ [-Wimplicit-function-declaration]
    if (lgw_board_setconf(boardconf) != LGW_HAL_SUCCESS) {
    ^
    src/lora_pkt_fwd.c:365:26: error: ‘LBT_CHANNEL_FREQ_NB’ undeclared (first use in this function)
    if (i >= LBT_CHANNEL_FREQ_NB)
    ^
    src/lora_pkt_fwd.c:365:26: note: each undeclared identifier is reported only once for each function it appears in
    src/lora_pkt_fwd.c:393:17: warning: implicit declaration of function ‘lgw_lbt_setconf’ [-Wimplicit-function-declaration]
    if (lgw_lbt_setconf(lbtconf) != LGW_HAL_SUCCESS) {
    ^
    src/lora_pkt_fwd.c:415:30: error: invalid application of ‘sizeof’ to incomplete type ‘struct lgw_tx_gain_lut_s’
    memset(&txlut, 0, sizeof txlut); /* initialize configuration structure /
    ^
    src/lora_pkt_fwd.c:416:21: error: ‘TX_GAIN_LUT_SIZE_MAX’ undeclared (first use in this function)
    for (i = 0; i < TX_GAIN_LUT_SIZE_MAX; i++) {
    ^
    src/lora_pkt_fwd.c:423:9: error: invalid use of undefined type ‘struct lgw_tx_gain_lut_s’
    txlut.size++; /
    update TX LUT size based on JSON object found in configuration file /
    ^
    src/lora_pkt_fwd.c:428:13: error: invalid use of undefined type ‘struct lgw_tx_gain_lut_s’
    txlut.lut[i].pa_gain = (uint8_t)json_value_get_number(val);
    ^
    src/lora_pkt_fwd.c:431:13: error: invalid use of undefined type ‘struct lgw_tx_gain_lut_s’
    txlut.lut[i].pa_gain = 0;
    ^
    src/lora_pkt_fwd.c:436:13: error: invalid use of undefined type ‘struct lgw_tx_gain_lut_s’
    txlut.lut[i].dac_gain = (uint8_t)json_value_get_number(val);
    ^
    src/lora_pkt_fwd.c:438:13: error: invalid use of undefined type ‘struct lgw_tx_gain_lut_s’
    txlut.lut[i].dac_gain = 3; /
    This is the only dac_gain supported for now /
    ^
    src/lora_pkt_fwd.c:443:13: error: invalid use of undefined type ‘struct lgw_tx_gain_lut_s’
    txlut.lut[i].dig_gain = (uint8_t)json_value_get_number(val);
    ^
    src/lora_pkt_fwd.c:446:13: error: invalid use of undefined type ‘struct lgw_tx_gain_lut_s’
    txlut.lut[i].dig_gain = 0;
    ^
    src/lora_pkt_fwd.c:451:13: error: invalid use of undefined type ‘struct lgw_tx_gain_lut_s’
    txlut.lut[i].mix_gain = (uint8_t)json_value_get_number(val);
    ^
    src/lora_pkt_fwd.c:454:13: error: invalid use of undefined type ‘struct lgw_tx_gain_lut_s’
    txlut.lut[i].mix_gain = 0;
    ^
    src/lora_pkt_fwd.c:459:13: error: invalid use of undefined type ‘struct lgw_tx_gain_lut_s’
    txlut.lut[i].rf_power = (int8_t)json_value_get_number(val);
    ^
    src/lora_pkt_fwd.c:462:13: error: invalid use of undefined type ‘struct lgw_tx_gain_lut_s’
    txlut.lut[i].rf_power = 0;
    ^
    src/lora_pkt_fwd.c:466:5: error: invalid use of undefined type ‘struct lgw_tx_gain_lut_s’
    if (txlut.size > 0) {
    ^
    src/lora_pkt_fwd.c:467:9: error: invalid use of undefined type ‘struct lgw_tx_gain_lut_s’
    MSG("INFO: Configuring TX LUT with %u indexes\n", txlut.size);
    ^
    src/lora_pkt_fwd.c:468:13: warning: implicit declaration of function ‘lgw_txgain_setconf’ [-Wimplicit-function-declaration]
    if (lgw_txgain_setconf(&txlut) != LGW_HAL_SUCCESS) {
    ^
    src/lora_pkt_fwd.c:499:19: error: ‘struct lgw_conf_rxrf_s’ has no member named ‘rssi_offset’
    rfconf.rssi_offset = (float)json_object_dotget_number(conf_obj, param_name);
    ^
    src/lora_pkt_fwd.c:503:23: error: ‘struct lgw_conf_rxrf_s’ has no member named ‘type’
    rfconf.type = LGW_RADIO_TYPE_SX1255;
    ^
    src/lora_pkt_fwd.c:503:31: error: ‘LGW_RADIO_TYPE_SX1255’ undeclared (first use in this function)
    rfconf.type = LGW_RADIO_TYPE_SX1255;
    ^
    src/lora_pkt_fwd.c:505:23: error: ‘struct lgw_conf_rxrf_s’ has no member named ‘type’
    rfconf.type = LGW_RADIO_TYPE_SX1257;
    ^
    src/lora_pkt_fwd.c:505:31: error: ‘LGW_RADIO_TYPE_SX1257’ undeclared (first use in this function)
    rfconf.type = LGW_RADIO_TYPE_SX1257;
    ^
    src/lora_pkt_fwd.c:512:23: error: ‘struct lgw_conf_rxrf_s’ has no member named ‘tx_enable’
    rfconf.tx_enable = (bool)json_value_get_boolean(val);
    ^
    src/lora_pkt_fwd.c:513:27: error: ‘struct lgw_conf_rxrf_s’ has no member named ‘tx_enable’
    if (rfconf.tx_enable == true) {
    ^
    src/lora_pkt_fwd.c:524:27: error: ‘struct lgw_conf_rxrf_s’ has no member named ‘tx_notch_freq’
    rfconf.tx_notch_freq = (uint32_t)json_object_dotget_number(conf_obj, param_name);
    ^
    src/lora_pkt_fwd.c:527:23: error: ‘struct lgw_conf_rxrf_s’ has no member named ‘tx_enable’
    rfconf.tx_enable = false;
    ^
    In file included from src/lora_pkt_fwd.c:50:0:
    src/lora_pkt_fwd.c:529:155: error: ‘struct lgw_conf_rxrf_s’ has no member named ‘rssi_offset’
    MSG("INFO: radio %i enabled (type %s), center frequency %u, RSSI offset %f, tx enabled %d, tx_notch_freq %u\n", i, str, rfconf.freq_hz, rfconf.rssi_offset, rfconf.tx_enable, rfconf.tx_notch_f
    ^
    inc/trace.h:27:29: note: in definition of macro ‘MSG’
    #define MSG(args...) printf(args) /
    message that is destined to the user /
    ^
    src/lora_pkt_fwd.c:529:175: error: ‘struct lgw_conf_rxrf_s’ has no member named ‘tx_enable’
    MSG("INFO: radio %i enabled (type %s), center frequency %u, RSSI offset %f, tx enabled %d, tx_notch_freq %u\n", i, str, rfconf.freq_hz, rfconf.rssi_offset, rfconf.tx_enable, rfconf.tx_notch_f
    ^
    inc/trace.h:27:29: note: in definition of macro ‘MSG’
    #define MSG(args...) printf(args) /
    message that is destined to the user /
    ^
    src/lora_pkt_fwd.c:529:193: error: ‘struct lgw_conf_rxrf_s’ has no member named ‘tx_notch_freq’
    MSG("INFO: radio %i enabled (type %s), center frequency %u, RSSI offset %f, tx enabled %d, tx_notch_freq %u\n", i, str, rfconf.freq_hz, rfconf.rssi_offset, rfconf.tx_enable, rfconf.tx_notch_f
    ^
    inc/trace.h:27:29: note: in definition of macro ‘MSG’
    #define MSG(args...) printf(args) /
    message that is destined to the user /
    ^
    src/lora_pkt_fwd.c:285:27: warning: unused variable ‘lbtconf’ [-Wunused-variable]
    struct lgw_conf_lbt_s lbtconf;
    ^
    src/lora_pkt_fwd.c:284:29: warning: unused variable ‘boardconf’ [-Wunused-variable]
    struct lgw_conf_board_s boardconf;
    ^
    src/lora_pkt_fwd.c: In function ‘main’:
    src/lora_pkt_fwd.c:1416:13: warning: implicit declaration of function ‘lgw_gps_disable’ [-Wimplicit-function-declaration]
    i = lgw_gps_disable(gps_tty_fd);
    ^
    src/lora_pkt_fwd.c: In function ‘thread_up’:
    src/lora_pkt_fwd.c:1625:21: warning: implicit declaration of function ‘lgw_cnt2gps’ [-Wimplicit-function-declaration]
    j = lgw_cnt2gps(local_ref, p->count_us, &pkt_gps_time);
    ^
    src/lora_pkt_fwd.c:1628:91: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
    j = snprintf((char )(buff_up + buff_index), TX_BUFF_SIZE-buff_index, ","tmms":%llu",
    ^
    src/lora_pkt_fwd.c:1628:91: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
    src/lora_pkt_fwd.c: In function ‘thread_down’:
    src/lora_pkt_fwd.c:2103:62: error: ‘struct tref’ has no member named ‘gps’
    diff_beacon_time = time_reference_gps.gps.tv_sec % ((time_t)beacon_period);
    ^
    src/lora_pkt_fwd.c:2104:73: error: ‘struct tref’ has no member named ‘gps’
    next_beacon_gps_time.tv_sec = time_reference_gps.gps.tv_sec +
    ^
    src/lora_pkt_fwd.c:2128:21: warning: implicit declaration of function ‘lgw_gps2cnt’ [-Wimplicit-function-declaration]
    lgw_gps2cnt(time_reference_gps, next_beacon_gps_time, &(beacon_pkt.count_us));
    ^
    src/lora_pkt_fwd.c:2517:17: error: invalid use of undefined type ‘struct lgw_tx_gain_lut_s’
    for (i=0; i<txlut.size; i++) {
    ^
    src/lora_pkt_fwd.c:2518:21: error: invalid use of undefined type ‘struct lgw_tx_gain_lut_s’
    if (txlut.lut[i].rf_power == txpkt.rf_power) {
    ^
    src/lora_pkt_fwd.c:2523:17: error: invalid use of undefined type ‘struct lgw_tx_gain_lut_s’
    if (i == txlut.size) {
    ^
    src/lora_pkt_fwd.c: In function ‘gps_process_sync’:
    src/lora_pkt_fwd.c:2664:31: warning: passing argument 2 of ‘lgw_gps_get’ from incompatible pointer type [-Wincompatible-pointer-types]
    int i = lgw_gps_get(&utc, &gps_time, NULL, NULL);
    ^
    In file included from inc/jitqueue.h:28:0,
    from src/lora_pkt_fwd.c:51:
    ../../lora_gateway/libloragw/inc/loragw_gps.h:137:5: note: expected ‘struct coord_s ’ but argument is of type ‘struct timespec
    int lgw_gps_get(struct timespec
    utc, struct coord_s
    loc, struct coord_s
    err);
    ^
    src/lora_pkt_fwd.c:2664:13: error: too many arguments to function ‘lgw_gps_get’
    int i = lgw_gps_get(&utc, &gps_time, NULL, NULL);
    ^
    In file included from inc/jitqueue.h:28:0,
    from src/lora_pkt_fwd.c:51:
    ../../lora_gateway/libloragw/inc/loragw_gps.h:137:5: note: declared here
    int lgw_gps_get(struct timespec
    utc, struct coord_s* loc, struct coord_s* err);
    ^
    src/lora_pkt_fwd.c:2683:9: error: too many arguments to function ‘lgw_gps_sync’
    i = lgw_gps_sync(&time_reference_gps, trig_tstamp, utc, gps_time);
    ^
    In file included from inc/jitqueue.h:28:0,
    from src/lora_pkt_fwd.c:51:
    ../../lora_gateway/libloragw/inc/loragw_gps.h:149:5: note: declared here
    int lgw_gps_sync(struct tref* ref, uint32_t count_us, struct timespec utc);
    ^
    src/lora_pkt_fwd.c: In function ‘gps_process_coords’:
    src/lora_pkt_fwd.c:2694:16: error: too many arguments to function ‘lgw_gps_get’
    int i = lgw_gps_get(NULL, NULL, &coord, &gpserr);
    ^
    In file included from inc/jitqueue.h:28:0,
    from src/lora_pkt_fwd.c:51:
    ../../lora_gateway/libloragw/inc/loragw_gps.h:137:5: note: declared here
    int lgw_gps_get(struct timespec* utc, struct coord_s* loc, struct coord_s* err);
    ^
    src/lora_pkt_fwd.c: In function ‘thread_gps’:
    src/lora_pkt_fwd.c:2725:66: error: ‘LGW_GPS_MIN_MSG_SIZE’ undeclared (first use in this function)
    ssize_t nb_char = read(gps_tty_fd, serial_buff + wr_idx, LGW_GPS_MIN_MSG_SIZE);
    ^
    In file included from src/lora_pkt_fwd.c:50:0:
    src/lora_pkt_fwd.c:2727:17: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘ssize_t {aka long int}’ [-Wformat=]
    MSG("WARNING: [gps] read() returned value %d\n", nb_char);
    ^
    inc/trace.h:27:29: note: in definition of macro ‘MSG’
    #define MSG(args...) printf(args) /* message that is destined to the user */
    ^
    src/lora_pkt_fwd.c:2740:45: error: ‘LGW_GPS_UBX_SYNC_CHAR’ undeclared (first use in this function)
    if(serial_buff[rd_idx] == (char)LGW_GPS_UBX_SYNC_CHAR) {
    ^
    src/lora_pkt_fwd.c:2745:30: warning: implicit declaration of function ‘lgw_parse_ubx’ [-Wimplicit-function-declaration]
    latest_msg = lgw_parse_ubx(&serial_buff[rd_idx], (wr_idx - rd_idx), &frame_size);
    ^
    src/lora_pkt_fwd.c:2748:39: error: ‘INCOMPLETE’ undeclared (first use in this function)
    if (latest_msg == INCOMPLETE) {
    ^
    src/lora_pkt_fwd.c:2755:46: error: ‘UBX_NAV_TIMEGPS’ undeclared (first use in this function)
    } else if (latest_msg == UBX_NAV_TIMEGPS) {
    ^
    src/lora_pkt_fwd.c:2759:46: error: ‘LGW_GPS_NMEA_SYNC_CHAR’ undeclared (first use in this function)
    } else if(serial_buff[rd_idx] == LGW_GPS_NMEA_SYNC_CHAR) {
    ^
    Makefile:62: recipe for target 'obj/lora_pkt_fwd.o' failed
    make: *** [obj/lora_pkt_fwd.o] Error 1

    (Hope that I haven't done something stupid here)



  • @KhaiNguyen You should not clone [https://github.com/Lora-net/packet_forwarder.git](link url)...
    Could you please just try the following steps:

    $ mkdir testRAK831
    $ cd testRAK831
    $ git clone https://github.com/RAKWireless/RAK831_LoRaGateway.git
    $ cd  RAK831_LoRaGateway/libmpsse/src
    $ ./configure
    $ make
    $ sudo make install
    $ cd ../../lora_gateway
    $ make
    

    ...and that's all :)

    make[1]: Entering directory '/home/userr/Devel/Lora/Raktest/RAK831_LoRaGateway/lora_gateway/libloragw'
    *** Checking libloragw library configuration ***
    Release version   : 1.5.0
    SPI interface     : FTDI SPI-over-USB bridge using libmpsse/libftdi/libusb
    Concentrator chip : Semtech SX1301 production chip
    Radio chip(s)     : Auto check front end.
    Frequency band    : Full range supported by the radio(s)
    Board misc. param : China LoRa 433MHz gateway for RPi
    Network type      : Private network
    *** Configuration seems ok ***
    gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. src/loragw_hal.c -o obj/loragw_hal.o
    gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. src/loragw_gps.c -o obj/loragw_gps.o
    gcc -O2 -Wall -Wextra -std=c99 -Iinc -I. -L. tst/test_loragw_full_duplex.c -o test_loragw_full_duplex -lloragw -lrt -lmpsse
    ...
    

    Regards,
    Olivier



  • Thank you @OlivierG
    I've tried your code but it seems to me that I got the same results as following @Twenyong without installing packet_forwarder? How can I check it please?

    Secondly, (if anyone can help) when I tried function test_loragw_rx, I always received problem with CRC, package damaged. I thought that it's due to missing a sender so I set up a sender with module Heltec Wifi Lora 32, and sender code from https://www.alictronix.com/archives/860 with frequency modified, but the concentrator still received damaged packet? Am I wrong at something?

    Thank you,



  • Hi @KhaiNguyen
    You have 2 different 2 problems:

    • Build the RAK stack: The log you sent is not from RAK's code...so it is not obvious to help you in building it :)
    • Heltec Wifi Lora 32 is just a LoRa sender, so, if you want to use it as a sensor (why not . :)), you have to set up the Heltec device with LMIC stack (see arduino lmic at [https://github.com/matthijskooijman/](link url))

    I set up the whole pack (Heltec -> RAK831 <-> TTN) and it works :)
    Regards
    Olivier



  • Hi @KhaiNguyen

    The RAK831 module does work correctly with the RAK stack, so going with @OlivierG comments, I would definitely suggest to first get your RAK stack compiled and executed.

    Second, the CRC check failure is ok, as it happens when there is no sender to send a lora packet. However when testing the initial config, your spi_test and rx_test shouldn't throw "concentrator failure" during execution. So i would request you to build the RAK stack first and see if the above two commands work and show you a correct output

    BTW, I would like to understand if there is any particular requirement for running the RAK831 via FTDI instead of full speed SPI? If its an industrial use case, I would recommend getting a industrial chipset variants of the imx6 or from broadcom and run it on the board directly via SPI. Since the FTDI support is getting deprecated with the semtech gateway version code v3.2.0. Hence any changes to the sx1301 or future chipset revision will not have full support for the FTDI based development. Just a suggestion from my end.

    Official semtech repo notes:

    v3.2.0

    Added support for SX1301AP2 reference design (with FPGA and additional SX127x). When a FPGA is detected at startup, the HAL automatically adapts SPI communication requests (using SPI header or not).
    Added util_spectral_scan diagnostic tool to scan the spectral band in background, where the LoRa gateway operates. (can only be used with SX1301AP2 or similar design). By default it uses the same SPI device as the one used by the HAL, but it can be changed depending on the hardware architecture on which it is used by updating the SPI_DEV_PATH constant defined in file util_spectral_scan/src/loragw_fpga_spi.c. Note: when using same SPI device from 2 applications, we rely on the host SPI driver and OS to properly handle concurrent SPI requests. It has been tested on Raspberry Pi / Raspbian with spi_bcm2708 driver.* Removed SPI FTDI support due to lack of performances to properly handle heavy packet traffic. Only native SPI usage is recommended.
    HAL: added a check that SX1301 firmwares have been properly loaded at startup.



  • Thank you @OlivierG and @narioinc for your help,

    Look like it's a problem because I lack of experience with Linux, as a permanent windows user. I think I have succeed to build it, but I still don't know how can I execute it? Does it mean running the rx_test?

    @OlivierG I will use it as a sensor, I used to play a lot with arduinos :) but for now I just send some random number



  • @KhaiNguyen, for sure, Linux development is a little bit different from Windows :)
    if you want, we can go step by step:

    Part 1: you need to compile the library:

    (I assume you already got the git branch)
    $ cd RAK831_LoRaGateway/libmpsse/src
    Then, reconfigure the Makefile:
    $ ./configure
    The output should be like that:

    [10:51][oguiter:~/Devel/Lora/Raktest/RAK831_LoRaGateway/libmpsse/src]$ ./configure
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables... 
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking how to run the C preprocessor... gcc -E
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for size_t... yes
    checking for stdlib.h... (cached) yes
    checking for GNU libc compatible malloc... yes
    checking libftdi1/ftdi.h usability... no
    checking libftdi1/ftdi.h presence... no
    checking for libftdi1/ftdi.h... no
    checking ftdi.h usability... yes
    checking ftdi.h presence... yes
    checking for ftdi.h... yes
    checking for ftdi_init in -lftdi... yes
    configure: creating ./config.status
    config.status: creating Makefile
    

    Now, run $ make
    output:

    gcc -Wall -fPIC -fno-strict-aliasing -g -O2 -shared -Wl,-soname,libmpsse.so *.o -o libmpsse.so -lftdi 
    ar rcs libmpsse.a *.o
    

    And the last thing to do with library is to "install it" with
    $ sudo make install

    After these steps, on my Ubuntu, i can find 3 files (new ly created), here:

    $ ll /usr/local/lib/libmp*
    -rw-r--r-- 1 root root 92K janv. 10 10:58 /usr/local/lib/libmpsse.a
    -rw-r--r-- 1 root root 68K janv. 10 10:58 /usr/local/lib/libmpsse.so
    
    $ ll /usr/local/include/mp*
    -rw-r--r-- 1 root root 5,2K janv. 10 10:58 /usr/local/include/mpsse.h
    

    Up to now, is it ok on your system ?

    Part 2:

    Now go back to the 2nd directory:
    $ cd RAK831_LoRaGateway/lora_gateway
    and just run $ make
    The beginning of the log should be like that:

    make[1]: Entering directory '/home/userr/Devel/Lora/Raktest/RAK831_LoRaGateway/lora_gateway/libloragw'
    *** Checking libloragw library configuration ***
    Release version   : 1.5.0
    SPI interface     : FTDI SPI-over-USB bridge using libmpsse/libftdi/libusb
    Concentrator chip : Semtech SX1301 production chip
    Radio chip(s)     : Auto check front end.
    Frequency band    : Full range supported by the radio(s)
    Board misc. param : China LoRa 433MHz gateway for RPi
    Network type      : Private network
    

    If everything seems to be fine, just check if it works with the following test:
    $ ./libloragw/test_loragw_reg
    If there's NO connection with the RAK831, you will get this kind of log:

    Beginning of test for loragw_reg.c
    ERROR: CONCENTRATOR UNCONNECTED
    IMPLICIT_PAYLOAD_LENGHT = 0 (should be 197)
    FRAME_SYNCH_PEAK2_POS = 0 (should be 11)
    PREAMBLE_SYMB1_NB = 0 (should be 49253)
    ADJUST_MODEM_START_OFFSET_SF12_RDX4 = 0 (should be 3173)
    IF_FREQ_1 = 0 (should be -1947)
    End of test for loragw_reg.c
    

    If you get a different message, it means It Works !

    Hope this will help. Feel free to ask if there a problem at any step !
    Olivier



  • Thank you @OlivierG , you are so kind,
    It seems to works after I followed your first comment, I just don't understand the log :)

    End of register verification
    IMPLICIT_PAYLOAD_LENGHT = 197 (should be 197)
    FRAME_SYNCH_PEAK2_POS = 11 (should be 11)
    PREAMBLE_SYMB1_NB = 49253 (should be 49253)
    ADJUST_MODEM_START_OFFSET_SF12_RDX4 = 3173 (should be 3173)
    IF_FREQ_1 = -1947 (should be -1947)
    End of test for loragw_reg.c

    Next, to connect to The thing network, what do you thing I should do to handle the packet forwarder?

    Kind regards,





  • Hi,
    After some efforts, I can receive some packages from a node like this

    Rcv pkt #1 >>freq:868100000
     if_chain: 0 tstamp:0119531196 size: 15 LoRa SF12 CR1(4/5)
     RSSI: -42.0 SNR: +6.0 (min: +4.5, max:+10.2) payload:
     40 04 00 00 71 80 0B 00 02 77 7B 0B 66 D2 A1 #
    ---
    

    So I proceeded with packet forwarder, from @OlivierG's link, I created and account on https://www.thethingsnetwork.org/docs/gateways/registration.html and successfully request my *.json file on https://github.com/ttn-zh/gateway-remote-config. I did try to follow from the this command on the link:

    $ git clone -b spi https://github.com/ttn-zh/ic880a-gateway.git ~/ic880a-gateway
    $ cd ~/ic880a-gateway
    $ sudo ./install.sh spi
    

    But it seems just to be used for RPi because I can't connect to TTN. Then I came back to the option of adding this floder https://github.com/Lora-net/packet_forwarder/tree/master/lora_pkt_fwd under RAK831_LoRaGateway repo with the same error log, like in the very long comment of mine before. @OlivierG are you sure that I should not clone the packet_forwarder? In addition, do you think my laptop installed both windows and ubuntu makes this problem?

    Thank you in advance,



  • Hi @KhaiNguyen
    Step by step, little by little :)
    Just one question: on the Heltec Lora module, are you using the default LoRa sender ? ... if "yes", the global behavior is the one expected. The Heltec send Lora frame, not LoRaWan.
    TTN expects LoRaWan frames, with all the needed settings (e.g.: APP EUI, DEV EUI, ... )
    So, now, let the gateway "as is" :)
    (on the RPI, if you look at syslog :
    sudo tail -f /var/log/syslog
    you should see log like this one:

    pi@ttn-gateway:/opt/ttn-gateway $ sudo tail -f /var/log/syslog
    Jan 12 09:39:12 ttn-gateway ttn-gateway[340]: INFO: [down] for server router.eu.thethings.network PULL_ACK received in 66 ms
    Jan 12 09:39:12 ttn-gateway ttn-gateway[340]: ##### 2018-01-12 09:39:12 GMT #####
    Jan 12 09:39:12 ttn-gateway ttn-gateway[340]: ### [UPSTREAM] ###
    Jan 12 09:39:12 ttn-gateway ttn-gateway[340]: # RF packets received by concentrator: 0
    Jan 12 09:39:12 ttn-gateway ttn-gateway[340]: # CRC_OK: 0.00%, CRC_FAIL: 0.00%, NO_CRC: 0.00%
    Jan 12 09:39:12 ttn-gateway ttn-gateway[340]: # RF packets forwarded: 0 (0 bytes)
    Jan 12 09:39:12 ttn-gateway ttn-gateway[340]: # PUSH_DATA datagrams sent: 2 (476 bytes)
    Jan 12 09:39:12 ttn-gateway ttn-gateway[340]: # PUSH_DATA acknowledged: 50.00%
    Jan 12 09:39:12 ttn-gateway ttn-gateway[340]: ### [DOWNSTREAM] ###
    Jan 12 09:39:12 ttn-gateway ttn-gateway[340]: # PULL_DATA sent: 6 (50.00% acknowledged)
    

    ... and focus on the Heltec Lora module:
    Use the IBM LMIC framework lib (see here: https://www.thethingsnetwork.org/forum/t/arduino-lmic-library-updated/1295/17

    Don't forget to change the Arduino code with the correct pin mapping:

    const lmic_pinmap lmic_pins = {
        .nss = 18,
        .rxtx = LMIC_UNUSED_PIN,
        .rst = 14,
        .dio = {26, 26, LMIC_UNUSED_PIN},
    };
    

    and, of course, update the
    the NwkSKey and AppSKey as DEVADDR !

    Olivier


Log in to reply
 

Looks like your connection to RAK Support Center was lost, please wait while we try to reconnect.