summaryrefslogtreecommitdiff
path: root/recipes-connectivity/lora/lora-network-server/lora-network-server.init
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-connectivity/lora/lora-network-server/lora-network-server.init')
-rwxr-xr-xrecipes-connectivity/lora/lora-network-server/lora-network-server.init32
1 files changed, 2 insertions, 30 deletions
diff --git a/recipes-connectivity/lora/lora-network-server/lora-network-server.init b/recipes-connectivity/lora/lora-network-server/lora-network-server.init
index 3c2764a..862f97a 100755
--- a/recipes-connectivity/lora/lora-network-server/lora-network-server.init
+++ b/recipes-connectivity/lora/lora-network-server/lora-network-server.init
@@ -59,33 +59,19 @@ dual_cards_installed=false
gps_path="/dev/gps0"
read_lora_hw_info() {
- set +e
-
- hw_id=$(mts-io-sysfs show hw-version)
+ hw_id=$(mts-io-sysfs show product-id 2> /dev/null)
# product-id of first lora card
lora_id=$(mts-io-sysfs show lora/product-id 2> /dev/null)
- if [ $? -ne 0 ]; then
- lora_id="NONE"
- fi
lora_eui=$(mts-io-sysfs show lora/eui 2> /dev/null)
- if [ $? -ne 0 ]; then
- lora_eui=$(mts-io-sysfs show mac-eth)
- lora_eui=${lora_eui:0:8}":FF:FF"${lora_eui:8:16}
- fi
# remove all colons
lora_eui_raw=${lora_eui//:}
lora_hw=$(mts-io-sysfs show lora/hw-version 2> /dev/null)
- if [ $? -ne 0 ]; then
- lora_hw="NONE"
- fi
if [ -d $port1 ] && [[ $(cat $port1/hw-version) =~ "LORA-1.5" ]] && [ -d $port2 ] && [[ $(cat $port2/hw-version) =~ "LORA-1.5" ]]; then
dual_cards_installed=true
elif [ -d $port1 ] && [[ $(cat $port1/hw-version) =~ "MTAC-003" ]] && [ -d $port2 ] && [[ $(cat $port2/hw-version) =~ "MTAC-003" ]]; then
dual_cards_installed=true
- elif [ -d $port1 ] && [[ $(cat $port1/hw-version) =~ "LORA-2G4" ]] && [ -d $port2 ] && [[ $(cat $port2/hw-version) =~ "LORA-2G4" ]]; then
- dual_cards_installed=true
fi
if [[ "$dual_cards_installed" = "true" ]] && [ -d $port2 ] && [[ $(cat $port2/hw-version) =~ "LORA-1.5" || $(cat $port2/hw-version) =~ "LORA-2G4" || $(cat $port2/hw-version) =~ "MTAC-003" ]]; then
@@ -97,20 +83,6 @@ read_lora_hw_info() {
lora_2_eui_raw=${lora_2_eui//:}
fi
- set -e
-
- # Check USB id for Semtech Card
- if [[ $(lsusb | grep 05c9:5740) =~ "05c9:5740" ]] && [[ ! "$lora_id" =~ "$lora_mtac_2g4_id" ]]; then
- lora_id=$lora_mtac_2g4_id
- lora_hw=$lora_2g4_hw
- lora_eui=$(mts-io-sysfs show mac-eth)
- lora_eui=${lora_eui:0:8}":FF:FF"${lora_eui:8:16}
- LORA_CAPABLE=true
- # Check USB id for Semtech Card in Bootloader mode
- elif [[ $(lsusb | grep 0483:df11) =~ "0483:df11" ]]; then
- echo "Semtech 2g4 MTAC card detected in Bootloader Mode, remove power from Conduit and restore"
- return 1
- fi
}
setup_mtcdt3() {
@@ -372,7 +344,7 @@ do_stop() {
start-stop-daemon --stop --quiet --oknodo --pidfile $net_server_pidfile --retry TERM/60/KILL/5
start-stop-daemon --stop --quiet --oknodo --pidfile $pkt_fwd_pidfile --retry 5
start-stop-daemon --stop --quiet --oknodo --pidfile $pkt_fwd_2_pidfile --retry 5
- rm -f $net_server_pidfile $pkt_fwd_pidfile $pkt_fwd_2_pidfile
+ rm -f $net_server_pidfile $pkt_fwd_pidfile
echo "OK"
}