From 961165c078505e47405a974bd771032557072776 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Tue, 1 Nov 2016 16:05:17 -0500 Subject: mtcap: rename machine type mtp to mtcap --- .../lora/lora-network-server-mtcap/local_conf.json | 7 ++ .../lora-network-server.conf | 36 ++++++++++ .../lora-network-server.default | 2 + .../lora-network-server.init | 80 ++++++++++++++++++++++ .../lora-network-server.logrotate.conf | 7 ++ .../lora/lora-network-server-mtcap_1.0.14.bb | 49 +++++++++++++ .../lora/lora-network-server-mtp/local_conf.json | 7 -- .../lora-network-server.conf | 36 ---------- .../lora-network-server.default | 2 - .../lora-network-server.init | 80 ---------------------- .../lora-network-server.logrotate.conf | 7 -- .../lora/lora-network-server-mtp_1.0.14.bb | 49 ------------- .../lora/lora-packet-forwarder_3.0.0.bb | 2 +- 13 files changed, 182 insertions(+), 182 deletions(-) create mode 100644 recipes-connectivity/lora/lora-network-server-mtcap/local_conf.json create mode 100644 recipes-connectivity/lora/lora-network-server-mtcap/lora-network-server.conf create mode 100644 recipes-connectivity/lora/lora-network-server-mtcap/lora-network-server.default create mode 100755 recipes-connectivity/lora/lora-network-server-mtcap/lora-network-server.init create mode 100644 recipes-connectivity/lora/lora-network-server-mtcap/lora-network-server.logrotate.conf create mode 100644 recipes-connectivity/lora/lora-network-server-mtcap_1.0.14.bb delete mode 100644 recipes-connectivity/lora/lora-network-server-mtp/local_conf.json delete mode 100644 recipes-connectivity/lora/lora-network-server-mtp/lora-network-server.conf delete mode 100644 recipes-connectivity/lora/lora-network-server-mtp/lora-network-server.default delete mode 100755 recipes-connectivity/lora/lora-network-server-mtp/lora-network-server.init delete mode 100644 recipes-connectivity/lora/lora-network-server-mtp/lora-network-server.logrotate.conf delete mode 100644 recipes-connectivity/lora/lora-network-server-mtp_1.0.14.bb (limited to 'recipes-connectivity/lora') diff --git a/recipes-connectivity/lora/lora-network-server-mtcap/local_conf.json b/recipes-connectivity/lora/lora-network-server-mtcap/local_conf.json new file mode 100644 index 0000000..3c2af80 --- /dev/null +++ b/recipes-connectivity/lora/lora-network-server-mtcap/local_conf.json @@ -0,0 +1,7 @@ +{ + "gateway_conf": { + "server_address": "localhost", + "serv_port_up": 1780, + "serv_port_down": 1782 + } +} diff --git a/recipes-connectivity/lora/lora-network-server-mtcap/lora-network-server.conf b/recipes-connectivity/lora/lora-network-server-mtcap/lora-network-server.conf new file mode 100644 index 0000000..448b3db --- /dev/null +++ b/recipes-connectivity/lora/lora-network-server-mtcap/lora-network-server.conf @@ -0,0 +1,36 @@ +{ + "lora": { + "netID": "010203", /* netID for beacon packets */ + "frequencyBand": "868", /* US="915", EU="868" */ + "rx1DatarateOffset": 0, /* Datarate offset for mote rx window 1 sent in join response (0-3) */ + "rx2Datarate": 12, /* Datarate for mote rx window 2 sent in join response (7-12) */ + "maxTxPower": 26, /* Max Tx power (dBm), -6 to 26 */ + "frequencyEU": 867500000, /* center freq for extra EU channels (Hz) */ + "antennaGain": 0 + }, + "udp": { + "appPortUp": 1784, /* port for user-developed application use */ + "appPortDown": 1786, /* port for user-developed application use */ + "upstreamPort": 1780, /* ports for LoRa network communication */ + "downstreamPort": 1782 /* ports for LoRa network communication */ + }, + "addressRange": { + "start": "00:00:00:01", /* address range used for mDots */ + "end": "FF:FF:FF:FE" + }, + "network": { + "public": true, /* set to false for private LoRa network with mDots + Conduit */ + "leasetime": 0, /* time until mDot join expires (minutes) or 0 for no expiration */ + "name": "YOUR-NETWORK-NAME", /* configure network security */ + "passphrase": "YOUR-NETWORK-PASSPHRASE" + }, + "log" : { + "console" : true, + "syslog" : false, + "level" : 30, /* error=10, warn=20, info=30, debug=50, trace=60, max=100 */ + "path": "/var/log/lora-network-server.log" + }, + "mqtt": { + "enabled": true + } +} diff --git a/recipes-connectivity/lora/lora-network-server-mtcap/lora-network-server.default b/recipes-connectivity/lora/lora-network-server-mtcap/lora-network-server.default new file mode 100644 index 0000000..be7dcd5 --- /dev/null +++ b/recipes-connectivity/lora/lora-network-server-mtcap/lora-network-server.default @@ -0,0 +1,2 @@ +# set to "yes" or "no" to control starting on boot +ENABLED="yes" diff --git a/recipes-connectivity/lora/lora-network-server-mtcap/lora-network-server.init b/recipes-connectivity/lora/lora-network-server-mtcap/lora-network-server.init new file mode 100755 index 0000000..86d731b --- /dev/null +++ b/recipes-connectivity/lora/lora-network-server-mtcap/lora-network-server.init @@ -0,0 +1,80 @@ +#!/bin/bash + +NAME="lora-network-server" +ENABLED="yes" + +START_STOP_DAEMON="/usr/sbin/start-stop-daemon" + +[ -f /etc/default/$NAME ] && source /etc/default/$NAME + +run_dir=/var/run/lora +conf_dir=/var/config/lora +conf_file=/opt/lora/lora-network-server.conf +conf_db=$conf_dir/lora-network-server.db + +net_server=/opt/lora/lora-network-server +net_server_log=/var/log/lora-network-server.log +net_server_pidfile=$run_dir/$NAME.pid + +pkt_fwd=/opt/lora/lora_pkt_fwd +pkt_fwd_pidfile=$run_dir/lora-pkt-fwd-1.pid + +do_start() { + if ! [ -f $conf_file ]; then + echo "$0: $conf_file missing" + exit 1 + fi + + echo -n "Starting $NAME: " + mkdir -p $run_dir/1 + # start network server + $START_STOP_DAEMON --start --background --make-pidfile \ + --pidfile $net_server_pidfile --startas /bin/bash \ + --chdir "/opt/lora" -- -c "exec $net_server \ + -c $conf_file --lora-path $run_dir --db $conf_db \ + --noconsole -l $net_server_log >> $net_server_log 2>&1" + sleep 2 + # start packet forwarder + $START_STOP_DAEMON --start --background --make-pidfile \ + --pidfile $pkt_fwd_pidfile --exec $pkt_fwd --chdir "/opt/lora/" + + renice -n -20 -p $(pgrep lora-network-se) + renice -n -20 -p $(pgrep $(basename $pkt_fwd)) + + echo "OK" +} + +do_stop() { + echo -n "Stopping $NAME: " + $START_STOP_DAEMON --stop --quiet --oknodo --pidfile $net_server_pidfile --retry 15 + $START_STOP_DAEMON --stop --quiet --oknodo --pidfile $pkt_fwd_pidfile --retry 5 + rm -f $net_server_pidfile $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-network-server-mtcap/lora-network-server.logrotate.conf b/recipes-connectivity/lora/lora-network-server-mtcap/lora-network-server.logrotate.conf new file mode 100644 index 0000000..d2b6c9a --- /dev/null +++ b/recipes-connectivity/lora/lora-network-server-mtcap/lora-network-server.logrotate.conf @@ -0,0 +1,7 @@ +/var/log/lora-pkt-fwd*.log /var/log/lora-network-server.log { + size 512k + rotate 4 + compress + copytruncate + missingok +} diff --git a/recipes-connectivity/lora/lora-network-server-mtcap_1.0.14.bb b/recipes-connectivity/lora/lora-network-server-mtcap_1.0.14.bb new file mode 100644 index 0000000..8b81b74 --- /dev/null +++ b/recipes-connectivity/lora/lora-network-server-mtcap_1.0.14.bb @@ -0,0 +1,49 @@ +# THIS RECIPE FOR PICOCELL USES PATCHED LORA NETWORK SERVER THAT SUPPORTS +# MTCAP HARDWARE AND V2 PACKET FORWARDER PROTOCOL +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 = "r1" + +SRC_URI = "http://multitech.net/downloads/lora-network-server_${TUNE_PKGARCH}_${PV}.tar.gz \ + file://lora-network-server.conf \ + file://lora-network-server.init \ + file://lora-network-server.default \ + file://lora-network-server.logrotate.conf \ + file://local_conf.json \ + " + +SRC_URI[md5sum] = "6cbae4e82503c5b5078b4ffadcda05a0" +SRC_URI[sha256sum] = "707e919b02f1f7d3ef8ed66f26b7e8749f4d0db55288062f1aa4c04e5ceccf34" + +# binaries are already stripped, so suppress warning +INSANE_SKIP_${PN} = "already-stripped" + +S = "${WORKDIR}" + +LORA_DIR = "/opt/lora" + +do_compile() { +} + +do_install() { + install -d ${D}${LORA_DIR} + install -m 0755 lora-network-server ${D}${LORA_DIR}/ + install -m 0644 ${WORKDIR}/lora-network-server.conf ${D}${LORA_DIR}/ + install -m 0755 ${WORKDIR}/local_conf.json ${D}${LORA_DIR}/ + + 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-mtp/local_conf.json b/recipes-connectivity/lora/lora-network-server-mtp/local_conf.json deleted file mode 100644 index 3c2af80..0000000 --- a/recipes-connectivity/lora/lora-network-server-mtp/local_conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "gateway_conf": { - "server_address": "localhost", - "serv_port_up": 1780, - "serv_port_down": 1782 - } -} diff --git a/recipes-connectivity/lora/lora-network-server-mtp/lora-network-server.conf b/recipes-connectivity/lora/lora-network-server-mtp/lora-network-server.conf deleted file mode 100644 index 448b3db..0000000 --- a/recipes-connectivity/lora/lora-network-server-mtp/lora-network-server.conf +++ /dev/null @@ -1,36 +0,0 @@ -{ - "lora": { - "netID": "010203", /* netID for beacon packets */ - "frequencyBand": "868", /* US="915", EU="868" */ - "rx1DatarateOffset": 0, /* Datarate offset for mote rx window 1 sent in join response (0-3) */ - "rx2Datarate": 12, /* Datarate for mote rx window 2 sent in join response (7-12) */ - "maxTxPower": 26, /* Max Tx power (dBm), -6 to 26 */ - "frequencyEU": 867500000, /* center freq for extra EU channels (Hz) */ - "antennaGain": 0 - }, - "udp": { - "appPortUp": 1784, /* port for user-developed application use */ - "appPortDown": 1786, /* port for user-developed application use */ - "upstreamPort": 1780, /* ports for LoRa network communication */ - "downstreamPort": 1782 /* ports for LoRa network communication */ - }, - "addressRange": { - "start": "00:00:00:01", /* address range used for mDots */ - "end": "FF:FF:FF:FE" - }, - "network": { - "public": true, /* set to false for private LoRa network with mDots + Conduit */ - "leasetime": 0, /* time until mDot join expires (minutes) or 0 for no expiration */ - "name": "YOUR-NETWORK-NAME", /* configure network security */ - "passphrase": "YOUR-NETWORK-PASSPHRASE" - }, - "log" : { - "console" : true, - "syslog" : false, - "level" : 30, /* error=10, warn=20, info=30, debug=50, trace=60, max=100 */ - "path": "/var/log/lora-network-server.log" - }, - "mqtt": { - "enabled": true - } -} diff --git a/recipes-connectivity/lora/lora-network-server-mtp/lora-network-server.default b/recipes-connectivity/lora/lora-network-server-mtp/lora-network-server.default deleted file mode 100644 index be7dcd5..0000000 --- a/recipes-connectivity/lora/lora-network-server-mtp/lora-network-server.default +++ /dev/null @@ -1,2 +0,0 @@ -# set to "yes" or "no" to control starting on boot -ENABLED="yes" diff --git a/recipes-connectivity/lora/lora-network-server-mtp/lora-network-server.init b/recipes-connectivity/lora/lora-network-server-mtp/lora-network-server.init deleted file mode 100755 index 86d731b..0000000 --- a/recipes-connectivity/lora/lora-network-server-mtp/lora-network-server.init +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash - -NAME="lora-network-server" -ENABLED="yes" - -START_STOP_DAEMON="/usr/sbin/start-stop-daemon" - -[ -f /etc/default/$NAME ] && source /etc/default/$NAME - -run_dir=/var/run/lora -conf_dir=/var/config/lora -conf_file=/opt/lora/lora-network-server.conf -conf_db=$conf_dir/lora-network-server.db - -net_server=/opt/lora/lora-network-server -net_server_log=/var/log/lora-network-server.log -net_server_pidfile=$run_dir/$NAME.pid - -pkt_fwd=/opt/lora/lora_pkt_fwd -pkt_fwd_pidfile=$run_dir/lora-pkt-fwd-1.pid - -do_start() { - if ! [ -f $conf_file ]; then - echo "$0: $conf_file missing" - exit 1 - fi - - echo -n "Starting $NAME: " - mkdir -p $run_dir/1 - # start network server - $START_STOP_DAEMON --start --background --make-pidfile \ - --pidfile $net_server_pidfile --startas /bin/bash \ - --chdir "/opt/lora" -- -c "exec $net_server \ - -c $conf_file --lora-path $run_dir --db $conf_db \ - --noconsole -l $net_server_log >> $net_server_log 2>&1" - sleep 2 - # start packet forwarder - $START_STOP_DAEMON --start --background --make-pidfile \ - --pidfile $pkt_fwd_pidfile --exec $pkt_fwd --chdir "/opt/lora/" - - renice -n -20 -p $(pgrep lora-network-se) - renice -n -20 -p $(pgrep $(basename $pkt_fwd)) - - echo "OK" -} - -do_stop() { - echo -n "Stopping $NAME: " - $START_STOP_DAEMON --stop --quiet --oknodo --pidfile $net_server_pidfile --retry 15 - $START_STOP_DAEMON --stop --quiet --oknodo --pidfile $pkt_fwd_pidfile --retry 5 - rm -f $net_server_pidfile $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-network-server-mtp/lora-network-server.logrotate.conf b/recipes-connectivity/lora/lora-network-server-mtp/lora-network-server.logrotate.conf deleted file mode 100644 index d2b6c9a..0000000 --- a/recipes-connectivity/lora/lora-network-server-mtp/lora-network-server.logrotate.conf +++ /dev/null @@ -1,7 +0,0 @@ -/var/log/lora-pkt-fwd*.log /var/log/lora-network-server.log { - size 512k - rotate 4 - compress - copytruncate - missingok -} diff --git a/recipes-connectivity/lora/lora-network-server-mtp_1.0.14.bb b/recipes-connectivity/lora/lora-network-server-mtp_1.0.14.bb deleted file mode 100644 index 2f5e0bf..0000000 --- a/recipes-connectivity/lora/lora-network-server-mtp_1.0.14.bb +++ /dev/null @@ -1,49 +0,0 @@ -# THIS RECIPE FOR PICOCELL USES PATCHED LORA NETWORK SERVER THAT SUPPORTS -# MTP HARDWARE AND V2 PACKET FORWARDER PROTOCOL -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 = "r1" - -SRC_URI = "http://multitech.net/downloads/lora-network-server_${TUNE_PKGARCH}_${PV}.tar.gz \ - file://lora-network-server.conf \ - file://lora-network-server.init \ - file://lora-network-server.default \ - file://lora-network-server.logrotate.conf \ - file://local_conf.json \ - " - -SRC_URI[md5sum] = "6cbae4e82503c5b5078b4ffadcda05a0" -SRC_URI[sha256sum] = "707e919b02f1f7d3ef8ed66f26b7e8749f4d0db55288062f1aa4c04e5ceccf34" - -# binaries are already stripped, so suppress warning -INSANE_SKIP_${PN} = "already-stripped" - -S = "${WORKDIR}" - -LORA_DIR = "/opt/lora" - -do_compile() { -} - -do_install() { - install -d ${D}${LORA_DIR} - install -m 0755 lora-network-server ${D}${LORA_DIR}/ - install -m 0644 ${WORKDIR}/lora-network-server.conf ${D}${LORA_DIR}/ - install -m 0755 ${WORKDIR}/local_conf.json ${D}${LORA_DIR}/ - - 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-packet-forwarder_3.0.0.bb b/recipes-connectivity/lora/lora-packet-forwarder_3.0.0.bb index 8042d50..c5c9f64 100644 --- a/recipes-connectivity/lora/lora-packet-forwarder_3.0.0.bb +++ b/recipes-connectivity/lora/lora-packet-forwarder_3.0.0.bb @@ -44,7 +44,7 @@ do_install() { install -m 755 ${WORKDIR}/README.md ${D}${LORA_DIR}/ } -do_install_append_mtp() { +do_install_append_mtcap() { 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 -- cgit v1.2.3