Skip to content

Commit

Permalink
update uniview-c1l-2wn-g
Browse files Browse the repository at this point in the history
  • Loading branch information
cronyx committed Jan 18, 2025
1 parent 9270a6a commit 256e361
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
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 not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh

gpio=64 # RED COLOR LED, BLUE = 65
n=0

gpio set 64
gpio set 65

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
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ fw_setenv upgrade 'https://github.com/OpenIPC/builder/releases/download/latest/s
#
# Set custom majestic settings
#
cli -s .system.staticDir /var/www/majestic
cli -s .image.mirror true
cli -s .image.flip true
cli -s .nightMode.irCutPin1 61
cli -s .nightMode.irCutPin2 79
cli -s .nightMode.backlightPin 4
cli -s .nightMode.colorToGray true
cli -s .video0.fps 25
cli -s .audio.enabled true
cli -s .audio.outputEnabled true
cli -s .audio.outputVolume 80
cli -s .audio.speakerPin 0
cli -s .video0.codec h264
#
Expand Down

0 comments on commit 256e361

Please sign in to comment.