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 @@ -30,6 +30,7 @@ CMCC HDC-51 A6-V10 T31L JXF37 RTL8188FU_USB NOR_16M done
CMCC HDC-51 A6-V11 T31L SC2332 RTL8188FU_USB NOR_16M done
Cootli CAMV0103 GK7202V300 SC223A SSV6355_USB NOR_8M in progress
CP Plus CP-UNC-TA21L2C GK7205V200 SC223A - NOR_16M video-ok, ir-cut-no, audio-no
D-Link DCS-2330L A HI3518CV100 OV9712 RTL8188EU_USB NOR_32M testing, image-not-flashed-yet
Emax Wyvern Link SSC338Q IMX415 NOR_16M done
Foscam X5 SSC337DE GC4653 RTL8188FU_USB NOR_16M done
GARUS GSL-5030X-30AP-NM HI3516EV200 SC2315E? - NOR_8M done
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Architecture
BR2_arm=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-musleabi"
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_0=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)/hi3518cv100.generic.config"
BR2_LINUX_KERNEL_UIMAGE=y
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_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="hisilicon"
BR2_OPENIPC_SOC_MODEL="hi3518cv100"
BR2_OPENIPC_SOC_FAMILY="hi3516cv100"
BR2_OPENIPC_VARIANT="lite"
BR2_OPENIPC_FLASH_SIZE="8"

# Packages
BR2_PACKAGE_DROPBEAR_OPENIPC=y
BR2_PACKAGE_HISILICON_OPENSDK=y
BR2_PACKAGE_HISILICON_OSDRV_HI3516CV100=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_LINUX_FIRMWARE_OPENIPC=y
BR2_PACKAGE_LINUX_FIRMWARE_OPENIPC_RTL_8188EU=y
BR2_PACKAGE_MAJESTIC_FONTS=y
BR2_PACKAGE_MAJESTIC_WEBUI=y
BR2_PACKAGE_MAJESTIC=y
BR2_PACKAGE_MBEDTLS_OPENIPC=y
BR2_PACKAGE_MOTORS=y
BR2_PACKAGE_OPUS_OPENIPC=y
BR2_PACKAGE_RTL8188EUS_OPENIPC=y
BR2_PACKAGE_VTUND_OPENIPC=y
BR2_PACKAGE_YAML_CLI=y
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_GENERAL_PATH)/scripts/post-image-split.sh"
BR2_OPENIPC_NOR_FIXED_PACKAGE=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/bin/sh
#
# The IR LEDs hang off PWM2, not a GPIO: lit at irled_duty percent (fw_env,
# default 35) while majestic holds the IR-cut (GPIO0) in night position, dark
# otherwise. PWM1 drives the heater and is never touched here.

DAEMON=/etc/init.d/S96irled
PIDFILE=/var/run/irled.pid

# Read on every switch to night, so fw_setenv irled_duty applies from the next
# one (or at once with a restart) without polling the flash every second.
# expr strips leading zeros: ash reads 08 in $(( )) as bad octal, 035 as 29.
duty() {
d=$(fw_printenv -n irled_duty 2>/dev/null)
case "$d" in
[0-9] | [0-9][0-9] | [0-9][0-9][0-9])
d=$(expr "$d" + 0)
[ "$d" -le 100 ] || d=35
;;
*) d=35 ;;
esac
echo "$d"
}

pwm2() {
# 0x40 period, 0x44 duty, 0x48 count, 0x4c control; 150 at 3 MHz = 20 kHz.
# A new duty only latches across a disable/enable.
devmem 0x2013004c 32 0
[ "$1" -eq 0 ] && return
devmem 0x20130040 32 150
devmem 0x20130044 32 $(((150 * $1 + 50) / 100))
devmem 0x20130048 32 10
devmem 0x2013004c 32 5
}

