-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
77 additions
and
20 deletions.
There are no files selected for viewing
5 changes: 3 additions & 2 deletions
5
devices/hi3518ev200_lite_qtech-qvc-ipc-136w/general/overlay/usr/sbin/qrscan.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
devices/hi3518ev200_lite_switcam-hs303-v2/general/overlay/etc/fw_env.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/dev/mtd1 0 0x10000 0x10000 0x1 |
7 changes: 7 additions & 0 deletions
7
devices/hi3518ev200_lite_switcam-hs303-v2/general/overlay/etc/init.d/S97qrscan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
case "$1" in | ||
start) | ||
qrscan.sh >/dev/null 2>&1 & | ||
;; | ||
esac |
14 changes: 0 additions & 14 deletions
14
devices/hi3518ev200_lite_switcam-hs303-v2/general/overlay/etc/wireless/usb
This file was deleted.
Oops, something went wrong.
Binary file added
BIN
+122 KB
devices/hi3518ev200_lite_switcam-hs303-v2/general/overlay/usr/lib/sounds/ready_48k.pcm
Binary file not shown.
27 changes: 27 additions & 0 deletions
27
devices/hi3518ev200_lite_switcam-hs303-v2/general/overlay/usr/sbin/qrscan.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
devices/hi3518ev200_lite_switcam-hs303/general/overlay/etc/fw_env.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/dev/mtd1 0 0x10000 0x10000 0x1 |
7 changes: 7 additions & 0 deletions
7
devices/hi3518ev200_lite_switcam-hs303/general/overlay/etc/init.d/S97qrscan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
case "$1" in | ||
start) | ||
qrscan.sh >/dev/null 2>&1 & | ||
;; | ||
esac |
Binary file added
BIN
+122 KB
devices/hi3518ev200_lite_switcam-hs303/general/overlay/usr/lib/sounds/ready_48k.pcm
Binary file not shown.
27 changes: 27 additions & 0 deletions
27
devices/hi3518ev200_lite_switcam-hs303/general/overlay/usr/sbin/qrscan.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters