diff options
author | Mykyta Dorokhin <mykyta.dorokhin@globallogic.com> | 2020-02-19 15:40:44 +0200 |
---|---|---|
committer | Serhii Kostiuk <serhii.o.kostiuk@globallogic.com> | 2020-05-21 10:40:11 +0300 |
commit | 19ca401463153a7694a320f543852412d74cbd8f (patch) | |
tree | e3720d485786f1f2fc78c909fc2ad2f97829ab8d /recipes-connectivity/lora | |
parent | ed016261befcdc421ae1ac5d28d21066b56f42f2 (diff) | |
parent | 92cbb8fb30c624d3be98d6408d6ff7f03264a2c9 (diff) | |
download | meta-mlinux-19ca401463153a7694a320f543852412d74cbd8f.tar.gz meta-mlinux-19ca401463153a7694a320f543852412d74cbd8f.tar.bz2 meta-mlinux-19ca401463153a7694a320f543852412d74cbd8f.zip |
mpower-dev-thud: merge meta-mlinux:master (92cbb8fb Feb 11 2020) to meta-mlinux:multiarch5-thud (ed01626 Feb 3 2020)
Diffstat (limited to 'recipes-connectivity/lora')
19 files changed, 600 insertions, 903 deletions
diff --git a/recipes-connectivity/lora/lora-gateway-geolocation_5.1.0.bb b/recipes-connectivity/lora/lora-gateway-geolocation_5.1.0.bb index 21a1eec..511a8b3 100644 --- a/recipes-connectivity/lora/lora-gateway-geolocation_5.1.0.bb +++ b/recipes-connectivity/lora/lora-gateway-geolocation_5.1.0.bb @@ -6,9 +6,9 @@ LICENSE = "Proprietary" LIC_FILES_CHKSUM = "file://mlinux4/LICENSE.TXT;md5=86776875df1423114abfcec938f3e565" DEPENDS = "" # Source revision -PSR = "r3" +PSR = "r4" # Recipe revision -PR = "r5" +PR = "r6" SRCREV = "v${PV}" SRC_URI = "http://multitech.net/downloads/lora-packet-forwarder-geolocation_arm926ejste_${PV}-${PSR}.tar.gz \ @@ -16,8 +16,8 @@ SRC_URI = "http://multitech.net/downloads/lora-packet-forwarder-geolocation_arm9 file://config_64ch.json \ " -SRC_URI[md5sum] = "70cce8e2c7a790d68aebe66e93302ee6" -SRC_URI[sha256sum] = "6e09e265bb22a5370bbfb8e80b9aac5e1b7bd2b5f867e55eddea6cb2685a72b4" +SRC_URI[md5sum] = "542f02198a3258ca2ad4e549524e3ddc" +SRC_URI[sha256sum] = "8176f5f55f96b7a72946cfb51743a8ea4f88a4033e54009e7bcf8f03077d248e" S = "${WORKDIR}" diff --git a/recipes-connectivity/lora/lora-gateway/lora-gateway-gpsd.patch b/recipes-connectivity/lora/lora-gateway/lora-gateway-gpsd.patch index 471cd82..08d566c 100644 --- a/recipes-connectivity/lora/lora-gateway/lora-gateway-gpsd.patch +++ b/recipes-connectivity/lora/lora-gateway/lora-gateway-gpsd.patch @@ -73,10 +73,18 @@ index 6dbd30b..59b2d37 100644 /** @brief Parse messages coming from the GPS system (or other GNSS) diff --git a/libloragw/src/loragw_gps.c b/libloragw/src/loragw_gps.c -index c0e0ded..d3d1ca1 100644 +index c0e0ded..f4774be 100644 --- a/libloragw/src/loragw_gps.c +++ b/libloragw/src/loragw_gps.c -@@ -251,109 +251,22 @@ int str_chop(char *s, int buff_size, char separator, int *idx_ary, int max_idx) +@@ -84,6 +84,7 @@ static double gps_mlo = 0.0; /* minutes of longitude */ + static char gps_olo = 0; /* orientation (E-W) of longitude */ + static short gps_alt = 0; /* altitude */ + static bool gps_pos_ok = false; ++static bool gps_lock_ok = false; + + static char gps_mod = 'N'; /* GPS mode (N no fix, A autonomous, D differential) */ + static short gps_sat = 0; /* number of satellites used for fix */ +@@ -251,109 +252,22 @@ int str_chop(char *s, int buff_size, char separator, int *idx_ary, int max_idx) /* -------------------------------------------------------------------------- */ /* --- PUBLIC FUNCTIONS DEFINITION ------------------------------------------ */ @@ -91,17 +99,27 @@ index c0e0ded..d3d1ca1 100644 - 0x01, 0x20, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, /* Enable NAV-TIMEGPS output on serial */ - 0x32, 0x94 }; /* Checksum */ - ssize_t num_written; -- ++int lgw_gps_enable(struct gps_data_t *gpsdata, struct fixsource_t *source) { + - /* check input parameters */ - CHECK_NULL(tty_path); - CHECK_NULL(fd_ptr); -- ++ unsigned int flags; ++ fd_set fds; ++ flags = WATCH_ENABLE; ++ flags |= WATCH_RAW; ++ flags |= WATCH_NMEA; ++ gpsd_source_spec(NULL, source); + - /* open TTY device */ - gps_tty_dev = open(tty_path, O_RDWR | O_NOCTTY); - if (gps_tty_dev <= 0) { - DEBUG_MSG("ERROR: TTY PORT FAIL TO OPEN, CHECK PATH AND ACCESS RIGHTS\n"); -- return LGW_GPS_ERROR; -- } ++ if (gps_open(source->server, source->port, gpsdata) != 0) { ++ DEBUG_MSG("gpspipe: could not connect to gpsd %s:%s, %s(%d)\n", ++ source->server, source->port, gps_errstr(errno), errno); + return LGW_GPS_ERROR; + } - *fd_ptr = gps_tty_dev; - - /* manage the different GPS modules families */ @@ -115,7 +133,7 @@ index c0e0ded..d3d1ca1 100644 - /* see lgw_parse_ubx() function for details */ - DEBUG_MSG("WARNING: this version of GPS module may not be supported\n"); - } -- + - /* manage the target bitrate */ - if (target_brate != 0) { - DEBUG_MSG("WARNING: target_brate parameter ignored for now\n"); // TODO @@ -173,22 +191,10 @@ index c0e0ded..d3d1ca1 100644 - i = tcsetattr(gps_tty_dev, TCSANOW, &ttyopt); - if (i != 0){ - DEBUG_MSG("ERROR: IMPOSSIBLE TO UPDATE TTY PORT CONFIGURATION\n"); -+int lgw_gps_enable(struct gps_data_t *gpsdata, struct fixsource_t *source) { -+ -+ unsigned int flags; -+ fd_set fds; -+ flags = WATCH_ENABLE; -+ flags |= WATCH_RAW; -+ flags |= WATCH_NMEA; -+ gpsd_source_spec(NULL, source); -+ -+ if (gps_open(source->server, source->port, gpsdata) != 0) { -+ DEBUG_MSG("gpspipe: could not connect to gpsd %s:%s, %s(%d)\n", -+ source->server, source->port, gps_errstr(errno), errno); - return LGW_GPS_ERROR; - } +- return LGW_GPS_ERROR; +- } - tcflush(gps_tty_dev, TCIOFLUSH); - +- - /* Send UBX CFG NAV-TIMEGPS message to tell GPS module to output native GPS time */ - /* This is a binary message, serial port has to be properly configured to handle this */ - num_written = write (gps_tty_dev, ubx_cmd_timegps, UBX_MSG_NAVTIMEGPS_LEN); @@ -199,7 +205,7 @@ index c0e0ded..d3d1ca1 100644 /* get timezone info */ tzset(); -@@ -368,20 +281,13 @@ int lgw_gps_enable(char *tty_path, char *gps_family, speed_t target_brate, int * +@@ -368,20 +282,13 @@ int lgw_gps_enable(char *tty_path, char *gps_family, speed_t target_brate, int * /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ @@ -225,7 +231,44 @@ index c0e0ded..d3d1ca1 100644 return LGW_GPS_ERROR; } -@@ -526,7 +432,7 @@ enum gps_msg lgw_parse_nmea(const char *serial_buff, int buff_size) { +@@ -457,7 +364,8 @@ enum gps_msg lgw_parse_ubx(const char *serial_buff, size_t buff_size, size_t *ms + gps_week = (uint8_t)serial_buff[14]; + gps_week |= (uint8_t)serial_buff[15] << 8; /* GPS week number */ + +- gps_time_ok = true; ++ ++ + #if 0 + /* For debug */ + { +@@ -472,11 +380,24 @@ enum gps_msg lgw_parse_ubx(const char *serial_buff, size_t buff_size, size_t *ms + printf(" GPS time = %02d:%02d:%02d\n", ubx_gps_hou, ubx_gps_min, ubx_gps_sec); + } + #endif +- } else { /* valid */ ++ if (gps_lock_ok) ++ gps_time_ok = true; ++ ++ return UBX_NAV_TIMEGPS; ++ } else { + gps_time_ok = false; ++ return INVALID; ++ } ++ } else if ((serial_buff[2] == 0x01) && (serial_buff[3] == 0x04)) { ++ if (serial_buff[10] == 0x0F && serial_buff[11] == 0x27 ++ && serial_buff[10] == 0x0F && serial_buff[11] == 0x27 ++ && serial_buff[10] == 0x0F && serial_buff[11] == 0x27 ++ && serial_buff[10] == 0x0F && serial_buff[11] == 0x27) { ++ gps_time_ok = false; ++ gps_lock_ok = false; + } + +- return UBX_NAV_TIMEGPS; ++ return UBX_NAV_TIMEUTC; + } else if ((serial_buff[2] == 0x05) && (serial_buff[3] == 0x00)) { + DEBUG_MSG("NOTE: UBX ACK-NAK received\n"); + return IGNORED; +@@ -526,7 +447,7 @@ enum gps_msg lgw_parse_nmea(const char *serial_buff, int buff_size) { } else if (!validate_nmea_checksum(serial_buff, buff_size)) { DEBUG_MSG("Warning: invalid NMEA sentence (bad checksum)\n"); return INVALID; @@ -234,7 +277,7 @@ index c0e0ded..d3d1ca1 100644 /* NMEA sentence format: $xxRMC,time,status,lat,NS,long,EW,spd,cog,date,mv,mvEW,posMode*cs<CR><LF> Valid fix: $GPRMC,083559.34,A,4717.11437,N,00833.91522,E,0.004,77.52,091202,,,A*00 -@@ -535,19 +441,19 @@ enum gps_msg lgw_parse_nmea(const char *serial_buff, int buff_size) { +@@ -535,33 +456,32 @@ enum gps_msg lgw_parse_nmea(const char *serial_buff, int buff_size) { memcpy(parser_buf, serial_buff, buff_size); parser_buf[buff_size] = '\0'; nb_fields = str_chop(parser_buf, buff_size, ',', str_index, ARRAY_SIZE(str_index)); @@ -255,9 +298,17 @@ index c0e0ded..d3d1ca1 100644 - if ((i == 4) && (j == 3)) { + if ((i == 3) && (j == 3)) { if ((gps_mod == 'A') || (gps_mod == 'D')) { - gps_time_ok = true; +- gps_time_ok = true; ++ gps_lock_ok = true; DEBUG_MSG("Note: Valid RMC sentence, GPS locked, date: 20%02d-%02d-%02dT%02d:%02d:%06.3fZ\n", gps_yea, gps_mon, gps_day, gps_hou, gps_min, gps_fra + (float)gps_sec); -@@ -561,7 +467,7 @@ enum gps_msg lgw_parse_nmea(const char *serial_buff, int buff_size) { + } else { +- gps_time_ok = false; ++ gps_lock_ok = false; + DEBUG_MSG("Note: Valid RMC sentence, no satellite fix, estimated date: 20%02d-%02d-%02dT%02d:%02d:%06.3fZ\n", gps_yea, gps_mon, gps_day, gps_hou, gps_min, gps_fra + (float)gps_sec); + } + } else { + /* could not get a valid hour AND date */ +- gps_time_ok = false; DEBUG_MSG("Note: Valid RMC sentence, mode %c, no date\n", gps_mod); } return NMEA_RMC; @@ -266,6 +317,120 @@ index c0e0ded..d3d1ca1 100644 /* NMEA sentence format: $xxGGA,time,lat,NS,long,EW,quality,numSV,HDOP,alt,M,sep,M,diffAge,diffStation*cs<CR><LF> Valid fix: $GPGGA,092725.00,4717.11399,N,00833.91590,E,1,08,1.01,499.6,M,48.0,M,,*5B +@@ -587,6 +507,8 @@ enum gps_msg lgw_parse_nmea(const char *serial_buff, int buff_size) { + } else { + /* could not get a valid latitude, longitude AND altitude */ + gps_pos_ok = false; ++ gps_time_ok = false; ++ gps_lock_ok = false; + DEBUG_MSG("Note: Valid GGA sentence, %d sat, no coordinates\n", gps_sat); + } + return NMEA_GGA; +@@ -662,72 +580,60 @@ int lgw_gps_get(struct timespec *utc, struct timespec *gps_time, struct coord_s + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + + int lgw_gps_sync(struct tref *ref, uint32_t count_us, struct timespec utc, struct timespec gps_time) { ++ bool update = false; + double cnt_diff; /* internal concentrator time difference (in seconds) */ + double utc_diff; /* UTC time difference (in seconds) */ +- double slope; /* time slope between new reference and old reference (for sanity check) */ +- +- bool aber_n0; /* is the update value for synchronization aberrant or not ? */ +- static bool aber_min1 = false; /* keep track of whether value at sync N-1 was aberrant or not */ +- static bool aber_min2 = false; /* keep track of whether value at sync N-2 was aberrant or not */ ++ double slope = 1.0; /* time slope between new reference and old reference (for sanity check) */ ++ static bool calibrating = true; + + CHECK_NULL(ref); + + /* calculate the slope */ + +- cnt_diff = (double)(count_us - ref->count_us) / (double)(TS_CPS); /* uncorrected by xtal_err */ +- utc_diff = (double)(utc.tv_sec - (ref->utc).tv_sec) + (1E-9 * (double)(utc.tv_nsec - (ref->utc).tv_nsec)); ++ if (ref->systime != 0) { ++ ++ cnt_diff = (double)(count_us - ref->count_us) / (double)(TS_CPS); /* uncorrected by xtal_err */ ++ utc_diff = (double)(utc.tv_sec - (ref->utc).tv_sec) + (1E-9 * (double)(utc.tv_nsec - (ref->utc).tv_nsec)); + +- /* detect aberrant points by measuring if slope limits are exceeded */ +- if (utc_diff != 0) { // prevent divide by zero +- slope = cnt_diff/utc_diff; +- if ((slope > PLUS_10PPM) || (slope < MINUS_10PPM)) { +- DEBUG_MSG("Warning: correction range exceeded\n"); +- aber_n0 = true; ++ if (cnt_diff != 0 && utc_diff != 0) { // prevent divide by zero ++ slope = cnt_diff/utc_diff; + } else { +- aber_n0 = false; ++ slope = 0.0; ++ } ++ ++ if (gps_lock_ok && gps_time_ok && cnt_diff > 1.5) { ++ update = true; ++ } ++ ++ update = (slope >= MINUS_10PPM && slope <= PLUS_10PPM); ++ ++ if (!calibrating && utc_diff < 10.0) { ++ return LGW_GPS_ERROR; + } ++ ++ if (calibrating && !update && utc_diff > 1.5) { ++ update = true; ++ } else if (update) { ++ calibrating = false; ++ } ++ + } else { +- DEBUG_MSG("Warning: aberrant UTC value for synchronization\n"); +- aber_n0 = true; ++ update = true; ++ slope = 0.0; + } + +- /* watch if the 3 latest sync point were aberrant or not */ +- if (aber_n0 == false) { +- /* value no aberrant -> sync with smoothed slope */ +- ref->systime = time(NULL); ++ if (update || calibrating) { ++ ref->systime = time(NULL); + ref->count_us = count_us; + ref->utc.tv_sec = utc.tv_sec; + ref->utc.tv_nsec = utc.tv_nsec; + ref->gps.tv_sec = gps_time.tv_sec; + ref->gps.tv_nsec = gps_time.tv_nsec; + ref->xtal_err = slope; +- aber_min2 = aber_min1; +- aber_min1 = aber_n0; + return LGW_GPS_SUCCESS; +- } else if (aber_n0 && aber_min1 && aber_min2) { +- /* 3 successive aberrant values -> sync reset (keep xtal_err) */ +- ref->systime = time(NULL); +- ref->count_us = count_us; +- ref->utc.tv_sec = utc.tv_sec; +- ref->utc.tv_nsec = utc.tv_nsec; +- ref->gps.tv_sec = gps_time.tv_sec; +- ref->gps.tv_nsec = gps_time.tv_nsec; +- /* reset xtal_err only if the present value is out of range */ +- if ((ref->xtal_err > PLUS_10PPM) || (ref->xtal_err < MINUS_10PPM)) { +- ref->xtal_err = 1.0; +- } +- DEBUG_MSG("Warning: 3 successive aberrant sync attempts, sync reset\n"); +- aber_min2 = aber_min1; +- aber_min1 = aber_n0; +- return LGW_GPS_SUCCESS; +- } else { +- /* only 1 or 2 successive aberrant values -> ignore and return an error */ +- aber_min2 = aber_min1; +- aber_min1 = aber_n0; +- return LGW_GPS_ERROR; + } + +- return LGW_GPS_SUCCESS; ++ return LGW_GPS_ERROR; + } + + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ diff --git a/libloragw/tst/test_loragw_gps.c b/libloragw/tst/test_loragw_gps.c index a4164a3..e4b1546 100644 --- a/libloragw/tst/test_loragw_gps.c diff --git a/recipes-connectivity/lora/lora-gateway/lora-gateway-spectral-scan-skip-fpga-reset.patch b/recipes-connectivity/lora/lora-gateway/lora-gateway-spectral-scan-skip-fpga-reset.patch index e4a8b2b..0b53fd0 100644 --- a/recipes-connectivity/lora/lora-gateway/lora-gateway-spectral-scan-skip-fpga-reset.patch +++ b/recipes-connectivity/lora/lora-gateway/lora-gateway-spectral-scan-skip-fpga-reset.patch @@ -1,5 +1,5 @@ diff --git a/util_spectral_scan/src/util_spectral_scan.c b/util_spectral_scan/src/util_spectral_scan.c -index d2aecda..f070f4b 100644 +index d2aecda..cbc8377 100644 --- a/util_spectral_scan/src/util_spectral_scan.c +++ b/util_spectral_scan/src/util_spectral_scan.c @@ -30,6 +30,7 @@ Maintainer: Michael Coracin @@ -53,7 +53,27 @@ index d2aecda..f070f4b 100644 if(x != 0) { printf("ERROR: Failed to connect to FPGA\n"); return EXIT_FAILURE; -@@ -382,6 +398,10 @@ int main( int argc, char ** argv ) +@@ -324,6 +340,9 @@ int main( int argc, char ** argv ) + do { + wait_ms(10); + lgw_fpga_reg_r(LGW_FPGA_STATUS, ®_val); ++ if (shutdown_signal_recv) { ++ break; ++ } + } + while((TAKE_N_BITS_FROM((uint8_t)reg_val, 0, 5)) != 1); /* Clear has started */ + +@@ -346,6 +365,9 @@ int main( int argc, char ** argv ) + do { + wait_ms(1000); + lgw_fpga_reg_r(LGW_FPGA_STATUS, ®_val); ++ if (shutdown_signal_recv) { ++ break; ++ } + } + while((TAKE_N_BITS_FROM((uint8_t)reg_val, 5, 1)) != 1); + +@@ -382,6 +404,10 @@ int main( int argc, char ** argv ) } fprintf(log_file, "\n"); printf("\n"); @@ -63,3 +83,4 @@ index d2aecda..f070f4b 100644 + } } fclose(log_file); + diff --git a/recipes-connectivity/lora/lora-logging.bb b/recipes-connectivity/lora/lora-logging.bb index 201c0cc..752b63b 100644 --- a/recipes-connectivity/lora/lora-logging.bb +++ b/recipes-connectivity/lora/lora-logging.bb @@ -4,7 +4,7 @@ SECTION = "console/utils" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" DEPENDS = "" -PR = "r2" +PR = "r3" RDEPENDS_${PN} += "logrotate bash" SRC_URI = "file://lora-logging.logrotate.conf \ diff --git a/recipes-connectivity/lora/lora-logging/lora-logging.logrotate.conf b/recipes-connectivity/lora/lora-logging/lora-logging.logrotate.conf index f425c00..5f26561 100644 --- a/recipes-connectivity/lora/lora-logging/lora-logging.logrotate.conf +++ b/recipes-connectivity/lora/lora-logging/lora-logging.logrotate.conf @@ -5,6 +5,8 @@ copytruncate missingok postrotate - killall -SIGHUP lora-network-server + set -e; + /usr/bin/killall -HUP lora_pkt_fwd || true; + /usr/bin/killall -HUP lora-network-server || true; endscript } diff --git a/recipes-connectivity/lora/lora-network-server_2.3.3.bb b/recipes-connectivity/lora/lora-network-server_2.3.3.bb new file mode 100644 index 0000000..8b75ea6 --- /dev/null +++ b/recipes-connectivity/lora/lora-network-server_2.3.3.bb @@ -0,0 +1,48 @@ +DESCRIPTION = "MultiTech LoRa Network Server" +PRIORITY = "optional" +SECTION = "console/utils" +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://LICENSE;md5=2b9a30a3082ddccd2c695a4dbeeab80d" +DEPENDS = "jsoncpp libmts mosquitto sqlite3 curl gnutls" +RDEPENDS_${PN} += "lora-packet-forwarder logrotate bash lora-logging" +PR = "r0" +CONFFILES_${PN} += "${sysconfdir}/default/lora-network-server ${sysconfdir}/init.d/lora-network-server" + +SRC_URI = "http://multitech.net/downloads/lora-network-server_${PV}.tar.gz \ + file://lora-network-server.init \ + file://lora-network-server.default \ + " + +SRC_URI[md5sum] = "b0bc859e1f60b1a92b06c4bb97f70109" +SRC_URI[sha256sum] = "f8ba944a024531dbf58f2de462cb7ccfb5e3cb8d8dedb51077e7719f32f9adc4" + +# binaries are already stripped, so suppress warning +INSANE_SKIP_${PN} = "already-stripped" + +S = "${WORKDIR}" + +LORA_DIR = "/opt/lora" + +do_compile() { +} + +inherit update-rc.d + +INITSCRIPT_NAME = "lora-network-server" +INITSCRIPT_PARAMS = "defaults 80 30" + +do_install() { + install -d ${D}${LORA_DIR} + install -m 0755 lora-network-server-arm926ejste-mlinux-5.2 ${D}${LORA_DIR}/lora-network-server + install -m 0755 lora-v21-keygen-arm926ejste-mlinux-5.2 ${D}${LORA_DIR}/lora-v21-keygen + install -m 0644 config/lora-network-server.conf.sample ${D}${LORA_DIR}/lora-network-server.conf.sample + install -m 0644 config/lora-network-server.conf.full ${D}${LORA_DIR}/lora-network-server.conf.full + + install -d ${D}${sysconfdir}/default + install -m 0644 ${WORKDIR}/lora-network-server.default ${D}${sysconfdir}/default/lora-network-server + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/lora-network-server.init ${D}${sysconfdir}/init.d/lora-network-server +} + +FILES_${PN} += "${LORA_DIR}" +FILES_${PN}-dbg += "${LORA_DIR}/.debug" diff --git a/recipes-connectivity/lora/lora-packet-forwarder-geolocation_5.1.0.bb b/recipes-connectivity/lora/lora-packet-forwarder-geolocation_5.1.0.bb index 193fcf7..b42bd31 100644 --- a/recipes-connectivity/lora/lora-packet-forwarder-geolocation_5.1.0.bb +++ b/recipes-connectivity/lora/lora-packet-forwarder-geolocation_5.1.0.bb @@ -7,9 +7,9 @@ LIC_FILES_CHKSUM = "file://mlinux4/LICENSE.TXT;md5=86776875df1423114abfcec938f3e DEPENDS ?= "lora-gateway-geolocation logrotate lora-logging" RDEPENDS_${PN} += "bash" # Source revision -PSR = "r3" +PSR = "r4" # Recipe revision -PR = "r5" +PR = "r6" SRCREV = "v${PV}" @@ -26,8 +26,8 @@ SRC_URI = "http://multitech.net/downloads/lora-packet-forwarder-geolocation_arm9 file://global_conf.json.MTAC_LORA_2_1_test_single_antenna_64ch_64x1_EU868 \ file://global_conf.json.MTAC_LORA_2_1_test_single_antenna_64ch_8x8_EU868 \ " -SRC_URI[md5sum] = "70cce8e2c7a790d68aebe66e93302ee6" -SRC_URI[sha256sum] = "6e09e265bb22a5370bbfb8e80b9aac5e1b7bd2b5f867e55eddea6cb2685a72b4" +SRC_URI[md5sum] = "542f02198a3258ca2ad4e549524e3ddc" +SRC_URI[sha256sum] = "8176f5f55f96b7a72946cfb51743a8ea4f88a4033e54009e7bcf8f03077d248e" S = "${WORKDIR}" B = "${S}" diff --git a/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.AS923-LBT.basic b/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.AS923-LBT.basic index 3148a88..6c14d3c 100644 --- a/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.AS923-LBT.basic +++ b/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.AS923-LBT.basic @@ -113,118 +113,22 @@ "tx_enable": false, "type": "SX1257" }, - "tx_lut_0" : - { - "dig_gain" : 2, - "mix_gain" : 9, - "pa_gain" : 0, - "rf_power" : -6 - }, - "tx_lut_1" : - { - "dig_gain" : 0, - "mix_gain" : 9, - "pa_gain" : 0, - "rf_power" : -3 - }, - "tx_lut_10" : - { - "dig_gain" : 0, - "mix_gain" : 10, - "pa_gain" : 2, - "rf_power" : 16 - }, - "tx_lut_11" : - { - "dig_gain" : 0, - "mix_gain" : 14, - "pa_gain" : 2, - "rf_power" : 20 - }, - "tx_lut_12" : - { - "dig_gain" : 0, - "mix_gain" : 8, - "pa_gain" : 3, - "rf_power" : 23 - }, - "tx_lut_13" : - { - "dig_gain" : 3, - "mix_gain" : 13, - "pa_gain" : 3, - "rf_power" : 25 - }, - "tx_lut_14" : - { - "dig_gain" : 0, - "mix_gain" : 12, - "pa_gain" : 3, - "rf_power" : 26 - }, - "tx_lut_15" : - { - "dig_gain" : 2, - "mix_gain" : 15, - "pa_gain" : 3, - "rf_power" : 27 - }, - "tx_lut_2" : - { - "dig_gain" : 2, - "mix_gain" : 13, - "pa_gain" : 0, - "rf_power" : 0 - }, - "tx_lut_3" : - { - "dig_gain" : 3, - "mix_gain" : 10, - "pa_gain" : 1, - "rf_power" : 3 - }, - "tx_lut_4" : - { - "dig_gain" : 2, - "mix_gain" : 10, - "pa_gain" : 1, - "rf_power" : 6 - }, - "tx_lut_5" : - { - "dig_gain" : 3, - "mix_gain" : 15, - "pa_gain" : 1, - "rf_power" : 10 - }, - "tx_lut_6" : - { - "dig_gain" : 0, - "mix_gain" : 13, - "pa_gain" : 1, - "rf_power" : 11 - }, - "tx_lut_7" : - { - "dig_gain" : 0, - "mix_gain" : 15, - "pa_gain" : 1, - "rf_power" : 12 - }, - "tx_lut_8" : - { - "dig_gain" : 0, - "mix_gain" : 8, - "pa_gain" : 2, - "rf_power" : 13 - }, - "tx_lut_9" : - { - "dig_gain" : 3, - "mix_gain" : 12, - "pa_gain" : 2, - "rf_power" : 14 - } + "tx_lut_0":{"dig_gain":2,"mix_gain":15,"pa_gain":1,"rf_power":10}, + "tx_lut_1":{"dig_gain":3,"mix_gain":8,"pa_gain":3,"rf_power":11}, + "tx_lut_2":{"dig_gain":2,"mix_gain":11,"pa_gain":2,"rf_power":12}, + "tx_lut_3":{"dig_gain":0,"mix_gain":10,"pa_gain":2,"rf_power":13}, + "tx_lut_4":{"dig_gain":3,"mix_gain":14,"pa_gain":2,"rf_power":14}, + "tx_lut_5":{"dig_gain":1,"mix_gain":12,"pa_gain":2,"rf_power":15}, + "tx_lut_6":{"dig_gain":0,"mix_gain":12,"pa_gain":2,"rf_power":16}, + "tx_lut_7":{"dig_gain":2,"mix_gain":14,"pa_gain":2,"rf_power":17}, + "tx_lut_8":{"dig_gain":2,"mix_gain":15,"pa_gain":2,"rf_power":18}, + "tx_lut_9":{"dig_gain":1,"mix_gain":15,"pa_gain":2,"rf_power":19}, + "tx_lut_10":{"dig_gain":0,"mix_gain":9,"pa_gain":3,"rf_power":20}, + "tx_lut_11":{"dig_gain":1,"mix_gain":10,"pa_gain":3,"rf_power":21}, + "tx_lut_12":{"dig_gain":0,"mix_gain":10,"pa_gain":3,"rf_power":22}, + "tx_lut_13":{"dig_gain":0,"mix_gain":11,"pa_gain":3,"rf_power":23}, + "tx_lut_14":{"dig_gain":2,"mix_gain":14,"pa_gain":3,"rf_power":24}, + "tx_lut_15":{"dig_gain":0,"mix_gain":15,"pa_gain":3,"rf_power":25} }, "gateway_conf": { "gateway_ID": "<WILL-BE-AUTO-REPLACED-WITH-LORA-EUI>", diff --git a/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.AS923.basic b/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.AS923.basic index 2755bb4..3731a2d 100644 --- a/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.AS923.basic +++ b/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.AS923.basic @@ -81,118 +81,22 @@ "tx_enable": false, "type": "SX1257" }, - "tx_lut_0" : - { - "dig_gain" : 2, - "mix_gain" : 9, - "pa_gain" : 0, - "rf_power" : -6 - }, - "tx_lut_1" : - { - "dig_gain" : 0, - "mix_gain" : 9, - "pa_gain" : 0, - "rf_power" : -3 - }, - "tx_lut_10" : - { - "dig_gain" : 0, - "mix_gain" : 10, - "pa_gain" : 2, - "rf_power" : 16 - }, - "tx_lut_11" : - { - "dig_gain" : 0, - "mix_gain" : 14, - "pa_gain" : 2, - "rf_power" : 20 - }, - "tx_lut_12" : - { - "dig_gain" : 0, - "mix_gain" : 8, - "pa_gain" : 3, - "rf_power" : 23 - }, - "tx_lut_13" : - { - "dig_gain" : 3, - "mix_gain" : 13, - "pa_gain" : 3, - "rf_power" : 25 - }, - "tx_lut_14" : - { - "dig_gain" : 0, - "mix_gain" : 12, - "pa_gain" : 3, - "rf_power" : 26 - }, - "tx_lut_15" : - { - "dig_gain" : 2, - "mix_gain" : 15, - "pa_gain" : 3, - "rf_power" : 27 - }, - "tx_lut_2" : - { - "dig_gain" : 2, - "mix_gain" : 13, - "pa_gain" : 0, - "rf_power" : 0 - }, - "tx_lut_3" : - { - "dig_gain" : 3, - "mix_gain" : 10, - "pa_gain" : 1, - "rf_power" : 3 - }, - "tx_lut_4" : - { - "dig_gain" : 2, - "mix_gain" : 10, - "pa_gain" : 1, - "rf_power" : 6 - }, - "tx_lut_5" : - { - "dig_gain" : 3, - "mix_gain" : 15, - "pa_gain" : 1, - "rf_power" : 10 - }, - "tx_lut_6" : - { - "dig_gain" : 0, - "mix_gain" : 13, - "pa_gain" : 1, - "rf_power" : 11 - }, - "tx_lut_7" : - { - "dig_gain" : 0, - "mix_gain" : 15, - "pa_gain" : 1, - "rf_power" : 12 - }, - "tx_lut_8" : - { - "dig_gain" : 0, - "mix_gain" : 8, - "pa_gain" : 2, - "rf_power" : 13 - }, - "tx_lut_9" : - { - "dig_gain" : 3, - "mix_gain" : 12, - "pa_gain" : 2, - "rf_power" : 14 - } + "tx_lut_0":{"dig_gain":2,"mix_gain":15,"pa_gain":1,"rf_power":10}, + "tx_lut_1":{"dig_gain":3,"mix_gain":8,"pa_gain":3,"rf_power":11}, + "tx_lut_2":{"dig_gain":2,"mix_gain":11,"pa_gain":2,"rf_power":12}, + "tx_lut_3":{"dig_gain":0,"mix_gain":10,"pa_gain":2,"rf_power":13}, + "tx_lut_4":{"dig_gain":3,"mix_gain":14,"pa_gain":2,"rf_power":14}, + "tx_lut_5":{"dig_gain":1,"mix_gain":12,"pa_gain":2,"rf_power":15}, + "tx_lut_6":{"dig_gain":0,"mix_gain":12,"pa_gain":2,"rf_power":16}, + "tx_lut_7":{"dig_gain":2,"mix_gain":14,"pa_gain":2,"rf_power":17}, + "tx_lut_8":{"dig_gain":2,"mix_gain":15,"pa_gain":2,"rf_power":18}, + "tx_lut_9":{"dig_gain":1,"mix_gain":15,"pa_gain":2,"rf_power":19}, + "tx_lut_10":{"dig_gain":0,"mix_gain":9,"pa_gain":3,"rf_power":20}, + "tx_lut_11":{"dig_gain":1,"mix_gain":10,"pa_gain":3,"rf_power":21}, + "tx_lut_12":{"dig_gain":0,"mix_gain":10,"pa_gain":3,"rf_power":22}, + "tx_lut_13":{"dig_gain":0,"mix_gain":11,"pa_gain":3,"rf_power":23}, + "tx_lut_14":{"dig_gain":2,"mix_gain":14,"pa_gain":3,"rf_power":24}, + "tx_lut_15":{"dig_gain":0,"mix_gain":15,"pa_gain":3,"rf_power":25} }, "gateway_conf": { "gateway_ID": "<WILL-BE-AUTO-REPLACED-WITH-LORA-EUI>", diff --git a/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.AU915.basic b/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.AU915.basic index 81c381c..c2a284e 100644 --- a/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.AU915.basic +++ b/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.AU915.basic @@ -79,118 +79,22 @@ "tx_delay_1ch_us": 4000000, "tx_delay_2ch_us": 4000000 }, - "tx_lut_0" : - { - "dig_gain" : 2, - "mix_gain" : 9, - "pa_gain" : 0, - "rf_power" : -6 - }, - "tx_lut_1" : - { - "dig_gain" : 0, - "mix_gain" : 9, - "pa_gain" : 0, - "rf_power" : -3 - }, - "tx_lut_10" : - { - "dig_gain" : 0, - "mix_gain" : 10, - "pa_gain" : 2, - "rf_power" : 16 - }, - "tx_lut_11" : - { - "dig_gain" : 0, - "mix_gain" : 14, - "pa_gain" : 2, - "rf_power" : 20 - }, - "tx_lut_12" : - { - "dig_gain" : 0, - "mix_gain" : 8, - "pa_gain" : 3, - "rf_power" : 23 - }, - "tx_lut_13" : - { - "dig_gain" : 3, - "mix_gain" : 13, - "pa_gain" : 3, - "rf_power" : 25 - }, - "tx_lut_14" : - { - "dig_gain" : 0, - "mix_gain" : 12, - "pa_gain" : 3, - "rf_power" : 26 - }, - "tx_lut_15" : - { - "dig_gain" : 2, - "mix_gain" : 15, - "pa_gain" : 3, - "rf_power" : 27 - }, - "tx_lut_2" : - { - "dig_gain" : 2, - "mix_gain" : 13, - "pa_gain" : 0, - "rf_power" : 0 - }, - "tx_lut_3" : - { - "dig_gain" : 3, - "mix_gain" : 10, - "pa_gain" : 1, - "rf_power" : 3 - }, - "tx_lut_4" : - { - "dig_gain" : 2, - "mix_gain" : 10, - "pa_gain" : 1, - "rf_power" : 6 - }, - "tx_lut_5" : - { - "dig_gain" : 3, - "mix_gain" : 15, - "pa_gain" : 1, - "rf_power" : 10 - }, - "tx_lut_6" : - { - "dig_gain" : 0, - "mix_gain" : 13, - "pa_gain" : 1, - "rf_power" : 11 - }, - "tx_lut_7" : - { - "dig_gain" : 0, - "mix_gain" : 15, - "pa_gain" : 1, - "rf_power" : 12 - }, - "tx_lut_8" : - { - "dig_gain" : 0, - "mix_gain" : 8, - "pa_gain" : 2, - "rf_power" : 13 - }, - "tx_lut_9" : - { - "dig_gain" : 3, - "mix_gain" : 12, - "pa_gain" : 2, - "rf_power" : 14 - } + "tx_lut_0":{"dig_gain":2,"mix_gain":15,"pa_gain":1,"rf_power":10}, + "tx_lut_1":{"dig_gain":3,"mix_gain":8,"pa_gain":3,"rf_power":11}, + "tx_lut_2":{"dig_gain":2,"mix_gain":11,"pa_gain":2,"rf_power":12}, + "tx_lut_3":{"dig_gain":0,"mix_gain":10,"pa_gain":2,"rf_power":13}, + "tx_lut_4":{"dig_gain":3,"mix_gain":14,"pa_gain":2,"rf_power":14}, + "tx_lut_5":{"dig_gain":1,"mix_gain":12,"pa_gain":2,"rf_power":15}, + "tx_lut_6":{"dig_gain":0,"mix_gain":12,"pa_gain":2,"rf_power":16}, + "tx_lut_7":{"dig_gain":2,"mix_gain":14,"pa_gain":2,"rf_power":17}, + "tx_lut_8":{"dig_gain":2,"mix_gain":15,"pa_gain":2,"rf_power":18}, + "tx_lut_9":{"dig_gain":1,"mix_gain":15,"pa_gain":2,"rf_power":19}, + "tx_lut_10":{"dig_gain":0,"mix_gain":9,"pa_gain":3,"rf_power":20}, + "tx_lut_11":{"dig_gain":1,"mix_gain":10,"pa_gain":3,"rf_power":21}, + "tx_lut_12":{"dig_gain":0,"mix_gain":10,"pa_gain":3,"rf_power":22}, + "tx_lut_13":{"dig_gain":0,"mix_gain":11,"pa_gain":3,"rf_power":23}, + "tx_lut_14":{"dig_gain":2,"mix_gain":14,"pa_gain":3,"rf_power":24}, + "tx_lut_15":{"dig_gain":0,"mix_gain":15,"pa_gain":3,"rf_power":25} }, "gateway_conf": { "forward_crc_disabled": false, diff --git a/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.EU868.basic b/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.EU868.basic index c0edcd3..710a228 100644 --- a/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.EU868.basic +++ b/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.EU868.basic @@ -82,102 +82,22 @@ "bandwidth": 125000, "datarate": 50000 }, - "tx_lut_0": { - "pa_gain": 0, - "mix_gain": 9, - "rf_power": -6, - "dig_gain": 1 - }, - "tx_lut_1": { - "pa_gain": 0, - "mix_gain": 12, - "rf_power": -3, - "dig_gain": 1 - }, - "tx_lut_2": { - "pa_gain": 1, - "mix_gain": 8, - "rf_power": 0, - "dig_gain": 2 - }, - "tx_lut_3": { - "pa_gain": 1, - "mix_gain": 11, - "rf_power": 3, - "dig_gain": 3 - }, - "tx_lut_4": { - "pa_gain": 1, - "mix_gain": 10, - "rf_power": 6, - "dig_gain": 0 - }, - "tx_lut_5": { - "pa_gain": 2, - "mix_gain": 11, - "rf_power": 10, - "dig_gain": 3 - }, - "tx_lut_6": { - "pa_gain": 2, - "mix_gain": 9, - "rf_power": 11, - "dig_gain": 1 - }, - "tx_lut_7": { - "pa_gain": 2, - "mix_gain": 9, - "rf_power": 12, - "dig_gain": 0 - }, - "tx_lut_8": { - "pa_gain": 2, - "mix_gain": 11, - "rf_power": 13, - "dig_gain": 2 - }, - "tx_lut_9": { - "pa_gain": 2, - "mix_gain": 11, - "rf_power": 14, - "dig_gain": 1 - }, - "tx_lut_10": { - "pa_gain": 2, - "mix_gain": 12, - "rf_power": 16, - "dig_gain": 0 - }, - "tx_lut_11": { - "pa_gain": 3, - "mix_gain": 10, - "rf_power": 20, - "dig_gain": 3 - }, - "tx_lut_12": { - "pa_gain": 3, - "mix_gain": 9, - "rf_power": 23, - "dig_gain": 0 - }, - "tx_lut_13": { - "pa_gain": 3, - "mix_gain": 12, - "rf_power": 25, - "dig_gain": 2 - }, - "tx_lut_14": { - "pa_gain": 3, - "mix_gain": 13, - "rf_power": 26, - "dig_gain": 0 - }, - "tx_lut_15": { - "pa_gain": 3, - "mix_gain": 15, - "rf_power": 27, - "dig_gain": 2 - } + "tx_lut_0":{"dig_gain":1,"mix_gain":10,"pa_gain":1,"rf_power":4}, + "tx_lut_1":{"dig_gain":3,"mix_gain":8,"pa_gain":3,"rf_power":11}, + "tx_lut_2":{"dig_gain":2,"mix_gain":11,"pa_gain":2,"rf_power":12}, + "tx_lut_3":{"dig_gain":0,"mix_gain":10,"pa_gain":2,"rf_power":13}, + "tx_lut_4":{"dig_gain":3,"mix_gain":14,"pa_gain":2,"rf_power":14}, + "tx_lut_5":{"dig_gain":1,"mix_gain":12,"pa_gain":2,"rf_power":15}, + "tx_lut_6":{"dig_gain":0,"mix_gain":12,"pa_gain":2,"rf_power":16}, + "tx_lut_7":{"dig_gain":2,"mix_gain":14,"pa_gain":2,"rf_power":17}, + "tx_lut_8":{"dig_gain":2,"mix_gain":15,"pa_gain":2,"rf_power":18}, + "tx_lut_9":{"dig_gain":1,"mix_gain":15,"pa_gain":2,"rf_power":19}, + "tx_lut_10":{"dig_gain":0,"mix_gain":9,"pa_gain":3,"rf_power":20}, + "tx_lut_11":{"dig_gain":1,"mix_gain":10,"pa_gain":3,"rf_power":21}, + "tx_lut_12":{"dig_gain":0,"mix_gain":10,"pa_gain":3,"rf_power":22}, + "tx_lut_13":{"dig_gain":0,"mix_gain":11,"pa_gain":3,"rf_power":23}, + "tx_lut_14":{"dig_gain":2,"mix_gain":14,"pa_gain":3,"rf_power":24}, + "tx_lut_15":{"dig_gain":0,"mix_gain":15,"pa_gain":3,"rf_power":25} }, "gateway_conf": { "gateway_ID": "<WILL-BE-AUTO-REPLACED-WITH-LORA-EUI>", diff --git a/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.IN865.basic b/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.IN865.basic index 332b9bb..c45db75 100644 --- a/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.IN865.basic +++ b/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.IN865.basic @@ -82,118 +82,22 @@ "tx_enable": false, "type": "SX1257" }, - "tx_lut_0" : - { - "dig_gain" : 2, - "mix_gain" : 9, - "pa_gain" : 0, - "rf_power" : -6 - }, - "tx_lut_1" : - { - "dig_gain" : 0, - "mix_gain" : 9, - "pa_gain" : 0, - "rf_power" : -3 - }, - "tx_lut_10" : - { - "dig_gain" : 0, - "mix_gain" : 10, - "pa_gain" : 2, - "rf_power" : 16 - }, - "tx_lut_11" : - { - "dig_gain" : 0, - "mix_gain" : 14, - "pa_gain" : 2, - "rf_power" : 20 - }, - "tx_lut_12" : - { - "dig_gain" : 0, - "mix_gain" : 8, - "pa_gain" : 3, - "rf_power" : 23 - }, - "tx_lut_13" : - { - "dig_gain" : 3, - "mix_gain" : 13, - "pa_gain" : 3, - "rf_power" : 25 - }, - "tx_lut_14" : - { - "dig_gain" : 0, - "mix_gain" : 12, - "pa_gain" : 3, - "rf_power" : 26 - }, - "tx_lut_15" : - { - "dig_gain" : 2, - "mix_gain" : 15, - "pa_gain" : 3, - "rf_power" : 27 - }, - "tx_lut_2" : - { - "dig_gain" : 2, - "mix_gain" : 13, - "pa_gain" : 0, - "rf_power" : 0 - }, - "tx_lut_3" : - { - "dig_gain" : 3, - "mix_gain" : 10, - "pa_gain" : 1, - "rf_power" : 3 - }, - "tx_lut_4" : - { - "dig_gain" : 2, - "mix_gain" : 10, - "pa_gain" : 1, - "rf_power" : 6 - }, - "tx_lut_5" : - { - "dig_gain" : 3, - "mix_gain" : 15, - "pa_gain" : 1, - "rf_power" : 10 - }, - "tx_lut_6" : - { - "dig_gain" : 0, - "mix_gain" : 13, - "pa_gain" : 1, - "rf_power" : 11 - }, - "tx_lut_7" : - { - "dig_gain" : 0, - "mix_gain" : 15, - "pa_gain" : 1, - "rf_power" : 12 - }, - "tx_lut_8" : - { - "dig_gain" : 0, - "mix_gain" : 8, - "pa_gain" : 2, - "rf_power" : 13 - }, - "tx_lut_9" : - { - "dig_gain" : 3, - "mix_gain" : 12, - "pa_gain" : 2, - "rf_power" : 14 - } + "tx_lut_0":{"dig_gain":2,"mix_gain":15,"pa_gain":1,"rf_power":10}, + "tx_lut_1":{"dig_gain":3,"mix_gain":8,"pa_gain":3,"rf_power":11}, + "tx_lut_2":{"dig_gain":2,"mix_gain":11,"pa_gain":2,"rf_power":12}, + "tx_lut_3":{"dig_gain":0,"mix_gain":10,"pa_gain":2,"rf_power":13}, + "tx_lut_4":{"dig_gain":3,"mix_gain":14,"pa_gain":2,"rf_power":14}, + "tx_lut_5":{"dig_gain":1,"mix_gain":12,"pa_gain":2,"rf_power":15}, + "tx_lut_6":{"dig_gain":0,"mix_gain":12,"pa_gain":2,"rf_power":16}, + "tx_lut_7":{"dig_gain":2,"mix_gain":14,"pa_gain":2,"rf_power":17}, + "tx_lut_8":{"dig_gain":2,"mix_gain":15,"pa_gain":2,"rf_power":18}, + "tx_lut_9":{"dig_gain":1,"mix_gain":15,"pa_gain":2,"rf_power":19}, + "tx_lut_10":{"dig_gain":0,"mix_gain":9,"pa_gain":3,"rf_power":20}, + "tx_lut_11":{"dig_gain":1,"mix_gain":10,"pa_gain":3,"rf_power":21}, + "tx_lut_12":{"dig_gain":0,"mix_gain":10,"pa_gain":3,"rf_power":22}, + "tx_lut_13":{"dig_gain":0,"mix_gain":11,"pa_gain":3,"rf_power":23}, + "tx_lut_14":{"dig_gain":2,"mix_gain":14,"pa_gain":3,"rf_power":24}, + "tx_lut_15":{"dig_gain":0,"mix_gain":15,"pa_gain":3,"rf_power":25} }, "gateway_conf": { "gateway_ID": "<WILL-BE-AUTO-REPLACED-WITH-LORA-EUI>", diff --git a/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.KR920-LBT.basic b/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.KR920-LBT.basic index fa7c520..9daa32e 100644 --- a/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.KR920-LBT.basic +++ b/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.KR920-LBT.basic @@ -112,118 +112,22 @@ "tx_enable": false, "type": "SX1257" }, - "tx_lut_0" : - { - "dig_gain" : 2, - "mix_gain" : 9, - "pa_gain" : 0, - "rf_power" : -6 - }, - "tx_lut_1" : - { - "dig_gain" : 0, - "mix_gain" : 9, - "pa_gain" : 0, - "rf_power" : -3 - }, - "tx_lut_10" : - { - "dig_gain" : 0, - "mix_gain" : 10, - "pa_gain" : 2, - "rf_power" : 16 - }, - "tx_lut_11" : - { - "dig_gain" : 0, - "mix_gain" : 14, - "pa_gain" : 2, - "rf_power" : 20 - }, - "tx_lut_12" : - { - "dig_gain" : 0, - "mix_gain" : 8, - "pa_gain" : 3, - "rf_power" : 23 - }, - "tx_lut_13" : - { - "dig_gain" : 3, - "mix_gain" : 13, - "pa_gain" : 3, - "rf_power" : 25 - }, - "tx_lut_14" : - { - "dig_gain" : 0, - "mix_gain" : 12, - "pa_gain" : 3, - "rf_power" : 26 - }, - "tx_lut_15" : - { - "dig_gain" : 2, - "mix_gain" : 15, - "pa_gain" : 3, - "rf_power" : 27 - }, - "tx_lut_2" : - { - "dig_gain" : 2, - "mix_gain" : 13, - "pa_gain" : 0, - "rf_power" : 0 - }, - "tx_lut_3" : - { - "dig_gain" : 3, - "mix_gain" : 10, - "pa_gain" : 1, - "rf_power" : 3 - }, - "tx_lut_4" : - { - "dig_gain" : 2, - "mix_gain" : 10, - "pa_gain" : 1, - "rf_power" : 6 - }, - "tx_lut_5" : - { - "dig_gain" : 3, - "mix_gain" : 15, - "pa_gain" : 1, - "rf_power" : 10 - }, - "tx_lut_6" : - { - "dig_gain" : 0, - "mix_gain" : 13, - "pa_gain" : 1, - "rf_power" : 11 - }, - "tx_lut_7" : - { - "dig_gain" : 0, - "mix_gain" : 15, - "pa_gain" : 1, - "rf_power" : 12 - }, - "tx_lut_8" : - { - "dig_gain" : 0, - "mix_gain" : 8, - "pa_gain" : 2, - "rf_power" : 13 - }, - "tx_lut_9" : - { - "dig_gain" : 3, - "mix_gain" : 12, - "pa_gain" : 2, - "rf_power" : 14 - } + "tx_lut_0":{"dig_gain":2,"mix_gain":15,"pa_gain":1,"rf_power":10}, + "tx_lut_1":{"dig_gain":3,"mix_gain":8,"pa_gain":3,"rf_power":11}, + "tx_lut_2":{"dig_gain":2,"mix_gain":11,"pa_gain":2,"rf_power":12}, + "tx_lut_3":{"dig_gain":0,"mix_gain":10,"pa_gain":2,"rf_power":13}, + "tx_lut_4":{"dig_gain":3,"mix_gain":14,"pa_gain":2,"rf_power":14}, + "tx_lut_5":{"dig_gain":1,"mix_gain":12,"pa_gain":2,"rf_power":15}, + "tx_lut_6":{"dig_gain":0,"mix_gain":12,"pa_gain":2,"rf_power":16}, + "tx_lut_7":{"dig_gain":2,"mix_gain":14,"pa_gain":2,"rf_power":17}, + "tx_lut_8":{"dig_gain":2,"mix_gain":15,"pa_gain":2,"rf_power":18}, + "tx_lut_9":{"dig_gain":1,"mix_gain":15,"pa_gain":2,"rf_power":19}, + "tx_lut_10":{"dig_gain":0,"mix_gain":9,"pa_gain":3,"rf_power":20}, + "tx_lut_11":{"dig_gain":1,"mix_gain":10,"pa_gain":3,"rf_power":21}, + "tx_lut_12":{"dig_gain":0,"mix_gain":10,"pa_gain":3,"rf_power":22}, + "tx_lut_13":{"dig_gain":0,"mix_gain":11,"pa_gain":3,"rf_power":23}, + "tx_lut_14":{"dig_gain":2,"mix_gain":14,"pa_gain":3,"rf_power":24}, + "tx_lut_15":{"dig_gain":0,"mix_gain":15,"pa_gain":3,"rf_power":25} }, "gateway_conf": { "gateway_ID": "<WILL-BE-AUTO-REPLACED-WITH-LORA-EUI>", diff --git a/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.RU864.basic b/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.RU864.basic index a0636a7..d185858 100644 --- a/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.RU864.basic +++ b/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.RU864.basic @@ -82,102 +82,22 @@ "bandwidth": 125000, "datarate": 50000 }, - "tx_lut_0": { - "pa_gain": 0, - "mix_gain": 9, - "rf_power": -6, - "dig_gain": 1 - }, - "tx_lut_1": { - "pa_gain": 0, - "mix_gain": 12, - "rf_power": -3, - "dig_gain": 1 - }, - "tx_lut_2": { - "pa_gain": 1, - "mix_gain": 8, - "rf_power": 0, - "dig_gain": 2 - }, - "tx_lut_3": { - "pa_gain": 1, - "mix_gain": 11, - "rf_power": 3, - "dig_gain": 3 - }, - "tx_lut_4": { - "pa_gain": 1, - "mix_gain": 10, - "rf_power": 6, - "dig_gain": 0 - }, - "tx_lut_5": { - "pa_gain": 2, - "mix_gain": 11, - "rf_power": 10, - "dig_gain": 3 - }, - "tx_lut_6": { - "pa_gain": 2, - "mix_gain": 9, - "rf_power": 11, - "dig_gain": 1 - }, - "tx_lut_7": { - "pa_gain": 2, - "mix_gain": 9, - "rf_power": 12, - "dig_gain": 0 - }, - "tx_lut_8": { - "pa_gain": 2, - "mix_gain": 11, - "rf_power": 13, - "dig_gain": 2 - }, - "tx_lut_9": { - "pa_gain": 2, - "mix_gain": 11, - "rf_power": 14, - "dig_gain": 1 - }, - "tx_lut_10": { - "pa_gain": 2, - "mix_gain": 12, - "rf_power": 16, - "dig_gain": 0 - }, - "tx_lut_11": { - "pa_gain": 3, - "mix_gain": 10, - "rf_power": 20, - "dig_gain": 3 - }, - "tx_lut_12": { - "pa_gain": 3, - "mix_gain": 9, - "rf_power": 23, - "dig_gain": 0 - }, - "tx_lut_13": { - "pa_gain": 3, - "mix_gain": 12, - "rf_power": 25, - "dig_gain": 2 - }, - "tx_lut_14": { - "pa_gain": 3, - "mix_gain": 13, - "rf_power": 26, - "dig_gain": 0 - }, - "tx_lut_15": { - "pa_gain": 3, - "mix_gain": 15, - "rf_power": 27, - "dig_gain": 2 - } + "tx_lut_0":{"dig_gain":2,"mix_gain":15,"pa_gain":1,"rf_power":10}, + "tx_lut_1":{"dig_gain":3,"mix_gain":8,"pa_gain":3,"rf_power":11}, + "tx_lut_2":{"dig_gain":2,"mix_gain":11,"pa_gain":2,"rf_power":12}, + "tx_lut_3":{"dig_gain":0,"mix_gain":10,"pa_gain":2,"rf_power":13}, + "tx_lut_4":{"dig_gain":3,"mix_gain":14,"pa_gain":2,"rf_power":14}, + "tx_lut_5":{"dig_gain":1,"mix_gain":12,"pa_gain":2,"rf_power":15}, + "tx_lut_6":{"dig_gain":0,"mix_gain":12,"pa_gain":2,"rf_power":16}, + "tx_lut_7":{"dig_gain":2,"mix_gain":14,"pa_gain":2,"rf_power":17}, + "tx_lut_8":{"dig_gain":2,"mix_gain":15,"pa_gain":2,"rf_power":18}, + "tx_lut_9":{"dig_gain":1,"mix_gain":15,"pa_gain":2,"rf_power":19}, + "tx_lut_10":{"dig_gain":0,"mix_gain":9,"pa_gain":3,"rf_power":20}, + "tx_lut_11":{"dig_gain":1,"mix_gain":10,"pa_gain":3,"rf_power":21}, + "tx_lut_12":{"dig_gain":0,"mix_gain":10,"pa_gain":3,"rf_power":22}, + "tx_lut_13":{"dig_gain":0,"mix_gain":11,"pa_gain":3,"rf_power":23}, + "tx_lut_14":{"dig_gain":2,"mix_gain":14,"pa_gain":3,"rf_power":24}, + "tx_lut_15":{"dig_gain":0,"mix_gain":15,"pa_gain":3,"rf_power":25} }, "gateway_conf": { "gateway_ID": "<WILL-BE-AUTO-REPLACED-WITH-LORA-EUI>", diff --git a/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.US915.basic b/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.US915.basic index afcd070..dd39ac7 100644 --- a/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.US915.basic +++ b/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.1.0.MTCAP-LORA-1-5.US915.basic @@ -96,118 +96,22 @@ "tx_enable" : false, "type" : "SX1257" }, - "tx_lut_0" : - { - "dig_gain" : 2, - "mix_gain" : 9, - "pa_gain" : 0, - "rf_power" : -6 - }, - "tx_lut_1" : - { - "dig_gain" : 0, - "mix_gain" : 9, - "pa_gain" : 0, - "rf_power" : -3 - }, - "tx_lut_10" : - { - "dig_gain" : 0, - "mix_gain" : 10, - "pa_gain" : 2, - "rf_power" : 16 - }, - "tx_lut_11" : - { - "dig_gain" : 0, - "mix_gain" : 14, - "pa_gain" : 2, - "rf_power" : 20 - }, - "tx_lut_12" : - { - "dig_gain" : 0, - "mix_gain" : 8, - "pa_gain" : 3, - "rf_power" : 23 - }, - "tx_lut_13" : - { - "dig_gain" : 3, - "mix_gain" : 13, - "pa_gain" : 3, - "rf_power" : 25 - }, - "tx_lut_14" : - { - "dig_gain" : 0, - "mix_gain" : 12, - "pa_gain" : 3, - "rf_power" : 26 - }, - "tx_lut_15" : - { - "dig_gain" : 2, - "mix_gain" : 15, - "pa_gain" : 3, - "rf_power" : 27 - }, - "tx_lut_2" : - { - "dig_gain" : 2, - "mix_gain" : 13, - "pa_gain" : 0, - "rf_power" : 0 - }, - "tx_lut_3" : - { - "dig_gain" : 3, - "mix_gain" : 10, - "pa_gain" : 1, - "rf_power" : 3 - }, - "tx_lut_4" : - { - "dig_gain" : 2, - "mix_gain" : 10, - "pa_gain" : 1, - "rf_power" : 6 - }, - "tx_lut_5" : - { - "dig_gain" : 3, - "mix_gain" : 15, - "pa_gain" : 1, - "rf_power" : 10 - }, - "tx_lut_6" : - { - "dig_gain" : 0, - "mix_gain" : 13, - "pa_gain" : 1, - "rf_power" : 11 - }, - "tx_lut_7" : - { - "dig_gain" : 0, - "mix_gain" : 15, - "pa_gain" : 1, - "rf_power" : 12 - }, - "tx_lut_8" : - { - "dig_gain" : 0, - "mix_gain" : 8, - "pa_gain" : 2, - "rf_power" : 13 - }, - "tx_lut_9" : - { - "dig_gain" : 3, - "mix_gain" : 12, - "pa_gain" : 2, - "rf_power" : 14 - } + "tx_lut_0":{"dig_gain":2,"mix_gain":15,"pa_gain":1,"rf_power":10}, + "tx_lut_1":{"dig_gain":3,"mix_gain":8,"pa_gain":3,"rf_power":11}, + "tx_lut_2":{"dig_gain":2,"mix_gain":11,"pa_gain":2,"rf_power":12}, + "tx_lut_3":{"dig_gain":0,"mix_gain":10,"pa_gain":2,"rf_power":13}, + "tx_lut_4":{"dig_gain":3,"mix_gain":14,"pa_gain":2,"rf_power":14}, + "tx_lut_5":{"dig_gain":1,"mix_gain":12,"pa_gain":2,"rf_power":15}, + "tx_lut_6":{"dig_gain":0,"mix_gain":12,"pa_gain":2,"rf_power":16}, + "tx_lut_7":{"dig_gain":2,"mix_gain":14,"pa_gain":2,"rf_power":17}, + "tx_lut_8":{"dig_gain":2,"mix_gain":15,"pa_gain":2,"rf_power":18}, + "tx_lut_9":{"dig_gain":1,"mix_gain":15,"pa_gain":2,"rf_power":19}, + "tx_lut_10":{"dig_gain":0,"mix_gain":9,"pa_gain":3,"rf_power":20}, + "tx_lut_11":{"dig_gain":1,"mix_gain":10,"pa_gain":3,"rf_power":21}, + "tx_lut_12":{"dig_gain":0,"mix_gain":10,"pa_gain":3,"rf_power":22}, + "tx_lut_13":{"dig_gain":0,"mix_gain":11,"pa_gain":3,"rf_power":23}, + "tx_lut_14":{"dig_gain":2,"mix_gain":14,"pa_gain":3,"rf_power":24}, + "tx_lut_15":{"dig_gain":0,"mix_gain":15,"pa_gain":3,"rf_power":25} }, "gateway_conf": { "gateway_ID": "<WILL-BE-AUTO-REPLACED-WITH-LORA-EUI>", diff --git a/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-dedup-rx.patch b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-dedup-rx.patch new file mode 100644 index 0000000..c368033 --- /dev/null +++ b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-dedup-rx.patch @@ -0,0 +1,66 @@ +diff --git a/lora_pkt_fwd/src/lora_pkt_fwd.c b/lora_pkt_fwd/src/lora_pkt_fwd.c +index 801f28d..c35c64f 100644 +--- a/lora_pkt_fwd/src/lora_pkt_fwd.c ++++ b/lora_pkt_fwd/src/lora_pkt_fwd.c +@@ -126,8 +126,9 @@ volatile bool quit_sig = false; /* 1 -> application terminates without shutting + static bool fwd_valid_pkt = true; /* packets with PAYLOAD CRC OK are forwarded */ + static bool fwd_error_pkt = false; /* packets with PAYLOAD CRC ERROR are NOT forwarded */ + static bool fwd_nocrc_pkt = false; /* packets with NO PAYLOAD CRC are NOT forwarded */ ++static bool fwd_best_pkt = true; /* duplicate packets with low SNR are NOT forwarded */ + + /* network configuration variables */ + static uint64_t lgwm = 0; /* Lora gateway MAC address */ + static char serv_addr[64] = STR(DEFAULT_SERVER); /* address of the server (host name or IPv4/IPv6) */ + static char serv_port_up[8] = STR(DEFAULT_PORT_UP); /* server port for upstream traffic */ +@@ -731,6 +742,12 @@ static int parse_gateway_configuration(const char * conf_file) { + } + + /* packet filtering parameters */ ++ val = json_object_get_value(conf_obj, "best_packet_filter"); ++ if (json_value_get_type(val) == JSONBoolean) { ++ fwd_best_pkt = (bool)json_value_get_boolean(val); ++ } ++ MSG("INFO: duplicate packets received with low SNR will%s be forwarded\n", (!fwd_best_pkt ? "" : " NOT")); ++ + val = json_object_get_value(conf_obj, "forward_crc_valid"); + if (json_value_get_type(val) == JSONBoolean) { + fwd_valid_pkt = (bool)json_value_get_boolean(val); +@@ -1536,6 +1562,38 @@ void thread_up(void) { + memcpy((void *)(buff_up + buff_index), (void *)"{\"rxpk\":[", 9); + buff_index += 9; + ++ if (fwd_best_pkt && nb_pkt > 1) { ++ uint32_t check_addr = 0; ++ uint32_t check_mic = 0; ++ uint16_t check_fcnt = 0; ++ float check_snr = -30.0; ++ ++ for (i=0; i < nb_pkt; ++i) { ++ p = &rxpkt[i]; ++ if (p->size < 12) ++ continue; ++ ++ memcpy(&check_addr, p->payload + 1, 4); ++ memcpy(&check_fcnt, p->payload + 6, 2); ++ memcpy(&check_mic, p->payload + p->size - 4, 4); ++ ++ check_snr = p->snr; ++ ++ for (j=0; j < nb_pkt; ++j) { ++ p = &rxpkt[j]; ++ ++ if (p->size >= 12 ++ && memcmp(&check_addr, p->payload + 1, 4) == 0 ++ && memcmp(&check_fcnt, p->payload + 6, 2) == 0 ++ && memcmp(&check_mic, p->payload + p->size - 4, 4) == 0 ++ && p->snr < check_snr) { ++ // set status of duplicate packets rx'd on wrong channel ++ p->status = 1; ++ } ++ } ++ } ++ } ++ + /* serialize Lora packets metadata and payload */ + pkt_in_dgram = 0; + for (i=0; i < nb_pkt; ++i) { diff --git a/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-duty-cycle.patch b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-duty-cycle.patch new file mode 100644 index 0000000..b1790e7 --- /dev/null +++ b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-duty-cycle.patch @@ -0,0 +1,86 @@ +diff --git a/lora_pkt_fwd/src/lora_pkt_fwd.c b/lora_pkt_fwd/src/lora_pkt_fwd.c +index 801f28d..7b63b8f 100644 +--- a/lora_pkt_fwd/src/lora_pkt_fwd.c ++++ b/lora_pkt_fwd/src/lora_pkt_fwd.c +@@ -134,6 +134,12 @@ static char serv_port_up[8] = STR(DEFAULT_PORT_UP); /* server port for upstream traffic */ + static char serv_port_down[8] = STR(DEFAULT_PORT_DW); /* server port for downstream traffic */ + static int keepalive_time = DEFAULT_KEEPALIVE; /* send a PULL_DATA request every X seconds, negative = disabled */ + ++static bool duty_cycle_enabled = true; ++static uint32_t duty_cycle_time_avail = 0; ++static uint32_t duty_cycle_period = 3600; // seconds in one hour ++static double duty_cycle_ratio = 0.10; // 10% ++static uint32_t duty_cycle_time_max = 3600 * 0.10 * 1000u; // max time-on-air in window ++ + /* statistics collection configuration variables */ + static unsigned stat_interval = DEFAULT_STAT; /* time interval (in sec) at which statistics are collected and displayed */ + +@@ -729,8 +746,32 @@ static int parse_gateway_configuration(const char * conf_file) { + push_timeout_half.tv_usec = 500 * (long int)json_value_get_number(val); + MSG("INFO: upstream PUSH_DATA time-out is configured to %u ms\n", (unsigned)(push_timeout_half.tv_usec / 500)); + } ++ ++ /* duty-cycle limiting */ ++ val = json_object_get_value(conf_obj, "duty_cycle_enabled"); ++ if (json_value_get_type(val) == JSONBoolean) { ++ duty_cycle_enabled = (bool)json_value_get_boolean(val); ++ } ++ MSG("INFO: duty cycle will%s be enforced\n", (duty_cycle_enabled ? "" : " NOT")); ++ ++ if (duty_cycle_enabled) { ++ val = json_object_get_value(conf_obj, "duty_cycle_period"); ++ if (val != NULL) { ++ duty_cycle_period = (unsigned)json_value_get_number(val); ++ } ++ MSG("INFO: duty cycle period %u s\n", (duty_cycle_period)); ++ ++ val = json_object_get_value(conf_obj, "duty_cycle_ratio"); ++ if (val != NULL) { ++ duty_cycle_ratio = (double)json_value_get_number(val); ++ } ++ MSG("INFO: duty cycle %f %%\n", (duty_cycle_ratio * 100)); ++ ++ duty_cycle_time_max = duty_cycle_period * 1000u * duty_cycle_ratio; ++ } ++ + + /* packet filtering parameters */ + val = json_object_get_value(conf_obj, "best_packet_filter"); + if (json_value_get_type(val) == JSONBoolean) { + fwd_best_pkt = (bool)json_value_get_boolean(val); +@@ -1349,6 +1406,8 @@ int main(void) + printf("# PUSH_DATA datagrams sent: %u (%u bytes)\n", cp_up_dgram_sent, cp_up_network_byte); + printf("# PUSH_DATA acknowledged: %.2f%%\n", 100.0 * up_ack_ratio); + printf("### [DOWNSTREAM] ###\n"); ++ if (duty_cycle_enabled) ++ printf("# TIME ON AIR available: %u ms\n", duty_cycle_time_avail); + printf("# PULL_DATA sent: %u (%.2f%% acknowledged)\n", cp_dw_pull_sent, 100.0 * dw_ack_ratio); + printf("# PULL_RESP(onse) datagrams received: %u (%u bytes)\n", cp_dw_dgram_rcv, cp_dw_network_byte); + printf("# RF packets sent to concentrator: %u (%u bytes)\n", (cp_nb_tx_ok+cp_nb_tx_fail), cp_dw_payload_byte); + +@@ -2833,6 +2921,25 @@ void thread_valid(void) { + while (!exit_sig && !quit_sig) { + wait_ms(1000); + ++ if (duty_cycle_enabled) { ++ static struct timespec last = { 0, 0 }; ++ struct timespec now; ++ clock_gettime(CLOCK_MONOTONIC, &now); ++ ++ if (last.tv_sec != 0) { ++ // uint64(now.tv_sec) * 1000 + now.tv_nsec / 1000000 ++ ++ duty_cycle_time_avail += difftimespec(now, last) * 1000u * duty_cycle_ratio; ++ ++ if (duty_cycle_time_avail > duty_cycle_time_max) { ++ duty_cycle_time_avail = duty_cycle_time_max; ++ } ++ } ++ ++ last = now; ++ } ++ ++ + /* calculate when the time reference was last updated */ + pthread_mutex_lock(&mx_timeref); + gps_ref_age = (long)difftime(time(NULL), time_reference_gps.systime); diff --git a/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-gpsd.patch b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-gpsd.patch index 1c3c698..02bef12 100644 --- a/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-gpsd.patch +++ b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-gpsd.patch @@ -115,6 +115,15 @@ index 801f28d..6bca482 100644 if (i == LGW_HAL_SUCCESS) { MSG("INFO: GPS closed successfully\n"); } else { +@@ -2683,7 +2731,7 @@ static void gps_process_sync(void) { + i = lgw_gps_sync(&time_reference_gps, trig_tstamp, utc, gps_time); + pthread_mutex_unlock(&mx_timeref); + if (i != LGW_GPS_SUCCESS) { +- MSG("WARNING: [gps] GPS out of sync, keeping previous time reference\n"); ++// MSG("WARNING: [gps] GPS out of sync, keeping previous time reference\n"); + } + } + @@ -2691,7 +2695,7 @@ static void gps_process_coords(void) { /* position variable */ struct coord_s coord; diff --git a/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-jit-queue-increase-peek-and-remove-sort-from-dequeue.patch b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-jit-queue-increase-peek-and-remove-sort-from-dequeue.patch new file mode 100644 index 0000000..2b0aaf4 --- /dev/null +++ b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-jit-queue-increase-peek-and-remove-sort-from-dequeue.patch @@ -0,0 +1,36 @@ +diff --git a/lora_pkt_fwd/src/jitqueue.c b/lora_pkt_fwd/src/jitqueue.c +index dbde8d2..f1b547b 100644 +--- a/lora_pkt_fwd/src/jitqueue.c ++++ b/lora_pkt_fwd/src/jitqueue.c +@@ -37,6 +37,7 @@ Maintainer: Michael Coracin + #define TX_MARGIN_DELAY 1000 /* Packet overlap margin in microseconds */ + /* TODO: How much margin should we take? */ + #define TX_JIT_DELAY 30000 /* Pre-delay to program packet for TX in microseconds */ ++#define TX_PEEK_DELAY 60000 /* Look ahead time for TX in microseconds */ + #define TX_MAX_ADVANCE_DELAY ((JIT_NUM_BEACON_IN_QUEUE + 1) * 128 * 1E6) /* Maximum advance delay accepted for a TX packet, compared to current time */ + + #define BEACON_GUARD 3000000 /* Interval where no ping slot can be placed, +@@ -352,12 +353,12 @@ enum jit_error_e jit_dequeue(struct jit_queue_s *queue, int index, struct lgw_pk + memset(&(queue->nodes[queue->num_pkt]), 0, sizeof(struct jit_node_s)); + + /* Sort queue in ascending order of packet timestamp */ +- jit_sort_queue(queue); ++ // jit_sort_queue(queue); + + /* Done */ + pthread_mutex_unlock(&mx_jit_queue); + +- jit_print_queue(queue, false, DEBUG_JIT); ++ // jit_print_queue(queue, false, DEBUG_JIT); + + MSG_DEBUG(DEBUG_JIT, "dequeued packet with count_us=%u from index %d\n", packet->count_us, index); + +@@ -427,7 +428,7 @@ enum jit_error_e jit_peek(struct jit_queue_s *queue, struct timeval *time, int * + * Warning: unsigned arithmetic (handle roll-over) + * t_packet < t_current + TX_JIT_DELAY + */ +- if ((queue->nodes[idx_highest_priority].pkt.count_us - time_us) < TX_JIT_DELAY) { ++ if ((queue->nodes[idx_highest_priority].pkt.count_us - time_us) < TX_PEEK_DELAY) { + *pkt_idx = idx_highest_priority; + MSG_DEBUG(DEBUG_JIT, "peek packet with count_us=%u at index %d\n", + queue->nodes[idx_highest_priority].pkt.count_us, idx_highest_priority); |