diff --git a/devices/t31_lite_chinamobile-hdc-51-a6-v11/br-ext-chip-ingenic/configs/t31_lite_chinamobile-hdc-51-a6-v11_defconfig b/devices/t31_lite_chinamobile-hdc-51-a6-v11/br-ext-chip-ingenic/configs/t31_lite_chinamobile-hdc-51-a6-v11_defconfig index d9dc9a2..2e0f3f1 100644 --- a/devices/t31_lite_chinamobile-hdc-51-a6-v11/br-ext-chip-ingenic/configs/t31_lite_chinamobile-hdc-51-a6-v11_defconfig +++ b/devices/t31_lite_chinamobile-hdc-51-a6-v11/br-ext-chip-ingenic/configs/t31_lite_chinamobile-hdc-51-a6-v11_defconfig @@ -61,7 +61,6 @@ BR2_PACKAGE_MAJESTIC_FONTS=y BR2_PACKAGE_MAJESTIC_WEBUI=y BR2_PACKAGE_MAJESTIC=y BR2_PACKAGE_MBEDTLS_OPENIPC=y -BR2_PACKAGE_MOTORS=y BR2_PACKAGE_OPUS_OPENIPC=y BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y BR2_PACKAGE_QUIRC_OPENIPC=y diff --git a/devices/t31_lite_chinamobile-hdc-51-a6-v11/general/overlay/etc/init.d/S97qrscan b/devices/t31_lite_chinamobile-hdc-51-a6-v11/general/overlay/etc/init.d/S97qrscan new file mode 100755 index 0000000..7afc62a --- /dev/null +++ b/devices/t31_lite_chinamobile-hdc-51-a6-v11/general/overlay/etc/init.d/S97qrscan @@ -0,0 +1,7 @@ +#!/bin/sh + +case "$1" in + start) + qrscan.sh >/dev/null 2>&1 & + ;; +esac diff --git a/devices/t31_lite_chinamobile-hdc-51-a6-v11/general/overlay/usr/lib/sounds/ready_48k.pcm b/devices/t31_lite_chinamobile-hdc-51-a6-v11/general/overlay/usr/lib/sounds/ready_48k.pcm new file mode 100644 index 0000000..d615825 Binary files /dev/null and b/devices/t31_lite_chinamobile-hdc-51-a6-v11/general/overlay/usr/lib/sounds/ready_48k.pcm differ diff --git a/devices/t31_lite_chinamobile-hdc-51-a6-v11/general/overlay/usr/sbin/qrscan.sh b/devices/t31_lite_chinamobile-hdc-51-a6-v11/general/overlay/usr/sbin/qrscan.sh new file mode 100755 index 0000000..9914c7e --- /dev/null +++ b/devices/t31_lite_chinamobile-hdc-51-a6-v11/general/overlay/usr/sbin/qrscan.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +gpio=?? # ??? led, t31_lite_chinamobile-hdc-51-a6-v11 +n=0 + +gpio clear ${gpio} | logger -t gpio + +while true ; do + if [ "$n" -ge 30 ]; then + logger -t qrscan "Recognition timeout exceeded, reboot camera and try again..." + gpio set ${gpio} | logger -t gpio + exit 1 + fi + timeout 1 wget -q -O /tmp/image.jpg http://127.0.0.1/image.jpg + data=$(qrscan -p /tmp/image.jpg) + if [[ -n "$data" ]] && $(echo "$data" | grep -q wlan); then + fw_setenv $(echo $data | cut -d " " -f 1 | sed 's/=/ /') + fw_setenv $(echo $data | cut -d " " -f 2 | sed 's/=/ /') + logger -t qrscan "Recognition successfully, wlanssid and wlanpass is writed to env. Reboot required." + curl --data-binary @/usr/lib/sounds/ready_48k.pcm http://localhost/play_audio + sleep 3 + reboot -f + fi + sleep 1 + n=$((n + 1)) +done +