summaryrefslogtreecommitdiff
path: root/recipes-connectivity/lora/lora-network-server
diff options
context:
space:
mode:
authorHarsh Sharma <harsh.sharma@multitech.com>2023-04-26 14:06:29 -0500
committerHarsh Sharma <harsh.sharma@multitech.com>2023-04-26 14:06:29 -0500
commit5ddd514e8fca35cc08a0b983a31ca6ba3a9922b3 (patch)
tree62802c5903b7f496f352f42eeeb2687b4a253827 /recipes-connectivity/lora/lora-network-server
parent2a6b87d80e16d9964bb9231c0af2357381aa56ff (diff)
downloadmeta-mlinux-5ddd514e8fca35cc08a0b983a31ca6ba3a9922b3.tar.gz
meta-mlinux-5ddd514e8fca35cc08a0b983a31ca6ba3a9922b3.tar.bz2
meta-mlinux-5ddd514e8fca35cc08a0b983a31ca6ba3a9922b3.zip
Revert "Bug fix: lns init script"
This reverts commit 1d7df5598e3d0f3a7c0698596fafc776d5eb8737.
Diffstat (limited to 'recipes-connectivity/lora/lora-network-server')
-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"
}