summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--recipes-bsp/multitech/mts-io.inc5
-rwxr-xr-xrecipes-bsp/multitech/mts-io/lora-led-updater12
-rw-r--r--recipes-bsp/multitech/mts-io/mts-io.mtp.init5
3 files changed, 21 insertions, 1 deletions
diff --git a/recipes-bsp/multitech/mts-io.inc b/recipes-bsp/multitech/mts-io.inc
index 6d77e34..c9ee889 100644
--- a/recipes-bsp/multitech/mts-io.inc
+++ b/recipes-bsp/multitech/mts-io.inc
@@ -7,13 +7,14 @@ LIC_FILES_CHKSUM = "file://io-module/COPYING;md5=94d55d512a9ba36caa9b7df079bae19
file://io-tool/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
"
DEPENDS = "virtual/kernel"
-INC_PR = "r7"
+INC_PR = "r8"
SRCREV = "${PV}"
SRC_URI = " \
git://git.multitech.net/mts-io.git;protocol=git \
file://led-status_heartbeat_trigger \
+ file://lora-led-updater \
file://mts-io.init \
file://mts-io.mtp.init \
file://radio-reset.init \
@@ -46,6 +47,7 @@ FILES_${PN} = "${base_libdir}/modules/${KERNEL_VERSION}/extra/mts_io.ko"
FILES_${PN} += "${sysconfdir}"
FILES_${PN} += "${libdir}/mts-io-sysfs*"
FILES_${PN} += "${sbindir}/mts-io-sysfs"
+FILES_${PN}_append_mtp += "${sbindir}/lora-led-updater"
INITSCRIPT_NAME = "mts-io"
INITSCRIPT_PARAMS = "start 39 S ."
@@ -88,6 +90,7 @@ fakeroot do_install () {
fakeroot do_install_append_mtp() {
# install MTP mts-io init script
install -m 0755 ${WORKDIR}/mts-io.mtp.init ${D}${sysconfdir}/init.d/mts-io
+ install -m 0755 ${WORKDIR}/lora-led-updater ${D}${sbindir}/lora-led-updater
# disable radio-reset for the mtp hardware
sed -i 's/ENABLED="yes"/ENABLED="no"/g' ${D}${sysconfdir}/default/radio-reset
diff --git a/recipes-bsp/multitech/mts-io/lora-led-updater b/recipes-bsp/multitech/mts-io/lora-led-updater
new file mode 100755
index 0000000..637ee2e
--- /dev/null
+++ b/recipes-bsp/multitech/mts-io/lora-led-updater
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+while true; do
+ fuser /dev/spidev0.0 > /dev/null
+ if [ $? == 0 ]; then
+ mts-io-sysfs store led-lora 1
+ else
+ mts-io-sysfs store led-lora 0
+ fi
+ sleep 5
+done
+
diff --git a/recipes-bsp/multitech/mts-io/mts-io.mtp.init b/recipes-bsp/multitech/mts-io/mts-io.mtp.init
index 3ce08a9..b4aa489 100644
--- a/recipes-bsp/multitech/mts-io/mts-io.mtp.init
+++ b/recipes-bsp/multitech/mts-io/mts-io.mtp.init
@@ -21,6 +21,10 @@ cell_init() {
mts-io-sysfs store radio-power 1
}
+start_lora_led_updater() {
+ lora-led-updater &
+}
+
case $1 in
start)
echo "Loading mts-io module"
@@ -28,6 +32,7 @@ case $1 in
lora_init
eth_init
cell_init &
+ start_lora_led_updater
;;
stop)