Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Imou IPC-C22EN (Cue 2) HI3516EV200 SC2235 RTL8188FU_USB NOR_8M in pr
Imou IPC-C22EP-S2 SSC325DE SC2239 RTL8188FU_USB NAND testing stage 1
Imou IPC-C22EP-S2 ? SSC325DE SC2335 RTL8188FU_USB NAND wait sensor driver
Imou IPC-С22СP SSC325 SC2239 RTL8188FU_USB NOR_8M in progress
Imou LOOC 2 IPC-C26EP-V2 MSC316DC OV2735 RTL8192EU_USB NOR_16M video-yes, audio-yes, talk-back-yes, wifi-yes, ir-yes, sd-yes (Divinus)
Jienuo JN-107AR-E-WIFI T31X SC5235 RTL8733BU_USB NOR_16M done
Jooan A6M-U T23N SC1346 ATBM6012B_USB NOR_8M **INIT** - in progress
Jooan A6M-U vB T23N SC1A4T ATBM6012B_USB NOR_8M **INIT** - in progress
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Architecture
BR2_arm=y
BR2_cortex_a7=y
BR2_ARM_FPU_NEON_VFPV4=y
BR2_ARM_INSTRUCTIONS_THUMB2=y

# Toolchain
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="https://github.com/openipc/firmware/releases/download/$(OPENIPC_TOOLCHAIN).tgz"
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="arm-openipc-linux-musleabihf"
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_18=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y

# Kernel
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/$(OPENIPC_KERNEL).tar.gz"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/msc316dc.generic.config"
BR2_LINUX_KERNEL_UIMAGE=y
BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x20008000"
BR2_LINUX_KERNEL_XZ=y

# Filesystem
BR2_PACKAGE_BUSYBOX_CONFIG="$(BR2_EXTERNAL)/package/busybox/busybox.config"
BR2_PACKAGE_UBOOT_TOOLS=y
BR2_PACKAGE_ZLIB=y
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
BR2_PACKAGE_WIREGUARD_LINUX_COMPAT=y
BR2_PACKAGE_WIREGUARD_TOOLS=y
BR2_PACKAGE_WIRELESS_TOOLS=y
BR2_PACKAGE_WPA_SUPPLICANT=y
BR2_PACKAGE_WPA_SUPPLICANT_CLI=y
BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
BR2_TARGET_ROOTFS_CPIO=y
BR2_TARGET_ROOTFS_SQUASHFS=y
BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y

# OpenIPC
BR2_OPENIPC_SOC_VENDOR="sigmastar"
BR2_OPENIPC_SOC_MODEL="msc316dc"
BR2_OPENIPC_SOC_FAMILY="infinity3"
BR2_OPENIPC_VARIANT="lite"
BR2_OPENIPC_FLASH_SIZE="16"

# Packages
BR2_PACKAGE_DROPBEAR_OPENIPC=y
BR2_PACKAGE_IPCTOOL=y
BR2_PACKAGE_LIBCURL_OPENIPC=y
BR2_PACKAGE_LIBCURL_OPENIPC_CURL=y
# BR2_PACKAGE_LIBCURL_OPENIPC_PROXY_SUPPORT is not set
# BR2_PACKAGE_LIBCURL_OPENIPC_COOKIES_SUPPORT is not set
# BR2_PACKAGE_LIBCURL_OPENIPC_EXTRA_PROTOCOLS_FEATURES is not set
BR2_PACKAGE_LIBEVENT_OPENIPC=y
BR2_PACKAGE_LIBOGG_OPENIPC=y
BR2_PACKAGE_MBEDTLS_OPENIPC=y
BR2_PACKAGE_OPUS_OPENIPC=y
BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y
BR2_PACKAGE_SIGMASTAR_OSDRV_MSC313E=y
BR2_PACKAGE_YAML_CLI=y
BR2_PACKAGE_DIVINUS=y
# The on-screen clock font Divinus looks for
BR2_PACKAGE_MAJESTIC_FONTS=y
BR2_PACKAGE_EXFAT_NOFUSE_OPENIPC=y
BR2_PACKAGE_RTL8192EU_OPENIPC=y
113 changes: 113 additions & 0 deletions devices/msc316dc_lite_imou-looc2/general/overlay/etc/divinus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
system:
sensor_config: /etc/sensors/iqfile/ov2735_iqfile.bin.mz
web_port: 80
web_enable_auth: true
web_auth_user: root
web_auth_pass: "@system"
web_auth_skiplocal: true
web_enable_static: false
isp_thread_stack_size: 16384
venc_stream_thread_stack_size: 16384
web_server_thread_stack_size: 65536
time_format: "%Y.%m.%d %H:%M:%S"
watchdog: 0
night_mode:
enable: true
ir_sensor_pin: 999
check_interval_s: 5
ir_cut_pin1: 97
ir_cut_pin2: 96
ir_led_pin: 61
white_led_pin: 64
pin_switch_delay_us: 1000
adc_device:
adc_threshold: 128
exposure_night: 50
exposure_day: 12
isp:
mirror: false
flip: false
antiflicker: 60
mdns:
enable: false
onvif:
enable: false
enable_auth: false
auth_user:
auth_pass:
rtsp:
enable: true
port: 554
audio_codec: mp3
enable_auth: true
auth_user: root
auth_pass: "@system"
record:
enable: false
continuous: false
path: /mnt/sdcard/recordings
filename:
segment_duration: 300
segment_size: 0
reserve: 512
stream:
enable: false
udp_srcport: 0
audio:
enable: true
bitrate: 64
gain: 0
srate: 16000
mp4:
enable: true
codec: H.264
audio: true
mode: 0
width: 1920
height: 1080
fps: 25
gop: 50
profile: 1
bitrate: 2048
sub:
enable: true
width: 640
height: 360
gop: 30
bitrate: 512
rtsp_port: 555
osd:
enable: true
reg0_text: $t
reg0_font: UbuntuMono-Regular
reg0_opal: 64
reg0_anchor: top-right
reg0_posx: 16
reg0_posy: 16
reg0_size: 32.0
reg0_color: 0xffff
reg0_outl: 0x8000
reg0_thick: 0.0
jpeg:
enable: true
width: 1280
height: 720
qfactor: 80
mjpeg:
enable: false
mode: 0
width: 640
height: 480
fps: 15
bitrate: 1024
qfactor: 50
http_post:
enable: false
host:
url:
login:
password:
width: 0
height: 0
interval: 0
qfactor: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/sh
# Divinus streamer on the Imou LOOC 2 (SigmaStar infinity3).
DAEMON=/usr/bin/divinus
PIDFILE=/var/run/divinus.pid