run() {
# The pad mux the stock kernel sets and this bootloader leaves at 1:
# GPIO0_5/SVB_PWM and GPIO0_6.
devmem 0x200f0134 32 0
devmem 0x200f0138 32 0
trap 'pwm2 0; exit 0' TERM INT
last=
while :; do
# Unreadable (majestic not up yet) counts as day: never leave them lit
night=$(cat /sys/class/gpio/gpio0/value 2>/dev/null)
[ "$night" = 1 ] || night=0
if [ "$night" != "$last" ]; then
[ "$night" = 1 ] && pwm2 "$(duty)" || pwm2 0
last=$night
fi
sleep 1
done
}

case "$1" in
start)
printf "Starting IR LED control: "
start-stop-daemon -b -m -S -q -p $PIDFILE -x /bin/sh -- $DAEMON run
[ $? = 0 ] && echo "OK" || echo "FAIL"
;;
stop)
printf "Stopping IR LED control: "
pid=$(cat $PIDFILE 2>/dev/null)
start-stop-daemon -K -q -p $PIDFILE
# Its trap turns PWM2 off after the current sleep; let it finish so
# a restart cannot have the old one darken what the new one lit.
n=0
while [ -n "$pid" ] && kill -0 "$pid" 2>/dev/null && [ $n -lt 5 ]; do
sleep 1
n=$((n + 1))
done
if [ -n "$pid" ] && kill -0 "$pid" 2>/dev/null; then
echo "FAIL"
exit 1
fi
rm -f $PIDFILE
Comment thread
qodo-free-for-open-source-projects[bot] marked this conversation as resolved.
Resolved
echo "OK"
;;
restart)
$0 stop && $0 start
;;
run)
run
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
[sensor]
Sensor_type =ov9712 ;sensor name
Mode =0 ;WDR_MODE_NONE = 0
;WDR_MODE_BUILT_IN = 1
;WDR_MODE_2To1_LINE = 2
;WDR_MODE_2To1_FRAME = 3
;WDR_MODE_2To1_FRAME_FULL_RATE =4 ...etc
DllFile =/usr/lib/sensors/libsns_ov9712_i2c_dc.so ;sensor lib path


[mode]
input_mode =4 ;INPUT_MODE_MIPI = 0
;INPUT_MODE_SUBLVDS = 1
;INPUT_MODE_LVDS = 2 ...etc

dev_attr = 2 ;mipi_dev_attr_t = 0
;lvds_dev_attr_t = 1
;NULL =2

[isp_image]
Isp_x =0
Isp_y =0
Isp_W =1280
Isp_H =720
Isp_FrameRate=25
Isp_Bayer =3 ;BAYER_RGGB=0, BAYER_GRBG=1, BAYER_GBRG=2, BAYER_BGGR=3


[vi_dev]
Input_mod =2 ;VI_INPUT_MODE_BT656 = 0
;VI_INPUT_MODE_BT601,
;VI_INPUT_MODE_DIGITAL_CAMERA
Work_mod =0 ;VI_WORK_MODE_1Multiplex = 0
;VI_WORK_MODE_2Multiplex,
;VI_WORK_MODE_4Multiplex
Combine_mode =0 ;Y/C composite or separation mode
;VI_COMBINE_COMPOSITE = 0 /*Composite mode */
;VI_COMBINE_SEPARATE, /*Separate mode */
Comp_mode =0 ;Component mode (single-component or dual-component)
;VI_COMP_MODE_SINGLE = 0, /*single component mode */
;VI_COMP_MODE_DOUBLE = 1, /*double component mode */
Clock_edge =1 ;Clock edge mode (sampling on the rising or falling edge)
;VI_CLK_EDGE_SINGLE_UP=0, /*rising edge */
;VI_CLK_EDGE_SINGLE_DOWN, /*falling edge */
Mask_num =2 ;Component mask
Mask_0 =0xFFC00000
Mask_1 =0x0
Scan_mode = 1;VI_SCAN_INTERLACED = 0
;VI_SCAN_PROGRESSIVE,
Data_seq =2 ;data sequence (ONLY for YUV format)
;----2th component U/V sequence in bt1120
; VI_INPUT_DATA_VUVU = 0,
; VI_INPUT_DATA_UVUV,
;----input sequence for yuv
; VI_INPUT_DATA_UYVY = 0,
; VI_INPUT_DATA_VYUY,
; VI_INPUT_DATA_YUYV,
; VI_INPUT_DATA_YVYU

