From 71973d61d89c828a33baa8f3cdd7db31f2fe37a5 Mon Sep 17 00:00:00 2001 From: Mike Nicholson Date: Fri, 22 Jan 2021 04:08:43 -0600 Subject: Provide number of accessory ports to GPIOB build --- recipes-bsp/multitech/mtac-gpiob_1.1.2.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-bsp/multitech/mtac-gpiob_1.1.2.bb b/recipes-bsp/multitech/mtac-gpiob_1.1.2.bb index cfd630b..48a4d6e 100644 --- a/recipes-bsp/multitech/mtac-gpiob_1.1.2.bb +++ b/recipes-bsp/multitech/mtac-gpiob_1.1.2.bb @@ -32,7 +32,7 @@ COMMON_OEMAKE = " -C ${STAGING_KERNEL_DIR} \ EXTRA_OEMAKE_mtcdt = "${COMMON_OEMAKE} EXTRA_CFLAGS='-I${STAGING_INCDIR}/mts-kernel-headers \ -D SAM9G25'" EXTRA_OEMAKE_mtcpmhs = "${COMMON_OEMAKE} EXTRA_CFLAGS='-I${STAGING_INCDIR}/mts-kernel-headers \ - -D TI43X'" + -D TI43X -D CONFIG_MTS_NUM_ACCESSORY_PORTS=2'" do_compile () { bbnote make "$@" -- cgit v1.2.3 From 909ffd14b4b3c02ee85d8c382f043b5ebab6fa0d Mon Sep 17 00:00:00 2001 From: John Klug Date: Mon, 15 Feb 2021 16:02:33 -0600 Subject: Wait for supercap charge up to 3 minutes. Poweroff if no power --- recipes-bsp/multitech/mts-io.inc | 2 +- recipes-bsp/multitech/mts-io/mts-io.conf | 10 +++++++ recipes-bsp/multitech/mts-io/mts-io.mtcap.init | 38 ++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/recipes-bsp/multitech/mts-io.inc b/recipes-bsp/multitech/mts-io.inc index e33ae00..65cb00c 100644 --- a/recipes-bsp/multitech/mts-io.inc +++ b/recipes-bsp/multitech/mts-io.inc @@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://io-module/COPYING;md5=94d55d512a9ba36caa9b7df079bae19 file://io-tool/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ " do_fetch[depends] += "virtual/kernel:do_shared_workdir" -INC_PR = "r3" +INC_PR = "r4" SRCREV = "${PV}" PR = "${INC_PR}.0-${KERNEL_MODULE_PACKAGE_SUFFIX}" diff --git a/recipes-bsp/multitech/mts-io/mts-io.conf b/recipes-bsp/multitech/mts-io/mts-io.conf index b5b4275..4ed5e31 100644 --- a/recipes-bsp/multitech/mts-io/mts-io.conf +++ b/recipes-bsp/multitech/mts-io/mts-io.conf @@ -7,3 +7,13 @@ GPSGNSSRESET=1 # 0 is off # 1 is on DEBUG=0 + +# Supercap Feature +# Do not let boot proceed until supercap is full. +# Prevents loss of data when power is out. +SUPERCAPFULL=1 + +# Maximum wait time for SUPERCAPFULL +# +SUPERCAPFULL_MAXWAIT=180 + diff --git a/recipes-bsp/multitech/mts-io/mts-io.mtcap.init b/recipes-bsp/multitech/mts-io/mts-io.mtcap.init index 19bfa4a..ff0e947 100644 --- a/recipes-bsp/multitech/mts-io/mts-io.mtcap.init +++ b/recipes-bsp/multitech/mts-io/mts-io.mtcap.init @@ -103,6 +103,42 @@ cell_init() { start_lora_led_updater() { lora-led-updater & } +gettime() { + [[ $(cat /proc/uptime) =~ ([^[:space:]]+) ]] + echo ${BASH_REMATCH[1]} +} +wait_for_supercap() { + supercap=$(mts-io-sysfs show capability/supercap 2>/dev/null) + if ((supercap != 1)) ; then + return + fi + if ((SUPERCAPFULL != 1)) ; then + break + fi + t0=$(gettime) + maxwait=$(awk "BEGIN {print ${t0}+${SUPERCAPFULL_MAXWAIT}}") + while : ; do + if (($(mts-io-sysfs show power-fail) == 1)) ; then + # If we are booting, then go down. + # This will not work with systemd. + if [[ $(ps -h -o cmd -p $PPID) =~ /bin/sh[[:space:]]/etc/init.d/rc[[:space:]]S$ ]] ; then + logger -s -t 'mts-io' -p daemon.err "No power during boot, so power off" + exec /sbin/poweroff + # NOT REACHED + fi + fi + if (($(mts-io-sysfs show supercap-full) == 1)) ; then + logger -s -t 'mts-io' -p daemon.err 'Supercap Charged' + return + fi + t1=$(gettime) + if awk "BEGIN { if($t1<$maxwait)exit 1 }" ; then + break + fi + sleep 1 + done + logger -s -t 'mts-io' -p daemon.err 'Supercap not full but timer expired -- continuing boot' +} case $1 in start) @@ -129,6 +165,8 @@ case $1 in (($WIFICAP)) && modprobe wilc1000-sdio set_hw_name set_gpslink + wait_for_supercap + ;; stop) -- cgit v1.2.3 From 66572f6612a5852ea935665bb609f0bbfc27987d Mon Sep 17 00:00:00 2001 From: John Klug Date: Fri, 19 Feb 2021 17:37:03 -0600 Subject: Bump version of mts-io driver for MTCDT3AC LED issues --- recipes-bsp/multitech/mts-io_4.5.1.bb | 2 -- recipes-bsp/multitech/mts-io_4.5.3.bb | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 recipes-bsp/multitech/mts-io_4.5.1.bb create mode 100644 recipes-bsp/multitech/mts-io_4.5.3.bb diff --git a/recipes-bsp/multitech/mts-io_4.5.1.bb b/recipes-bsp/multitech/mts-io_4.5.1.bb deleted file mode 100644 index ee4fcfa..0000000 --- a/recipes-bsp/multitech/mts-io_4.5.1.bb +++ /dev/null @@ -1,2 +0,0 @@ -require mts-io.inc - diff --git a/recipes-bsp/multitech/mts-io_4.5.3.bb b/recipes-bsp/multitech/mts-io_4.5.3.bb new file mode 100644 index 0000000..ee4fcfa --- /dev/null +++ b/recipes-bsp/multitech/mts-io_4.5.3.bb @@ -0,0 +1,2 @@ +require mts-io.inc + -- cgit v1.2.3 From 49b4e45e990385cdc5bcc4af00e093d11cccb5db Mon Sep 17 00:00:00 2001 From: Serhii Voloshynov Date: Wed, 24 Feb 2021 13:17:19 +0200 Subject: fix probable crash in MTAC-xdot --- recipes-bsp/multitech/mtac-xdot_1.1.1.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-bsp/multitech/mtac-xdot_1.1.1.bb b/recipes-bsp/multitech/mtac-xdot_1.1.1.bb index add2280..0451615 100644 --- a/recipes-bsp/multitech/mtac-xdot_1.1.1.bb +++ b/recipes-bsp/multitech/mtac-xdot_1.1.1.bb @@ -31,7 +31,7 @@ COMMON_OEMAKE = " -C ${STAGING_KERNEL_DIR} \ EXTRA_OEMAKE_mtcdt = "${COMMON_OEMAKE} EXTRA_CFLAGS='-I${STAGING_INCDIR}/mts-kernel-headers \ -D SAM9G25'" EXTRA_OEMAKE_mtcpmhs = "${COMMON_OEMAKE} EXTRA_CFLAGS='-I${STAGING_INCDIR}/mts-kernel-headers \ - -D TI43X'" + -D TI43X -D CONFIG_MTS_NUM_ACCESSORY_PORTS=2'" do_compile () { -- cgit v1.2.3 From 8f305598d474899405159384c1b8116b24bbe0ee Mon Sep 17 00:00:00 2001 From: John Klug Date: Fri, 26 Mar 2021 08:39:10 -0500 Subject: Fix bugs in init script, add mts-io-skipcharge package for development and testing --- recipes-bsp/multitech/mts-io.inc | 22 ++++++++++++++++++---- recipes-bsp/multitech/mts-io/mts-io.mtcap.init | 4 ++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/recipes-bsp/multitech/mts-io.inc b/recipes-bsp/multitech/mts-io.inc index 65cb00c..441a09c 100644 --- a/recipes-bsp/multitech/mts-io.inc +++ b/recipes-bsp/multitech/mts-io.inc @@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://io-module/COPYING;md5=94d55d512a9ba36caa9b7df079bae19 file://io-tool/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ " do_fetch[depends] += "virtual/kernel:do_shared_workdir" -INC_PR = "r4" +INC_PR = "r5" SRCREV = "${PV}" PR = "${INC_PR}.0-${KERNEL_MODULE_PACKAGE_SUFFIX}" @@ -47,7 +47,7 @@ do_compile () { } -PACKAGES = "${PN}-noarch kernel-module-${PN} ${PN}-util ${PN}-util-dbg ${PN}-dev" +PACKAGES += "${PN}-noarch kernel-module-${PN} ${PN}-util ${PN}-util-dbg ${PN}-skipcharge" RDEPENDS_${PN}-dev = "" @@ -67,8 +67,9 @@ FILES_${PN}-util += "${sbindir}/mts-util-lora2-reset" FILES_${PN}-util-dbg += "/usr/src /usr/sbin/.debug" FILES_${PN}-dev += "${includedir}/linux ${includedir}/mts-kernel-headers" -INITSCRIPT_NAME = "mts-io" -INITSCRIPT_PARAMS = "start 39 S ." +INITSCRIPT_PACKAGES = "${PN}-noarch" +INITSCRIPT_NAME_${PN}-noarch = "mts-io" +INITSCRIPT_PARAMS_${PN}-noarch = "start 39 S ." PARALLEL_MAKE = "" @@ -114,3 +115,16 @@ fakeroot do_install_append_mtcap() { install -m 0755 ${WORKDIR}/mts-io.mtcap.init ${D}${sysconfdir}/init.d/mts-io install -m 0755 ${WORKDIR}/lora-led-updater ${D}${sbindir}/lora-led-updater } + +# skipcharge is to prevent waiting for the supercap to charge on +# units with a supercap. This is for code development and testing +# purposes only. +ALLOW_EMPTY_${PN}-skipcharge = "1" +RDEPENDS_${PN}-skipcharge = "${PN}-noarch" + +pkg_postinst_${PN}-skipcharge() { + sed -i 's/^SUPERCAPFULL=1/SUPERCAPFULL=0/' $D${sysconfdir}/default/mts-io +} +pkg_prerm_${PN}-skipcharge() { + sed -i 's/^SUPERCAPFULL=1/SUPERCAPFULL=0/' $D${sysconfdir}/default/mts-io +} diff --git a/recipes-bsp/multitech/mts-io/mts-io.mtcap.init b/recipes-bsp/multitech/mts-io/mts-io.mtcap.init index ff0e947..f8e611f 100644 --- a/recipes-bsp/multitech/mts-io/mts-io.mtcap.init +++ b/recipes-bsp/multitech/mts-io/mts-io.mtcap.init @@ -16,7 +16,6 @@ set_hw_name() { hw_name=(${hw//-/ }) } -batcap=$(mts-io-sysfs show capability/battery) set_batt_charge() { if [[ $batcap == 1 ]] ; then i2cset -m 0x60 -y 0 0x09 0x01 0x20 @@ -113,7 +112,7 @@ wait_for_supercap() { return fi if ((SUPERCAPFULL != 1)) ; then - break + return fi t0=$(gettime) maxwait=$(awk "BEGIN {print ${t0}+${SUPERCAPFULL_MAXWAIT}}") @@ -151,6 +150,7 @@ case $1 in # Point the firmware API at our i2c EEPROMs echo -n ${i2c} > /sys/module/firmware_class/parameters/path modprobe mts_io + batcap=$(mts-io-sysfs show capability/battery) setwificap set_batt_charge wifi_init1 -- cgit v1.2.3