From 07190a0b16195637cb9a1d4030109c152f4a8585 Mon Sep 17 00:00:00 2001 From: Jason Reiss Date: Fri, 18 Sep 2015 15:22:09 -0500 Subject: lora: update network server to 0.0.8 --- .../lora/lora-network-server_0.0.7.bb | 49 ---------------------- .../lora/lora-network-server_0.0.8.bb | 49 ++++++++++++++++++++++ 2 files changed, 49 insertions(+), 49 deletions(-) delete mode 100644 recipes-connectivity/lora/lora-network-server_0.0.7.bb create mode 100644 recipes-connectivity/lora/lora-network-server_0.0.8.bb diff --git a/recipes-connectivity/lora/lora-network-server_0.0.7.bb b/recipes-connectivity/lora/lora-network-server_0.0.7.bb deleted file mode 100644 index 6e6cc17..0000000 --- a/recipes-connectivity/lora/lora-network-server_0.0.7.bb +++ /dev/null @@ -1,49 +0,0 @@ -DESCRIPTION = "MultiTech LoRa Network Server" -PRIORITY = "optional" -SECTION = "console/utils" -LICENSE = "Proprietary" -LIC_FILES_CHKSUM = "file://LICENSE;md5=7ffae4666a986c4ccf45e99e464f8402" -DEPENDS = "jsoncpp libmts mosquitto sqlite3" -RDEPENDS_${PN} += "lora-packet-forwarder logrotate" -PR = "r0" - -SRC_URI = "http://multitech.net/downloads/lora-network-server_${TUNE_PKGARCH}_${PV}.tar.gz \ - file://lora-network-server.init \ - file://lora-network-server.default \ - file://lora-network-server.logrotate.conf \ - " - -SRC_URI[md5sum] = "c22a75e96f22f55054796dfb04540d49" -SRC_URI[sha256sum] = "27be3a327ba4c3b7eba4c4fe896de0a67f6a394257be0440ab4ea02238d8e097" - -# 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 ${D}${LORA_DIR}/ - install -m 0644 lora-network-server.conf.sample ${D}${LORA_DIR}/lora-network-server.conf.sample - - 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 - install -d ${D}${sysconfdir}/logrotate.d - install -m 0644 ${WORKDIR}/lora-network-server.logrotate.conf ${D}${sysconfdir}/logrotate.d/lora-network-server.conf -} - -CONFFILES_${PN} = "${sysconfdir}/default/lora-network-server" -FILES_${PN} += "${LORA_DIR}" -FILES_${PN}-dbg += "${LORA_DIR}/.debug" diff --git a/recipes-connectivity/lora/lora-network-server_0.0.8.bb b/recipes-connectivity/lora/lora-network-server_0.0.8.bb new file mode 100644 index 0000000..d2f55e8 --- /dev/null +++ b/recipes-connectivity/lora/lora-network-server_0.0.8.bb @@ -0,0 +1,49 @@ +DESCRIPTION = "MultiTech LoRa Network Server" +PRIORITY = "optional" +SECTION = "console/utils" +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://LICENSE;md5=7ffae4666a986c4ccf45e99e464f8402" +DEPENDS = "jsoncpp libmts mosquitto sqlite3" +RDEPENDS_${PN} += "lora-packet-forwarder logrotate" +PR = "r0" + +SRC_URI = "http://multitech.net/downloads/lora-network-server_${TUNE_PKGARCH}_${PV}.tar.gz \ + file://lora-network-server.init \ + file://lora-network-server.default \ + file://lora-network-server.logrotate.conf \ + " + +SRC_URI[md5sum] = "8cb2686b427a32d53e301e87870b49cf" +SRC_URI[sha256sum] = "be7de4463f17645882ed6194d9af2bc9a4608005635c8d31d5c5ec8bf552c73f" + +# 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 ${D}${LORA_DIR}/ + install -m 0644 lora-network-server.conf.sample ${D}${LORA_DIR}/lora-network-server.conf.sample + + 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 + install -d ${D}${sysconfdir}/logrotate.d + install -m 0644 ${WORKDIR}/lora-network-server.logrotate.conf ${D}${sysconfdir}/logrotate.d/lora-network-server.conf +} + +CONFFILES_${PN} = "${sysconfdir}/default/lora-network-server" +FILES_${PN} += "${LORA_DIR}" +FILES_${PN}-dbg += "${LORA_DIR}/.debug" -- cgit v1.2.3 From 78d26301e49caa1e338adcba3a3afa344ff07d38 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Tue, 22 Sep 2015 13:40:29 -0500 Subject: fix: mosquitto build breaking because of missing dependancy --- recipes-connectivity/mosquitto/mosquitto_1.4.bb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes-connectivity/mosquitto/mosquitto_1.4.bb b/recipes-connectivity/mosquitto/mosquitto_1.4.bb index 319ca49..3f035a7 100644 --- a/recipes-connectivity/mosquitto/mosquitto_1.4.bb +++ b/recipes-connectivity/mosquitto/mosquitto_1.4.bb @@ -5,7 +5,8 @@ SECTION = "console/network" LICENSE = "EPL-1.0 EDL-1.0" LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=62ddc846179e908dc0c8efec4a42ef20" -DEPENDS = "c-ares openssl" +# util-linux is needed to provide libuuid dependancy +DEPENDS = "c-ares openssl util-linux" PR = "r2" -- cgit v1.2.3 From d95551cedd66dd0a60c2a1dcc2c9bda290c9aaf4 Mon Sep 17 00:00:00 2001 From: Jason Reiss Date: Tue, 29 Sep 2015 12:10:48 -0500 Subject: lora: add queue to packet forwarder --- .../lora-packet-forwarder-add-queue.patch | 164 +++++++++++++++++++++ .../lora/lora-packet-forwarder_1.4.1.bb | 3 +- 2 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-add-queue.patch diff --git a/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-add-queue.patch b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-add-queue.patch new file mode 100644 index 0000000..318b6ea --- /dev/null +++ b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-add-queue.patch @@ -0,0 +1,164 @@ +From fdf5d6669d5132da9016840dfe2c1c99f525e4bc Mon Sep 17 00:00:00 2001 +From: Jason Reiss +Date: Tue, 29 Sep 2015 12:01:12 -0500 +Subject: [PATCH] add-queue to pkt-fwd + +--- + basic_pkt_fwd/src/basic_pkt_fwd.c | 93 +++++++++++++++++++++++++++++++++++-- + 1 file changed, 88 insertions(+), 5 deletions(-) + +diff --git a/basic_pkt_fwd/src/basic_pkt_fwd.c b/basic_pkt_fwd/src/basic_pkt_fwd.c +index e20dfc1..4d0bb35 100644 +--- a/basic_pkt_fwd/src/basic_pkt_fwd.c ++++ b/basic_pkt_fwd/src/basic_pkt_fwd.c +@@ -162,8 +162,19 @@ static int parse_gateway_configuration(const char * conf_file); + + static double difftimespec(struct timespec end, struct timespec beginning); + ++typedef struct tx_queue_s { ++ struct lgw_pkt_tx_s pkt; ++ struct tx_queue_s* next; ++} tx_queue_s; ++ ++ ++struct tx_queue_s* tx_queue = NULL; ++struct tx_queue_s* tx_queue_end = NULL; ++ ++ + /* threads */ + void thread_up(void); ++void thread_queue(void); + void thread_down(void); + + /* -------------------------------------------------------------------------- */ +@@ -479,6 +490,7 @@ int main(void) + + /* threads */ + pthread_t thrid_up; ++ pthread_t thrid_queue; + pthread_t thrid_down; + + /* network socket creation */ +@@ -649,6 +661,11 @@ int main(void) + MSG("ERROR: [main] impossible to create downstream thread\n"); + exit(EXIT_FAILURE); + } ++ i = pthread_create( &thrid_queue, NULL, (void * (*)(void *))thread_queue, NULL); ++ if (i != 0) { ++ MSG("ERROR: [main] impossible to create queue thread\n"); ++ exit(EXIT_FAILURE); ++ } + + /* configure signal handling */ + sigemptyset(&sigact.sa_mask); +@@ -744,6 +761,7 @@ int main(void) + + /* wait for upstream thread to finish (1 fetch cycle max) */ + pthread_join(thrid_up, NULL); ++ pthread_cancel(thrid_queue); + pthread_cancel(thrid_down); /* don't wait for downstream thread */ + + /* if an exit signal was received, try to quit properly */ +@@ -1121,9 +1139,9 @@ void thread_up(void) { + } + + /* -------------------------------------------------------------------------- */ +-/* --- THREAD 2: POLLING SERVER AND EMITTING PACKETS ------------------------ */ ++/* --- THREAD 2: POLLING SERVER AND QUEUEING PACKETS ------------------------ */ + +-void thread_down(void) { ++void thread_queue(void) { + int i; /* loop variables */ + + /* configuration and metadata for an outbound packet */ +@@ -1462,11 +1480,48 @@ void thread_down(void) { + meas_dw_dgram_rcv += 1; /* count only datagrams with no JSON errors */ + meas_dw_network_byte += msg_len; /* meas_dw_network_byte */ + meas_dw_payload_byte += txpkt.size; ++ pthread_mutex_unlock(&mx_meas_dw); ++ ++ pthread_mutex_lock(&mx_concent); /* may have to wait for a fetch to finish */ ++ if (tx_queue == NULL) { ++ tx_queue = malloc(sizeof(tx_queue_s)); ++ tx_queue_end = tx_queue; ++ tx_queue->pkt = txpkt; ++ tx_queue->next = NULL; ++ } else { ++ struct tx_queue_s* item = malloc(sizeof(tx_queue_s)); ++ item->next = NULL; ++ item->pkt = txpkt; ++ tx_queue_end->next = item; ++ tx_queue_end = item; ++ } ++ pthread_mutex_unlock(&mx_concent); ++ } ++ wait_ms(1); ++ } ++ MSG("\nINFO: End of queue thread\n"); ++} ++ ++/* -------------------------------------------------------------------------- */ ++/* --- THREAD 3: POLLING QUEUE AND EMITTING PACKETS ------------------------ */ ++ ++void thread_down(void) { ++ MSG("\nINFO: Start of downstream thread\n"); + ++ struct lgw_pkt_tx_s txpkt; ++ ++ while (!exit_sig && !quit_sig) { ++ pthread_mutex_lock(&mx_concent); /* may have to wait for a fetch to finish */ ++ if (tx_queue != NULL) { ++ struct tx_queue_s* del = tx_queue; ++ txpkt = tx_queue->pkt; ++ tx_queue = tx_queue->next; ++ free(del); + /* transfer data and metadata to the concentrator, and schedule TX */ +- pthread_mutex_lock(&mx_concent); /* may have to wait for a fetch to finish */ +- i = lgw_send(txpkt); ++ int i = lgw_send(txpkt); + pthread_mutex_unlock(&mx_concent); /* free concentrator ASAP */ ++ ++ pthread_mutex_lock(&mx_meas_dw); + if (i == LGW_HAL_ERROR) { + meas_nb_tx_fail += 1; + pthread_mutex_unlock(&mx_meas_dw); +@@ -1476,7 +1531,35 @@ void thread_down(void) { + meas_nb_tx_ok += 1; + pthread_mutex_unlock(&mx_meas_dw); + } +- } ++ ++ uint8_t tx_status_var = TX_STATUS_UNKNOWN; ++ // wait for 200 ms and ensure packet is transmitted ++ for (i=0; (i < 20) && (tx_status_var != TX_EMITTING); ++i) { ++ wait_ms(10); ++ pthread_mutex_lock(&mx_concent); ++ lgw_status(TX_STATUS, &tx_status_var); ++ pthread_mutex_unlock(&mx_concent); ++ } ++ if (tx_status_var != TX_EMITTING) { ++ MSG("WARNING: [down] packet was scheduled but failed to TX\n"); ++ } else { ++ // if packet is transmitting then wait for end of TX or timeout after 4 seconds ++ for (i=0; (i < 400) && (tx_status_var != TX_FREE); ++i) { ++ wait_ms(10); ++ pthread_mutex_lock(&mx_concent); ++ lgw_status(TX_STATUS, &tx_status_var); ++ pthread_mutex_unlock(&mx_concent); ++ } ++ ++ if (tx_status_var != TX_FREE) { ++ MSG("WARNING: [down] timedout waiting for end of TX\n"); ++ } ++ } ++ ++ } else { ++ pthread_mutex_unlock(&mx_concent); /* free concentrator ASAP */ ++ } ++ wait_ms(1); + } + MSG("\nINFO: End of downstream thread\n"); + } +-- +1.7.10.4 + diff --git a/recipes-connectivity/lora/lora-packet-forwarder_1.4.1.bb b/recipes-connectivity/lora/lora-packet-forwarder_1.4.1.bb index f7bd52e..bbb379d 100644 --- a/recipes-connectivity/lora/lora-packet-forwarder_1.4.1.bb +++ b/recipes-connectivity/lora/lora-packet-forwarder_1.4.1.bb @@ -6,7 +6,7 @@ SECTION = "console/utils" LICENSE = "SEMTECH" LIC_FILES_CHKSUM = "file://LICENSE;md5=22af7693d7b76ef0fc76161c4be76c45" DEPENDS = "lora-gateway" -PR = "r8" +PR = "r9" # tag v1.4.1 SRCREV = "0011a60759a7d81656a5393e97089daab1ff1a81" @@ -18,6 +18,7 @@ SRC_URI = "git://github.com/Lora-net/packet_forwarder.git;protocol=git \ file://lora-packet-forwarder-fixb64.patch \ file://lora-packet-forwarder-mts-enhancements.patch \ file://lora-packet-forwarder-synch-word.patch \ + file://lora-packet-forwarder-add-queue.patch \ " S = "${WORKDIR}/git" -- cgit v1.2.3 From 761bff22fb1649ce34a642c875bdde76de02c793 Mon Sep 17 00:00:00 2001 From: jhatch Date: Mon, 12 Oct 2015 12:25:57 -0500 Subject: Update with latest 0.1 commits after 0.1 tag: LE910: remove hard-coded AT&T carrier for LE910-NAG use CGREG? to query registration for LE910 models rename radio type VW2 to LVW2 --- recipes-support/multitech/libmts-io_0.1.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes-support/multitech/libmts-io_0.1.bb b/recipes-support/multitech/libmts-io_0.1.bb index 9863237..b0a89d8 100644 --- a/recipes-support/multitech/libmts-io_0.1.bb +++ b/recipes-support/multitech/libmts-io_0.1.bb @@ -6,8 +6,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=4fbd65380cdd255951079008b364516c" DEPENDS = "libmts jsoncpp cmake-native cppunit" BBCLASSEXTEND = "native" -PR = "r1" -SRCREV = "${PV}" +PR = "r2" +SRCREV = "c4d5c5e699743fa5a30f85f16edf2a3700099a78" SRC_URI = "git://git.multitech.net/libmts-io;branch=master" S = "${WORKDIR}/git" -- cgit v1.2.3 From 486e87e264233191ae1ed938281e8cdd43d47331 Mon Sep 17 00:00:00 2001 From: Jeff Hatch Date: Tue, 13 Oct 2015 12:10:47 -0500 Subject: Add LAT1, LEU1, and LVW2 LTE modems rules --- recipes-core/udev/udev-182/cellular_radios.rules | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes-core/udev/udev-182/cellular_radios.rules b/recipes-core/udev/udev-182/cellular_radios.rules index 81271ac..a3c06e4 100644 --- a/recipes-core/udev/udev-182/cellular_radios.rules +++ b/recipes-core/udev/udev-182/cellular_radios.rules @@ -43,5 +43,8 @@ ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+ ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem_at2" # EV2: ttyUSB0 ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", ENV{ID_PORT}=="0", SYMLINK+="modem_at0" +# LAT1, LEU1, LVW2: port 04 and port 05 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="04", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="05", SYMLINK+="modem_at1" LABEL="mlinux_end" -- cgit v1.2.3