mirror of
https://github.com/nikdoof/builder.git
synced 2025-12-16 01:02:14 +00:00
Sync HS303-v* profiles
This commit is contained in:
@@ -1,13 +1,14 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
gpio=1 # RED led, hi3518ev200_lite_switcam-hs303-v3
|
||||||
n=0
|
n=0
|
||||||
|
|
||||||
gpio clear 1 | logger -t gpio # RED led, hi3518ev200_lite_switcam-hs303-v3
|
gpio clear ${gpio} | logger -t gpio
|
||||||
|
|
||||||
while true ; do
|
while true ; do
|
||||||
if [ "$n" -ge 30 ]; then
|
if [ "$n" -ge 30 ]; then
|
||||||
logger -t qrscan "Recognition timeout exceeded, reboot camera and try again..."
|
logger -t qrscan "Recognition timeout exceeded, reboot camera and try again..."
|
||||||
gpio set 1 | logger -t gpio
|
gpio set ${gpio} | logger -t gpio
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
timeout 1 wget -q -O /tmp/image.jpg http://127.0.0.1/image.jpg
|
timeout 1 wget -q -O /tmp/image.jpg http://127.0.0.1/image.jpg
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
/dev/mtd1 0 0x10000 0x10000 0x1
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
qrscan.sh >/dev/null 2>&1 &
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set_gpio() {
|
|
||||||
[ "$2" -eq 1 ] && gpio set $1 || gpio clear $1
|
|
||||||
sleep 1
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "$1" = "rtl8188eus-switcam-hs303v2" ]; then
|
|
||||||
gpio set 54
|
|
||||||
modprobe 8188eu
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 1
|
|
||||||
Binary file not shown.
27
devices/hi3518ev200_lite_switcam-hs303-v2/general/overlay/usr/sbin/qrscan.sh
Executable file
27
devices/hi3518ev200_lite_switcam-hs303-v2/general/overlay/usr/sbin/qrscan.sh
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
gpio=? # COLOR led, hi3518ev200_lite_switcam-hs303-v2
|
||||||
|
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" ]]; 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
|
||||||
|
|
||||||
@@ -19,8 +19,8 @@ cli -s .video0.codec h264
|
|||||||
cli -s .video0.fps 20
|
cli -s .video0.fps 20
|
||||||
cli -s .audio.enabled true
|
cli -s .audio.enabled true
|
||||||
cli -s .audio.volume 40
|
cli -s .audio.volume 40
|
||||||
cli -s .audio.srate 8000
|
cli -s .audio.srate 48000
|
||||||
cli -s .audio.codec alaw
|
cli -s .audio.codec opus
|
||||||
cli -s .audio.outputEnabled true
|
cli -s .audio.outputEnabled true
|
||||||
cli -s .audio.outputVolume 80
|
cli -s .audio.outputVolume 80
|
||||||
cli -s .audio.speakerPin 53
|
cli -s .audio.speakerPin 53
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
/dev/mtd1 0 0x10000 0x10000 0x1
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
qrscan.sh >/dev/null 2>&1 &
|
||||||
|
;;
|
||||||
|
esac
|
||||||
Binary file not shown.
27
devices/hi3518ev200_lite_switcam-hs303/general/overlay/usr/sbin/qrscan.sh
Executable file
27
devices/hi3518ev200_lite_switcam-hs303/general/overlay/usr/sbin/qrscan.sh
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
gpio=? # COLOR led, hi3518ev200_lite_switcam-hs303-v1
|
||||||
|
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" ]]; 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
|
||||||
|
|
||||||
@@ -20,8 +20,8 @@ cli -s .video0.codec h264
|
|||||||
cli -s .video0.fps 20
|
cli -s .video0.fps 20
|
||||||
cli -s .audio.enabled true
|
cli -s .audio.enabled true
|
||||||
cli -s .audio.volume 40
|
cli -s .audio.volume 40
|
||||||
cli -s .audio.srate 8000
|
cli -s .audio.srate 48000
|
||||||
cli -s .audio.codec alaw
|
cli -s .audio.codec opus
|
||||||
cli -s .audio.outputEnabled true
|
cli -s .audio.outputEnabled true
|
||||||
cli -s .audio.outputVolume 80
|
cli -s .audio.outputVolume 80
|
||||||
cli -s .audio.speakerPin 32
|
cli -s .audio.speakerPin 32
|
||||||
|
|||||||
Reference in New Issue
Block a user