Vsync =0 ; vertical synchronization signal
;VI_VSYNC_FIELD = 0,
;VI_VSYNC_PULSE,
VsyncNeg=0 ;Polarity of the vertical synchronization signal
;VI_VSYNC_NEG_HIGH = 0,
;VI_VSYNC_NEG_LOW /*if VIU_VSYNC_E
Hsync =0 ;Attribute of the horizontal synchronization signal
;VI_HSYNC_VALID_SINGNAL = 0,
;VI_HSYNC_PULSE,
HsyncNeg =0 ;Polarity of the horizontal synchronization signal
;VI_HSYNC_NEG_HIGH = 0,
;VI_HSYNC_NEG_LOW
VsyncValid =1 ;Attribute of the valid vertical synchronization signal
;VI_VSYNC_NORM_PULSE = 0,
;VI_VSYNC_VALID_SINGAL,
VsyncValidNeg =0;Polarity of the valid vertical synchronization signal
;VI_VSYNC_VALID_NEG_HIGH = 0,
;VI_VSYNC_VALID_NEG_LOW
Timingblank_HsyncHfb =408 ;Horizontal front blanking width
Timingblank_HsyncAct =1280 ;Horizontal effetive width
Timingblank_HsyncHbb =0 ;Horizontal back blanking width
Timingblank_VsyncVfb =6 ;Vertical front blanking height
Timingblank_VsyncVact =720 ;Vertical effetive width
Timingblank_VsyncVbb=6 ;Vertical back blanking height
Timingblank_VsyncVbfb =0 ;Even-field vertical front blanking height(interlace, invalid progressive)
Timingblank_VsyncVbact=0 ;Even-field vertical effetive width(interlace, invalid progressive)
Timingblank_VsyncVbbb =0 ;Even-field vertical back blanking height(interlace, invalid progressive)

DataPath =1 ;ISP enable or bypass
;VI_PATH_BYPASS = 0,/* ISP bypass */
;VI_PATH_ISP = 1,/* ISP enable */
;VI_PATH_RAW = 2,/* Capture raw data, for debug */
InputDataType=1 ;VI_DATA_TYPE_YUV = 0,VI_DATA_TYPE_RGB = 1,
DataRev =FALSE ;Data reverse. FALSE = 0; TRUE = 1
DevRect_x=0
DevRect_y=0
DevRect_w=1280
DevRect_h=720

[vi_chn]
CapRect_X =0
CapRect_Y =0
CapRect_Width=1280
CapRect_Height=720
DestSize_Width=1280
DestSize_Height=720
CapSel =2 ;Frame/field select. ONLY used in interlaced mode
;VI_CAPSEL_TOP = 0, /* top field */
;VI_CAPSEL_BOTTOM, /* bottom field */
;VI_CAPSEL_BOTH, /* top and bottom field */
PixFormat =19;PIXEL_FORMAT_YUV_SEMIPLANAR_422 = 22
;PIXEL_FORMAT_YUV_SEMIPLANAR_420 = 23 ...etc
CompressMode =0 ;COMPRESS_MODE_NONE = 0
;COMPRESS_MODE_SEG =1 ...etc

[AWB]
AdvAWBAttr=1|8|0x30|0xFF9|0
; HI_BOOL bAccuPrior, recommended 0 for outdoor, 1 for indoor
; HI_U8 u8Tolerance, Range:[0x0, 0xFF], AWB adjust tolerance,for outdoor, this value should be small, recommended 4
; HI_U16 u16CurveLLimit, Range:[0x0, 0x100], Left limit of AWB Curve, recommended for indoor 0xE0, outdoor 0xE0
; HI_U16 u16CurveRLimit, Range:[0x100, 0xFFF], Right Limit of AWB Curve,recommended for indoor 0x130, outdoor 0x120
; HI_BOOL bGainNormEn
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