start() {
echo -n "Starting divinus: "
# load_mstar pins the splitter buffers at 640x480 and then turns
# reallocation off; the 1280x720 snapshot channel needs them to grow.
echo 1 > /sys/class/mstar/msys/dmem_realloc 2>/dev/null
cd /etc
start-stop-daemon -S -b -m -q -p "$PIDFILE" -x "$DAEMON" && echo OK || echo FAIL
}

stop() {
echo -n "Stopping divinus: "
start-stop-daemon -K -q -p "$PIDFILE" && echo OK || echo FAIL
rm -f "$PIDFILE"
# The streamer needs a few seconds to release the sensor and its ports;
# a start before that leaves the new one without them.
n=0
while pidof divinus > /dev/null; do
n=$((n + 1))
[ $n -eq 10 ] && killall -q -9 divinus
[ $n -gt 12 ] && break
sleep 1
done
}

case "$1" in
start|stop) $1 ;;
restart|reload) stop; sleep 2; start ;;
*) echo "Usage: $0 {start|stop|restart}"; exit 1 ;;
esac
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/sh
# SD card hot-plug for the Imou LOOC 2: the slot has no working card-detect
# line, so the driver only finds a card when it loads. While no card is
# present, re-probe the slot every 15 seconds (every two minutes after the
# first two); a card that shows up is mounted read-only at /mnt/sdcard (see
# /usr/sbin/sdcard).
PIDFILE=/var/run/sdwatch.pid

card_gone() {
# A pulled card is not reported; a read from a spot that is unlikely
# to be cached shows whether it is still there.
read -r sectors < /sys/block/mmcblk0/size 2>/dev/null || return 0
[ "$sectors" -gt 4096 ] 2>/dev/null || return 0
skip=$(( ($(date +%s) * 7919) % (sectors / 8 - 1) ))
! dd if=/dev/mmcblk0 of=/dev/null bs=4096 skip=$skip count=1 2>/dev/null
}

watch() {
empty=0
while :; do
if [ -z "$(ls /sys/bus/mmc/devices 2>/dev/null)" ]; then
grep -q " /mnt/sdcard " /proc/mounts && /usr/sbin/sdcard umount
# Every reload logs a few kernel lines: re-probe each time for the
# first two minutes without a card, then every two minutes.
empty=$((empty + 1))
if grep -q '^kdrv_sdmmc ' /proc/modules && { [ $empty -le 8 ] || [ $((empty % 8)) -eq 0 ]; }; then
rmmod kdrv_sdmmc 2>/dev/null && modprobe kdrv_sdmmc 2>/dev/null
sleep 2
fi
else
empty=0
# One failed read can be a slow or busy card: only a second one,
# a moment later, means it was pulled.
if card_gone && sleep 1 && card_gone; then
/usr/sbin/sdcard umount
rmmod kdrv_sdmmc 2>/dev/null && modprobe kdrv_sdmmc 2>/dev/null
sleep 2
fi
fi
if [ -n "$(ls /sys/bus/mmc/devices 2>/dev/null)" ] && ! grep -q " /mnt/sdcard " /proc/mounts; then
/usr/sbin/sdcard mount ro
Comment thread
HeytalePazguato marked this conversation as resolved.
Resolved
fi
sleep 15
done
}

