mirror of
https://github.com/nikdoof/builder.git
synced 2025-12-22 22:39:27 +00:00
add xiaomi mjsxj03hl
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
#
|
||||
Experimental system for building OpenIPC firmware for known devices
|
||||
#
|
||||
41
devices/t31_lite_xiaomi-mjsxj03hl/general/overlay/etc/init.d/S00autoled
Executable file
41
devices/t31_lite_xiaomi-mjsxj03hl/general/overlay/etc/init.d/S00autoled
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
|
||||
AUTOLED_ARGS=""
|
||||
AUTOLED_PID_FILE=/var/run/autoled.pid
|
||||
|
||||
start() {
|
||||
printf "Starting automatic LED control: "
|
||||
umask 077
|
||||
start-stop-daemon -b -m -S -q -p $AUTOLED_PID_FILE \
|
||||
--exec /usr/sbin/autoled.sh -- $AUTOLED_ARGS
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf "Stopping automatic LED control: "
|
||||
start-stop-daemon -K -q -p $AUTOLED_PID_FILE
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart | reload)
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit $?
|
||||
62
devices/t31_lite_xiaomi-mjsxj03hl/general/overlay/usr/sbin/autoled.sh
Executable file
62
devices/t31_lite_xiaomi-mjsxj03hl/general/overlay/usr/sbin/autoled.sh
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Automatic LED control for Xiaomi MJSXJ03HL
|
||||
|
||||
streamerProcess="majestic"
|
||||
serviceProcess="sysupgrade"
|
||||
pollingInterval=1
|
||||
|
||||
show_help() {
|
||||
echo "Usage: $0 [-p process] [-s process] [-i value] [-h]
|
||||
-p process Monitored streamer process (default = ${streamerProcess}).
|
||||
-s process Monitored service process (default = ${serviceProcess}).
|
||||
-i value Polling interval in seconds (default = ${pollingInterval}).
|
||||
-h Show this help."
|
||||
exit 0
|
||||
}
|
||||
|
||||
# override config values with command line arguments
|
||||
while getopts H:L:i:h flag; do
|
||||
case ${flag} in
|
||||
p)
|
||||
streamerProcess=${OPTARG}
|
||||
;;
|
||||
s)
|
||||
serviceProcess=${OPTARG}
|
||||
;;
|
||||
i)
|
||||
pollingInterval=${OPTARG}
|
||||
;;
|
||||
h | *)
|
||||
show_help
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "Streamer process: ${streamerProcess}"
|
||||
echo "Service process: ${serviceProcess}"
|
||||
echo "Polling interval: ${pollingInterval} sec"
|
||||
|
||||
led_state=0
|
||||
/usr/sbin/led_control.sh -o 0 -b 0
|
||||
|
||||
while true; do
|
||||
if killall -q -0 $serviceProcess; then
|
||||
if [ $led_state -ne 3 ]; then
|
||||
echo "$serviceProcess is running, turn white LED on"
|
||||
/usr/sbin/led_control.sh -o 1 -b 1
|
||||
led_state=3
|
||||
fi
|
||||
else
|
||||
if [ $led_state -ne 1 ] && ! killall -q -0 $streamerProcess; then
|
||||
echo "$streamerProcess is not running, turn orange LED on"
|
||||
/usr/sbin/led_control.sh -o 1 -b 0
|
||||
led_state=1
|
||||
elif [ $led_state -ne 2 ] && killall -q -0 $streamerProcess; then
|
||||
echo "$streamerProcess is running, turn blue LED on"
|
||||
/usr/sbin/led_control.sh -o 0 -b 1
|
||||
led_state=2
|
||||
fi
|
||||
fi
|
||||
sleep $pollingInterval
|
||||
done
|
||||
36
devices/t31_lite_xiaomi-mjsxj03hl/general/overlay/usr/sbin/led_control.sh
Executable file
36
devices/t31_lite_xiaomi-mjsxj03hl/general/overlay/usr/sbin/led_control.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# LED control for Xiaomi MJSXJ03HL
|
||||
|
||||
show_help() {
|
||||
echo "Usage: $0 [-o <0|1>] [-b <0|1>]
|
||||
-o <0|1> Switch state for orange LED.
|
||||
-b <0|1> Switch state for blue LED."
|
||||
exit 0
|
||||
}
|
||||
|
||||
led_control() {
|
||||
echo "Switching LED with GPIO${1} to state ${2}"
|
||||
if [ ! -d /sys/class/gpio/gpio${1}/ ]; then
|
||||
echo ${1} > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio${1}/direction
|
||||
fi
|
||||
echo ${2} > /sys/class/gpio/gpio${1}/value
|
||||
}
|
||||
|
||||
if [ $# -eq 0 ]; then show_help; fi
|
||||
while getopts o:b: flag; do
|
||||
case ${flag} in
|
||||
o)
|
||||
[ ${OPTARG} -eq 0 -o ${OPTARG} -eq 1 ] || show_help
|
||||
led_control 39 ${OPTARG}
|
||||
;;
|
||||
b)
|
||||
[ ${OPTARG} -eq 0 -o ${OPTARG} -eq 1 ] || show_help
|
||||
led_control 38 ${OPTARG}
|
||||
;;
|
||||
*)
|
||||
show_help
|
||||
;;
|
||||
esac
|
||||
done
|
||||
@@ -0,0 +1,35 @@
|
||||
#!/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_xiaomi-mjsxj03hl-nor.tgz'
|
||||
#
|
||||
#
|
||||
# Set custom majestic settings
|
||||
#
|
||||
cli -s .system.webAdmin disabled
|
||||
cli -s .system.staticDir /var/www/majestic
|
||||
cli -s .isp.blkCnt 1
|
||||
cli -s .nightMode.enabled true
|
||||
cli -s .nightMode.irCutPin1 49
|
||||
cli -s .nightMode.irCutPin2 50
|
||||
cli -s .nightMode.backlightPin 60
|
||||
cli -s .video0.codec h264
|
||||
#
|
||||
#
|
||||
# Set wlan device and credentials if need
|
||||
#
|
||||
fw_setenv wlandev rtl8189fs-generic
|
||||
#fw_setenv wlanssid Router
|
||||
#fw_setenv wlanpass 12345678
|
||||
#
|
||||
#
|
||||
# Set osmem and rmem
|
||||
#
|
||||
fw_setenv osmem 39M
|
||||
fw_setenv rmem 25M@0x2700000
|
||||
#
|
||||
exit 0
|
||||
@@ -0,0 +1,65 @@
|
||||
etc/sensor/gc2053-t31.bin
|
||||
etc/sensor/gc2083-t31.bin
|
||||
etc/sensor/gc4023-t31.bin
|
||||
etc/sensor/gc4653-t31.bin
|
||||
etc/sensor/imx307-t31.bin
|
||||
etc/sensor/imx327-t31.bin
|
||||
etc/sensor/jxf37-t31.bin
|
||||
etc/sensor/jxh62-t31.bin
|
||||
etc/sensor/jxq03-t31.bin
|
||||
etc/sensor/sc200ai-t31.bin
|
||||
etc/sensor/sc2232h-t31.bin
|
||||
etc/sensor/sc2335-t31.bin
|
||||
etc/sensor/sc2336-t31.bin
|
||||
etc/sensor/sc3335-t31.bin
|
||||
etc/sensor/sc3338-t31.bin
|
||||
etc/sensor/sc4236-t31.bin
|
||||
etc/sensor/sc5235-t31.bin
|
||||
#
|
||||
etc/sensor/gc2053.yaml
|
||||
etc/sensor/gc2083.yaml
|
||||
etc/sensor/gc4023.yaml
|
||||
etc/sensor/gc4653.yaml
|
||||
etc/sensor/imx307.yaml
|
||||
etc/sensor/imx327.yaml
|
||||
etc/sensor/imx335.yaml
|
||||
etc/sensor/jxf22.yaml
|
||||
etc/sensor/jxf23.yaml
|
||||
etc/sensor/jxf37.yaml
|
||||
etc/sensor/jxh42.yaml
|
||||
etc/sensor/jxh62.yaml
|
||||
etc/sensor/jxh63.yaml
|
||||
etc/sensor/jxk04.yaml
|
||||
etc/sensor/jxq03.yaml
|
||||
etc/sensor/os03b10.yaml
|
||||
etc/sensor/ov2735.yaml
|
||||
etc/sensor/ov2735b.yaml
|
||||
etc/sensor/ov4689.yaml
|
||||
etc/sensor/ps5260.yaml
|
||||
etc/sensor/sc200ai.yaml
|
||||
etc/sensor/sc2232.yaml
|
||||
etc/sensor/sc2232h.yaml
|
||||
etc/sensor/sc2335.yaml
|
||||
etc/sensor/sc2336.yaml
|
||||
etc/sensor/sc3335.yaml
|
||||
etc/sensor/sc3338.yaml
|
||||
etc/sensor/sc4236.yaml
|
||||
etc/sensor/sc5235.yaml
|
||||
#
|
||||
lib/modules/3.10.14__isvp_swan_1.0__/ingenic/sensor_gc2053_t31.ko
|
||||
lib/modules/3.10.14__isvp_swan_1.0__/ingenic/sensor_gc2083_t31.ko
|
||||
lib/modules/3.10.14__isvp_swan_1.0__/ingenic/sensor_gc4023_t31.ko
|
||||
lib/modules/3.10.14__isvp_swan_1.0__/ingenic/sensor_gc4653_t31.ko
|
||||
lib/modules/3.10.14__isvp_swan_1.0__/ingenic/sensor_imx307_t31.ko
|
||||
lib/modules/3.10.14__isvp_swan_1.0__/ingenic/sensor_imx327_t31.ko
|
||||
lib/modules/3.10.14__isvp_swan_1.0__/ingenic/sensor_jxf37_t31.ko
|
||||
lib/modules/3.10.14__isvp_swan_1.0__/ingenic/sensor_jxh62_t31.ko
|
||||
lib/modules/3.10.14__isvp_swan_1.0__/ingenic/sensor_jxh63_t31.ko
|
||||
lib/modules/3.10.14__isvp_swan_1.0__/ingenic/sensor_jxq03_t31.ko
|
||||
lib/modules/3.10.14__isvp_swan_1.0__/ingenic/sensor_sc200ai_t31.ko
|
||||
lib/modules/3.10.14__isvp_swan_1.0__/ingenic/sensor_sc2232h_t31.ko
|
||||
lib/modules/3.10.14__isvp_swan_1.0__/ingenic/sensor_sc2335_t31.ko
|
||||
lib/modules/3.10.14__isvp_swan_1.0__/ingenic/sensor_sc2336_t31.ko
|
||||
lib/modules/3.10.14__isvp_swan_1.0__/ingenic/sensor_sc3338_t31.ko
|
||||
lib/modules/3.10.14__isvp_swan_1.0__/ingenic/sensor_sc4236_t31.ko
|
||||
lib/modules/3.10.14__isvp_swan_1.0__/ingenic/sensor_sc5235_t31.ko
|
||||
Reference in New Issue
Block a user