Night Owl Camera
Table of Contents
1. Device Info
| Component | Property |
|---|---|
| CPU | ARM926EJ-S rev 5 (v5l) |
| Memory | 35164 K |
| Kernel | Linux (none) 3.18.20 #3 Tue Feb 27 16:14:51 HKT 2018 armv5tejl GNU/Linux |
1.1. MTD
| dev | size | erasesize | name |
|---|---|---|---|
| mtd0 | 00030000 | 00010000 | "uboot" |
| mtd1 | 00010000 | 00010000 | "env" |
| mtd2 | 00010000 | 00010000 | "user" |
| mtd3 | 00080000 | 00010000 | "conf" |
| mtd4 | 00200000 | 00010000 | "kernel" |
| mtd5 | 003f0000 | 00010000 | "rootfs" |
| mtd6 | 00140000 | 00010000 | "custom" |
1.2. UART
1.2.1. u-boot
setenv bootargs mem=40M console=ttyAMA0,115200 root=0100 init=/bin/sh mtdparts=hi_sfc:192K(uboot),64K(env),64K(user),512K(conf),2048K(kernel),4032K(rootfs),1280K(custom) ramdisk_size=4096
mw 0x12040094 0x00;mw 0x12143400 0x01;mw 0x121433fc 0x01;sf probe 0;sf read 0x82110000 0xD0000 0x200000;sf read 0x82310000 0x2D0000 0x3F0000;mw 0x121433fc 0x00;bootm 0x82110000 0x82310000;
1.3. init
1.3.1. /etc/init.d/rcS
#! /bin/sh
/bin/mount -a
# mount point "/usr/local"
/bin/mkdir -p /usr/local/bin
/bin/mkdir -p /usr/local/etc
/bin/mkdir -p /usr/local/sbin
echo "
_ _ _ _ _ _ _ _ _ _ _ _
\ _ _ _ _ _ ___
/ /__/ \ |_/
/ __ / - _ ___
/ / / / / /
_ _ _ _/ / / \_/ \_ ______
___________\___\__________________
"
for initscript in /etc/init.d/S[0-9][0-9]*
do
if [ -x $initscript ] ;
then
echo "[RCS]: $initscript"
$initscript
fi
done
cd /usr/share/ipcam/mpp
./load3518 -i imx290
cd ~
#./trigger.sh
/usr/share/ipcam/shell/startup.sh &
/bin/login
1.3.2. /usr/share/ipcam/shell/startup.sh
#!/bin/sh
#modprobe hiether
#sleep 3
#############################################################################################
# Linux Configuration
#############################################################################################
ETC_LINK_DIR=/usr/local/etc
ETC_LINK_RESOLV=$ETC_LINK_DIR/resolv.conf
mkdir -p $ETC_LINK_DIR
touch $ETC_LINK_RESOLV
echo "nameserver 8.8.8.8" >> $ETC_LINK_RESOLV
echo "nameserver 8.8.4.4" >> $ETC_LINK_RESOLV
echo "nameserver 4.4.4.4" >> $ETC_LINK_RESOLV
echo "nameserver 168.95.1.1" >> $ETC_LINK_RESOLV
sleep 1
#############################################################################################
# Frank's Debug Network Environment
#############################################################################################
ifconfig eth0 192.168.1.168 up
ifconfig eth0:1 192.168.250.250 up
ifconfig eth0:2 192.168.168.168 up
ifconfig lo 127.0.0.1 up
ifconfig eth0 down
#############################################################################################
# Linux Telnet Service
#############################################################################################
telnetd &
#############################################################################################
# Application Environment
#############################################################################################
HOMEDIR=/usr/share/ipcam
RESDIR=$HOMEDIR/resource
FLASHMAP=$HOMEDIR/flashmap.ini
SYSCONF=/dev/mtdblock3
APPEXEC=$HOMEDIR/app
APPAGENT=$HOMEDIR/agent
APPITTB=$HOMEDIR/ittb.tar.gz
NETSDKDIR_DEF=$RESDIR/netsdk
SHELLDIR=$HOMEDIR/shell
CONFMTD=/dev/mtdblock3
CUSTOMMTD=/dev/mtdblock6
CONFDIR=/media/conf
CUSTOMDIR=/media/custom
FONTDIR=$CUSTOMDIR/font
WEBDIR=$CUSTOMDIR/web
JFFS2IMG=$CUSTOMDIR/custom.jffs2
CONFSHELLDIR=$CONFDIR/shell
HOOK_STARTUP=$CONFSHELLDIR/startup.sh
HOOK_STOP=$CONFSHELLDIR/stop.sh
#############################################################################################
#############################################################################################
# Frank's Filesystem
#############################################################################################
# make mount point
mkdir /media/conf
mkdir /media/custom
mkdir /tmp/upgrade
# mount my configuration rw filesystem
#cp $CUSTOMMTD /tmp/custom.fs
#mount -t squashfs /tmp/custom.fs $CUSTOMDIR
mount -t squashfs $CUSTOMMTD $CUSTOMDIR
mount -t jffs2 $CONFMTD $CONFDIR
if [ "$?" != "0" ]; then
dd if=$JFFS2IMG of=$CONFMTD
mount -t jffs2 $CONFMTD $CONFDIR
fi
# mount my custom rw filesystem
# reset the resource environment
NETSDKDIR=$CONFDIR/netsdk
if [ ! -d "$NETSDKDIR" ]; then
echo 'Building System Configuration...'
#cp -af $NETSDKDIR_DEF $NETSDKDIR
fi
if [ ! -d "$CONFSHELLDIR" ]; then
echo 'Building shell Configuration...'
cp -af $SHELLDIR $CONFSHELLDIR
echo '#!/bin/sh' > $HOOK_STARTUP
echo 'exit 0' > $HOOK_STARTUP
chmod +x $HOOK_STARTUP
fi
#############################################
# Startup Application
#############################################
# Aplication Link
ln -s $APPEXEC /usr/local/sbin/READ_INFO
ln -s $APPEXEC /usr/local/sbin/RSERIAL_NUM
ln -s $APPEXEC /usr/local/sbin/WSERIAL_NUM
ln -s $APPEXEC /usr/local/sbin/RRTC
ln -s $APPEXEC /usr/local/sbin/WRTC
mkdir /tmp/run
mkdir /tmp/lib
echo "Do You Want to Run Application ? (y/n)"
read -t 1 -n 1 char
if [ "$char" == "n" ]; then
echo "Application Cancel!"
login
fi
if [ "$char" == "f" ]; then
# Linux core
echo "Frank Debug Mode!"
ulimit -c unlimited
echo "1" > /proc/sys/kernel/core_uses_pid
echo "/tmp/%t.%e.core" > /proc/sys/kernel/core_pattern
echo "3000000" > /proc/sys/net/core/rmem_default
echo "3000000" > /proc/sys/net/core/rmem_max
# Network debug environment
ifconfig eth0 192.168.2.45 up
sleep 1
mount -t nfs -o nolock 192.168.2.41:/root/nfs /root/nfs
export PATH=$PATH:"/root/nfs/bin"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"/root/nfs/lib"
rmmod watchdog
else
# insmod /root/bsp/i2cm.ko
# insmod /root/bsp/rtc.ko
# insmod /root/bsp/watchdog.ko
# RTC Sync
#hwclock -r
$HOOK_STARTUP
#$HOMEDIR/startup.sh
if [ "0" == "$?" ]; then
# Loop to Startup Application
while [ 1 ]
do
cd `dirname $PWD`
# Startup with Agent
#$APPAGENT $APPEXEC -w $WEBDIR -f $FONTDIR -m $FLASHMAP -d $DEFCONF -s $SYSCONF -c $SYSCONF2
# Startup without Agent
if grep $CUSTOMDIR /proc/mounts; then
echo "$CUSTOMDIR is exist"
else
echo "$CUSTOMDIR is not exist, remount"
mount -t squashfs $CUSTOMMTD $CUSTOMDIR
fi
$APPEXEC -w $WEBDIR -f $FONTDIR -m $FLASHMAP -s $SYSCONF -d $NETSDKDIR_DEF -c $NETSDKDIR
done
fi
fi
1.4. Network
The device fires off a number of networks, IPCZ68C2099558606 seems to be
intended for configuration / admin. The password is 123456789.