case "$1" in
start)
echo -n "Starting SD card watcher: "
watch > /dev/null 2>&1 &
echo $! > "$PIDFILE"
echo OK
;;
stop)
echo -n "Stopping SD card watcher: "
[ -f "$PIDFILE" ] && kill "$(cat "$PIDFILE")" 2>/dev/null
rm -f "$PIDFILE"
echo OK
;;
restart)
"$0" stop
"$0" start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
34 changes: 34 additions & 0 deletions devices/msc316dc_lite_imou-looc2/general/overlay/etc/mdev.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Imou LOOC 2: the firmware's general/overlay/etc/mdev.conf with only the
# /lib/mdev/automount.sh action dropped from the two mmcblk lines. That script
# mounts a card read-write and runs a script from it; here S96sdwatch mounts
# it read-only instead (see /usr/sbin/sdcard). Keep the rest in step with the
# firmware's file.
#
# Provide user, group, and mode information for devices. If a regex matches
# the device name provided by sysfs, use the appropriate user:group and mode
# instead of the default 0:0 660.
#
# Syntax:
# [-]devicename_regex user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
# [-]$ENVVAR=regex user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
# [-]@maj,min[-min2] user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
#
# [-]: do not stop on this match, continue reading mdev.conf
# =: move, >: move and create a symlink
# !: do not create device node
# @|$|*: run@cmd if $ACTION=add, $cmd if $ACTION=remove, *cmd in all cases
#

mmcblk[0-9] root:disk 660
mmcblk[0-9]p[0-9] root:disk 660

sd[a-z] root:disk 660 *(/lib/mdev/automount.sh)
sd[a-z][0-9] root:disk 660 *(/lib/mdev/automount.sh)

# USB tethering: a phone, or a modem in RNDIS, ECM or NCM mode. The kernel
# builds these drivers as modules and nothing else loads them, so a phone that
# tethered gave no usb0 at all (#1112). The classes are the drivers' own; a
# blanket MODALIAS rule would also load usbserial for a modem before
Comment thread
HeytalePazguato marked this conversation as resolved.
Resolved
# rndis_host, which /etc/wireless/modem exists to prevent.
$MODALIAS=usb:.*ic(E0isc01ip03|EFisc01ip01|02isc02ipFF|02isc06ip00|02isc0Dip00)in.* root:root 660 @modprobe -q "$MODALIAS"
$INTERFACE=usb0 root:root 660 ! *(/lib/mdev/usbnet.sh)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vfat
mmc_core
mmc_block
kdrv_sdmmc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

# Status LED: red = GPIO 99, green = GPIO 78, both active low. Green = running.
gpio set 99 > /dev/null 2>&1
gpio clear 78 > /dev/null 2>&1

exit 0
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
; Imou LOOC 2 (IPC-C26EP-V2): OmniVision OV2735 on MIPI, read by libCamSensor
; as /data/cfg/sensor_db.cfg. Values from the camera's stock firmware, except
; CUSTOMER_AE/AWB/AF: the stock application runs 3A itself and sets them to 1,
; which leaves the picture black without it.
;
; The sensor driver is OpenIPC's (sigmastar-osdrv-msc313e); the IQ file is the
; stock firmware's, as OpenIPC has none for the OV2735 on infinity3.

[I2C]
BUS_TYPE=ISP_I2C_EXTERNAL_1

[GLOBAL]
CUSTOMER_AE=0
CUSTOMER_AWB=0
CUSTOMER_AF=0

[SENSOR1]
LIB=/usr/lib/sensors/libdrv_ms_cus_ov2735_MIPI.so
IQ_FILE_NAME=ov2735_iqfile.bin.mz
F_NUMBER=18
MIRROR=0
FLIP=0
ISP_CLK=86
SENSOR_IO_PAD=6
MCLK=ISP_27M
CROP_START_X=0
CROP_START_Y=0
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

# Imou LOOC 2 (IPC-C26EP-V2): RTL8192EU on the second USB host port.
if [ "$1" = "rtl8192eu-msc316dc-imou-looc2" ] || [ "$1" = "rtl8192eu-ssc325de-imou-c26ep-v2" ]; then
# (the second name is the one earlier LOOC 2 images set)
# USB is modular on the infinity3 3.18 kernel. VBUS (GPIO 62) is driven by
# the kernel when ehci-hcd loads; the WiFi module's power is GPIO 63:
# low for 3 s, then high.
modprobe usb-common
modprobe usbcore
modprobe ehci-hcd
gpio clear 63
sleep 3
gpio set 63
modprobe cfg80211
modprobe 8192eu
i=0
while [ ! -e /sys/class/net/wlan0 ] && [ $i -lt 20 ]; do sleep 1; i=$((i + 1)); done
[ -e /sys/class/net/wlan0 ]
exit $?
fi

exit 1
Loading
Loading