Initial t31_lite_cmcc-hdc-51-a6-v10 device

This commit is contained in:
Signor Pellegrino (from Citadel PC)
2025-02-08 00:23:36 +03:00
parent 6ba90279f8
commit d326af45d0
7 changed files with 145 additions and 1 deletions
@@ -0,0 +1,27 @@
#!/bin/sh
GPIO=53 # BLUE led, t31_lite_cmcc-hdc-51-a6-v10
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
for a in $(seq 10) ; do (gpio set ${GPIO} ; sleep 0.3 ; gpio clear ${GPIO} ; sleep 0.3 ) ; done | logger -t gpio
reboot -f
fi
sleep 1
N=$((N + 1))
done
@@ -0,0 +1,39 @@
#!/bin/sh
#
# Perform basic settings on a known IP camera
#
#
# Set custom upgrade url
#
fw_setenv upgrade 'https://github.com/OpenIPC/builder/releases/download/latest/t31_lite_chinamobile-hdc-51-a6-v10-nor.tgz'
#
#
# Set custom majestic settings
#
cli -s .nightMode.lightMonitor true
cli -s .nightMode.lightSensorPin 7
cli -s .nightMode.irCutPin1 58
cli -s .nightMode.irCutPin2 57
cli -s .video0.codec h264
cli -s .audio.enabled true
cli -s .audio.codec opus
cli -s .audio.srate 48000
cli -s .audio.volume 50
cli -s .audio.outputEnabled true
cli -s .audio.outputVolume 80
cli -s .audio.speakerPin 63
#
#
# Set wlan device and credentials if need
#
fw_setenv wlandev rtl8188fu-generic
#fw_setenv wlanssid Router
#fw_setenv wlanpass 12345678
#
#
# Set osmem and rmem
#
fw_setenv osmem 39M
fw_setenv rmem 25M@0x2700000
#
exit 0