summaryrefslogtreecommitdiff
path: root/recipes-connectivity
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-connectivity')
-rw-r--r--recipes-connectivity/lora/lora-gateway-usb_1.7.0mts.bb14
-rw-r--r--recipes-connectivity/lora/lora-network-server_1.0.18.bb (renamed from recipes-connectivity/lora/lora-network-server_1.0.17.bb)4
-rw-r--r--recipes-connectivity/lora/lora-packet-forwarder-usb_1.4.1.bb4
-rw-r--r--recipes-connectivity/lora/lora-packet-forwarder/mtcap/lora-packet-forwarder.default (renamed from recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.default)0
-rwxr-xr-xrecipes-connectivity/lora/lora-packet-forwarder/mtcap/lora-packet-forwarder.init (renamed from recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init)0
-rw-r--r--recipes-connectivity/lora/lora-packet-forwarder/mtcdt/lora-packet-forwarder.default2
-rwxr-xr-xrecipes-connectivity/lora/lora-packet-forwarder/mtcdt/lora-packet-forwarder.init115
-rw-r--r--recipes-connectivity/lora/lora-packet-forwarder_3.0.0.bb8
8 files changed, 135 insertions, 12 deletions
diff --git a/recipes-connectivity/lora/lora-gateway-usb_1.7.0mts.bb b/recipes-connectivity/lora/lora-gateway-usb_1.7.0mts.bb
index 64ad81f..382328d 100644
--- a/recipes-connectivity/lora/lora-gateway-usb_1.7.0mts.bb
+++ b/recipes-connectivity/lora/lora-gateway-usb_1.7.0mts.bb
@@ -31,11 +31,11 @@ do_compile() {
}
do_install() {
- install -d ${D}${includedir}/lora
- install -d ${D}${libdir}/lora
- install -m 0644 libloragw/libloragw.a ${D}${libdir}/lora
- install -m 0644 libloragw/library.cfg ${D}${libdir}/lora
- install -m 0644 libloragw/inc/* ${D}${includedir}/lora
+ install -d ${D}${includedir}/lora-usb
+ install -d ${D}${libdir}/lora-usb
+ install -m 0644 libloragw/libloragw.a ${D}${libdir}/lora-usb
+ install -m 0644 libloragw/library.cfg ${D}${libdir}/lora-usb
+ install -m 0644 libloragw/inc/* ${D}${includedir}/lora-usb
install -d ${D}/opt/lora
install -d ${D}/opt/lora/gateway-utils-usb
@@ -49,8 +49,8 @@ PACKAGES += "${PN}-utils ${PN}-utils-dbg"
FILES_${PN}-utils = "/opt/lora/gateway-utils-usb/*"
FILES_${PN}-utils-dbg = "/opt/lora/.debug"
-FILES_${PN}-dev = "${includedir}/lora ${libdir}/lora/library.cfg"
-FILES_${PN}-staticdev = "${libdir}/lora/libloragw.a"
+FILES_${PN}-dev = "${includedir}/lora-usb ${libdir}/lora-usb/library.cfg"
+FILES_${PN}-staticdev = "${libdir}/lora-usb/libloragw.a"
# disable this on purpose for dev purposes
do_rm_work() {
diff --git a/recipes-connectivity/lora/lora-network-server_1.0.17.bb b/recipes-connectivity/lora/lora-network-server_1.0.18.bb
index 83e8f31..1a7aab6 100644
--- a/recipes-connectivity/lora/lora-network-server_1.0.17.bb
+++ b/recipes-connectivity/lora/lora-network-server_1.0.18.bb
@@ -13,8 +13,8 @@ SRC_URI = "http://multitech.net/downloads/lora-network-server_${TUNE_PKGARCH}_${
file://lora-network-server.logrotate.conf \
"
-SRC_URI[md5sum] = "4c88bdf1f213f2e37eb12eb9efcb96b0"
-SRC_URI[sha256sum] = "84b20fa48fa70d58e147fa079a5986d498ec78ad076b99b4b3a7dcc4f6a70a8e"
+SRC_URI[md5sum] = "9e83c88149fc9b9c969034edcc6371f8"
+SRC_URI[sha256sum] = "1e94620eed249c0c431987ac64850e329f7506ddd2d3c2ff6de0a554cb76ed52"
# binaries are already stripped, so suppress warning
INSANE_SKIP_${PN} = "already-stripped"
diff --git a/recipes-connectivity/lora/lora-packet-forwarder-usb_1.4.1.bb b/recipes-connectivity/lora/lora-packet-forwarder-usb_1.4.1.bb
index 541247b..7ca1ffb 100644
--- a/recipes-connectivity/lora/lora-packet-forwarder-usb_1.4.1.bb
+++ b/recipes-connectivity/lora/lora-packet-forwarder-usb_1.4.1.bb
@@ -26,8 +26,8 @@ S = "${WORKDIR}/git"
LORA_DIR = "/opt/lora"
-export LGW_PATH = "${STAGING_LIBDIR}/lora"
-export LGW_INC = "${STAGING_INCDIR}/lora"
+export LGW_PATH = "${STAGING_LIBDIR}/lora-usb"
+export LGW_INC = "${STAGING_INCDIR}/lora-usb"
CFLAGS += "-I${LGW_INC} -Iinc -I."
diff --git a/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.default b/recipes-connectivity/lora/lora-packet-forwarder/mtcap/lora-packet-forwarder.default
index be7dcd5..be7dcd5 100644
--- a/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.default
+++ b/recipes-connectivity/lora/lora-packet-forwarder/mtcap/lora-packet-forwarder.default
diff --git a/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init b/recipes-connectivity/lora/lora-packet-forwarder/mtcap/lora-packet-forwarder.init
index 9ffaf6d..9ffaf6d 100755
--- a/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init
+++ b/recipes-connectivity/lora/lora-packet-forwarder/mtcap/lora-packet-forwarder.init
diff --git a/recipes-connectivity/lora/lora-packet-forwarder/mtcdt/lora-packet-forwarder.default b/recipes-connectivity/lora/lora-packet-forwarder/mtcdt/lora-packet-forwarder.default
new file mode 100644
index 0000000..0f92640
--- /dev/null
+++ b/recipes-connectivity/lora/lora-packet-forwarder/mtcdt/lora-packet-forwarder.default
@@ -0,0 +1,2 @@
+# set to "yes" or "no" to control starting on boot
+ENABLED="no"
diff --git a/recipes-connectivity/lora/lora-packet-forwarder/mtcdt/lora-packet-forwarder.init b/recipes-connectivity/lora/lora-packet-forwarder/mtcdt/lora-packet-forwarder.init
new file mode 100755
index 0000000..510f171
--- /dev/null
+++ b/recipes-connectivity/lora/lora-packet-forwarder/mtcdt/lora-packet-forwarder.init
@@ -0,0 +1,115 @@
+#!/bin/bash
+
+
+NAME="lora-packet-forwarder"
+ENABLED="yes"
+
+
+[ -f /etc/default/$NAME ] && source /etc/default/$NAME
+
+run_dir=/var/run/lora
+conf_dir=/var/config/lora
+
+pkt_fwd=$run_dir/1/lora_pkt_fwd
+pkt_fwd_log=/var/log/lora-pkt-fwd-1.log
+pkt_fwd_pidfile=$run_dir/lora-pkt-fwd-1.pid
+
+
+port1=/sys/devices/platform/mts-io/ap1
+port2=/sys/devices/platform/mts-io/ap2
+
+
+lora_mtac_id="MTAC-LORA"
+lora_1_0_hw="MTAC-LORA-1.0"
+lora_1_5_h_hw="MTAC-LORA-1.5"
+
+
+read_card_info() {
+ # product-id of first lora card
+ lora_id=$(mts-io-sysfs show lora/product-id 2> /dev/null)
+ lora_eui=$(mts-io-sysfs show lora/eui 2> /dev/null)
+ # remove all colons
+ lora_eui_raw=${lora_eui//:/}
+ lora_hw=$(mts-io-sysfs show lora/hw-version 2> /dev/null)
+}
+
+
+card_found() {
+ if [ -d $port1 ] && [[ $(cat $port1/hw-version) = $lora_hw ]]; then
+ ln -sf /dev/spidev32766.2 /dev/spidev0.0
+ elif [ -d $port2 ] && [[ $(cat $port2/hw-version) = $lora_hw ]]; then
+ ln -sf /dev/spidev32765.2 /dev/spidev0.0
+ fi
+
+ if [[ "$lora_id" =~ "$lora_mtac_id" ]]; then
+ return 0
+ else
+ return 1
+ fi
+}
+
+
+do_start() {
+
+ mkdir -p $run_dir/1
+ read_card_info
+
+ if ! [ -f $conf_file ]; then
+ echo "$0: $conf_file missing"
+ exit 1
+ fi
+
+
+ if card_found; then
+ echo "Found $lora_id with $lora_hw hardware"
+ else
+ echo "$0: MTAC-LORA not detected"
+ exit 1
+ fi
+ echo -n "Starting $NAME: "
+ # start packet forwarder
+ cp $conf_dir/global_conf.json $run_dir/1/global_conf.json
+ /usr/sbin/start-stop-daemon --chdir $run_dir/1 --background --start --make-pidfile \
+ --pidfile $pkt_fwd_pidfile --startas /bin/bash -- -c "exec $pkt_fwd"
+
+ renice -n -20 -p $(pgrep $(basename $pkt_fwd))
+
+
+ echo "OK"
+}
+
+
+do_stop() {
+ echo -n "Stopping $NAME: "
+ start-stop-daemon --stop --quiet --oknodo --pidfile $pkt_fwd_pidfile --retry 5
+ rm -f $pkt_fwd_pidfile
+ echo "OK"
+}
+
+
+if [ "$ENABLED" != "yes" ]; then
+ echo "$NAME: disabled in /etc/default"
+ exit
+fi
+
+
+case "$1" in
+ "start")
+ do_start
+ ;;
+ "stop")
+ do_stop
+ ;;
+ "restart")
+ ## Stop the service and regardless of whether it was
+ ## running or not, start it again.
+ do_stop
+ do_start
+ ;;
+ *)
+ ## If no parameters are given, print which are avaiable.
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+ ;;
+esac
+
diff --git a/recipes-connectivity/lora/lora-packet-forwarder_3.0.0.bb b/recipes-connectivity/lora/lora-packet-forwarder_3.0.0.bb
index 85fb8e3..ada0493 100644
--- a/recipes-connectivity/lora/lora-packet-forwarder_3.0.0.bb
+++ b/recipes-connectivity/lora/lora-packet-forwarder_3.0.0.bb
@@ -6,7 +6,7 @@ SECTION = "console/utils"
LICENSE = "SEMTECH"
LIC_FILES_CHKSUM = "file://LICENSE;md5=22af7693d7b76ef0fc76161c4be76c45"
DEPENDS = "lora-gateway"
-PR = "r7"
+PR = "r9"
SRCREV = "v${PV}"
@@ -23,6 +23,7 @@ SRC_URI = "git://github.com/Lora-net/packet_forwarder.git;protocol=git \
file://lora-packet-forwarder-remove-jit-power-check.patch \
"
+
S = "${WORKDIR}/git"
LORA_DIR = "/opt/lora"
@@ -52,6 +53,11 @@ do_install_append_mtcdt() {
install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.EU868.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json
install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_0.EU868.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_0
install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.EU868.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5
+
+ install -d ${D}${sysconfdir}/default
+ install -m 0644 ${WORKDIR}/lora-packet-forwarder.default ${D}${sysconfdir}/default/lora-packet-forwarder
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/lora-packet-forwarder.init ${D}${sysconfdir}/init.d/lora-packet-forwarder
}
do_install_append_mtcap() {