if [ "$1" = "rtl8188eu-dlink-dcs-2330l" ]; then
# The status matters: S40network gives the cable DHCP when WiFi fails
modprobe 8188eu rtw_power_mgnt=0 rtw_ips_mode=0 rtw_enusbss=0
exit $?
fi

exit 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/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/hi3518cv100_lite_dlink-dcs-2330l-nor.tgz'
#
#
# Set custom majestic settings
#
# This board wires the OV9712 to VI bits 22-31, not the 20-29 of the stock ini
cli -s .isp.sensorConfig /etc/sensors/ov9712_i2c_dc_720p_dcs2330l.ini
cli -s .nightMode.irCutPin1 0
cli -s .nightMode.lightMonitor true
cli -s .video0.codec h264
cli -s .video0.fps 20
#
#
# Set wlan device and credentials if need
#
fw_setenv wlandev rtl8188eu-dlink-dcs-2330l
#fw_setenv wlanssid Router
#fw_setenv wlanpass 12345678
#

exit 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/etc/sensors/ar0130_i2c_960p.ini
/etc/sensors/gc1004_i2c_dc_720p.ini
/etc/sensors/imx122_spi_dc_1080p.ini
/etc/sensors/imx138_i2c_dc_720p.ini
/etc/sensors/imx138_spi_dc_720p.ini
/etc/sensors/imx222_spi_dc_1080p.ini
/etc/sensors/imx225_i2c_720p.ini
/etc/sensors/imx225_i2c_960p.ini
/etc/sensors/imx322_spi_dc_1080p.ini
/etc/sensors/imx323_spi_dc_1080p.ini
/etc/sensors/jxh22_i2c_dc_720p.ini
/etc/sensors/jxh42_i2c_dc_720p.ini
/etc/sensors/mt9p006_i2c_dc_720p.ini
/etc/sensors/ov2710_i2c_dc_1080p.ini
/etc/sensors/sc1035_960p.ini
/etc/sensors/sc1135_720p.ini
/etc/sensors/sc2135_i2c_dc_1080p.ini
#
/usr/lib/sensors/libsns_9m034.so
/usr/lib/sensors/libsns_ar0130.so
/usr/lib/sensors/libsns_ar0130_720p.so
/usr/lib/sensors/libsns_ar0130_960p.so
/usr/lib/sensors/libsns_ar0140.so
/usr/lib/sensors/libsns_ar0330.so
/usr/lib/sensors/libsns_ar0330_1080p.so
/usr/lib/sensors/libsns_gc1004ok.so
/usr/lib/sensors/libsns_h22.so
/usr/lib/sensors/libsns_hm1375.so
/usr/lib/sensors/libsns_icx692.so
/usr/lib/sensors/libsns_imx104.so
/usr/lib/sensors/libsns_imx122.so
/usr/lib/sensors/libsns_imx138.so
/usr/lib/sensors/libsns_imx138_i2c_dc.so
/usr/lib/sensors/libsns_imx222_spi_dc.so
/usr/lib/sensors/libsns_imx225_i2c_720p.so
/usr/lib/sensors/libsns_imx225_i2c_960p.so
/usr/lib/sensors/libsns_imx225_spi_720p.so
/usr/lib/sensors/libsns_imx236.so
/usr/lib/sensors/libsns_jxh42.so
/usr/lib/sensors/libsns_jxh42_i2c.so
/usr/lib/sensors/libsns_mn34031.so
/usr/lib/sensors/libsns_mn34031_720p.so
/usr/lib/sensors/libsns_mn34041.so
/usr/lib/sensors/libsns_mt9p006.so
/usr/lib/sensors/libsns_ov2710.so
/usr/lib/sensors/libsns_ov9732.so
/usr/lib/sensors/libsns_po3100k.so
/usr/lib/sensors/libsns_sc1035_720p.so
/usr/lib/sensors/libsns_sc1035_960p.so
Loading