diff --git a/sd/home b/sd/home index ed90df7..c3d242b 100644 Binary files a/sd/home and b/sd/home differ diff --git a/sd/test/equip_test.sh b/sd/test/equip_test.sh index 0ffae05..c2197a6 100644 --- a/sd/test/equip_test.sh +++ b/sd/test/equip_test.sh @@ -69,10 +69,13 @@ get_config() { ### first we assume that this script is started from /home/init.sh and will replace it from the below lines (which are not commented in init.sh : #if [ -f "/home/hd1/test/equip_test.sh" ]; then -# /home/hd1/test/equip_test.sh -# exit +# /home/hd1/test/equip_test.sh +# exit #fi +### Init logs +log_init + ###################################################### # start of our custom script !!!!!! ###################################################### @@ -82,8 +85,9 @@ log "Start telnet server..." telnetd & -### configure timezone -echo "$(get_config TIMEZONE)" > /etc/TZ +### configure timezone + +echo "$(get_config TIMEZONE)" > /etc/TZ ### get time is done after wifi configuration! @@ -113,13 +117,41 @@ cd /home/3518 # added : himm 0x20050074 0x06802424 +### Let ppl hear that we start +/home/rmm "/home/hd1/test/voice/welcome.g726" 1 +/home/rmm "/home/hd1/test/voice/wait.g726" 1 + ### start blinking blue led for configuration in progress #/home/led_ctl -boff -yon & led -yoff -bfast -insmod /home/mtprealloc7601Usta.ko -insmod /home/mt7601Usta.ko +bcmver="bd1e" +bcmver1="0bdc" +bcmcmd=$(lsusb|grep "0a5c"|cut -d':' -f3) + +if [ $bcmver = $bcmcmd ];then + echo 1 > /tmp/isbcm + #/home/bcm/nvram set /home/bcm/nvram.bin + /home/bcm/nvram get + mount -t usbfs none /proc/bus/usb + /home/bcm/bcmdl -n /tmp/nvram.bin /home/bcm/fw_bcmdhd_xy_r2.bin.trx -C 5 + insmod /home/bcm/bcmdhd.ko iface_name=ra0 + log "BCM 43143:bd1e" +elif [ $bcmver1 = $bcmcmd ];then + echo 1 > /tmp/isbcm + #/home/bcm/nvram set /home/bcm/nvram.bin + /home/bcm/nvram get + mount -t usbfs none /proc/bus/usb + /home/bcm/bcmdl -n /tmp/nvram.bin /home/bcm/fw_bcmdhd_xy_r2.bin.trx -C 5 + insmod /home/bcm/bcmdhd.ko iface_name=ra0 + log "BCM 43143:0bdc" +else + echo 1 > /tmp/ismtk + insmod /home/mtprealloc7601Usta.ko + insmod /home/mt7601Usta.ko + log "MTK 7601" +fi ifconfig ra0 up @@ -165,19 +197,19 @@ cd /home/3518 himm 0x20050074 0x06802424 - + ### what is this ? -cd /home -./peripheral & +cd /home +./peripheral & ./dispatch & ./exnet & #./mysystem & - + count=5 while [ $count -gt 0 ] do -if [ -f "/tmp/init_finish" ]; then +if [ -f "/tmp/init_finish" ]; then break else count=`expr $count - 1` @@ -193,8 +225,6 @@ done cp /home/hd1/test/wpa_supplicant.conf /home/wpa_supplicant.conf -### Init logs -log_init # Put version informations in logs and a file which will be included in the http server default page TMP_VERSION_FILE=/tmp/version_information rm -f ${TMP_VERSION_FILE} @@ -216,6 +246,12 @@ case ${FIRMWARE_LETTER} in HTTP_VERSION='M' ;; + # 1.8.6.1 + Q) # Tested :) + RTSP_VERSION='M' + HTTP_VERSION='M' + ;; + # 1.8.5.1 M) # Tested :) RTSP_VERSION='M' @@ -247,7 +283,6 @@ log "The RTSP server binary version which will be used is the '${RTSP_VERSION}'" log "The HTTP server binary version which will be used is the '${HTTP_VERSION}'" - log "Check for some files size..." ls -l /home/hd1/test/rtspsvr* /home/hd1/test/http/server* | sed "s/^/ /" >> ${LOG_FILE} @@ -256,12 +291,16 @@ log "Debug mode = $(get_config DEBUG)" # first, configure wifi +### Let ppl hear that we start connect wifi +/home/rmm "/home/hd1/test/voice/connectting.g726" 1 + log "Check for wifi configuration file...*" log $(find /home -name "wpa_supplicant.conf") log "Start wifi configuration..." -log $(/home/wpa_supplicant -B -i ra0 -c /home/wpa_supplicant.conf ) +res=$(/home/wpa_supplicant -B -i ra0 -c /home/wpa_supplicant.conf ) log "Status for wifi configuration=$? (0 is ok)" +log "Wifi configuration answer: $res" log "Do network configuration 1/2 (ip and gateway)" #ifconfig ra0 192.168.1.121 netmask 255.255.255.0 @@ -273,14 +312,14 @@ log "Done" log "Configuration is :" ifconfig | sed "s/^/ /" >> ${LOG_FILE} -### configure DNS (google one) +### configure DNS log "Do network configuration 2/2 (DNS)" -echo "nameserver 8.8.8.8" > /etc/resolv.conf +echo "nameserver $(get_config NAMESERVER)" > /etc/resolv.conf log "Done" -### configure time on a NTP server +### configure time on a NTP server log "Get time from a NTP server..." -NTP_SERVER=$(get_config NTP_SERVER) +NTP_SERVER=$(get_config NTP_SERVER) log "But first, test the NTP server '${NTP_SERVER}':" ping -c1 ${NTP_SERVER} >> ${LOG_FILE} log "Previous datetime is $(date)" @@ -289,6 +328,12 @@ log "Done" log "New datetime is $(date)" +### Check if reach gateway and notify +ping -c1 -W2 $(get_config GATEWAY) > /dev/null +if [ 0 -eq $? ]; then + /home/rmm "/home/hd1/test/voice/wifi_connected.g726" 1 +fi + ### set the root password root_pwd=$(get_config ROOT_PASSWORD) [ $? -eq 0 ] && echo "root:$root_pwd" | chpasswd @@ -297,17 +342,10 @@ root_pwd=$(get_config ROOT_PASSWORD) log "Start blue led on" led -yoff -bon - + ### Rename the timeout sound file to avoid being spammed with chinese audio stuff... [ -f /home/timeout.g726 ] && mv /home/timeout.g726 /home/timeout.g726.OFF -### Rmm stuff -# without this, most things does not work (http server, rtsp) -# It starts to use the cloud (which is no more launched) so you will find timeout in the logs -cd /home -./rmm & - - sync ### Launch FTP server @@ -355,23 +393,6 @@ cd /home ./record_event & ./mp4record 60 & -### Launch script to check for motion the last minute -/home/hd1/test/check_motion.sh & - -### Rtsp server -cd /home/hd1/test/ -log "Start rtsp server : rtspsvr${RTSP_VERSION}..." -if [[ $(get_config DEBUG) == "yes" ]] ; then - ./rtspsvr${RTSP_VERSION} > /${LOG_DIR}/log_rtsp.txt 2>&1 & -else - ./rtspsvr${RTSP_VERSION} & -fi -sleep 1 -log "Check for rtsp process : " -ps | grep rtspsvr | grep -v grep >> ${LOG_FILE} - -sleep 5 - ### Some configuration himm 0x20050068 0x327c2c @@ -395,14 +416,56 @@ himm 0x20030048 0x302 rm /home/hd1/FSCK* +# Check and create crontabs folder +crontab_folder="/var/spool/cron/crontabs" +if [ ! -r "$crontab_folder" ]; then + mkdir -p "$crontab_folder" +fi +# Start crond daemon +/usr/sbin/crond -b + ### Final led color -led $(get_config LED_WHEN_READY) +### Check if reach gateway and notify +ping -c1 -W2 $(get_config GATEWAY) > /dev/null +if [ 0 -eq $? ]; then + led $(get_config LED_WHEN_READY) + /home/rmm "/home/hd1/test/voice/success.g726" 1 +else + led -boff -yfast +fi + +### Rmm stuff +# without this, most things does not work (http server, rtsp) +# It starts to use the cloud (which is no more launched) so you will find timeout in the logs +# This must be launched after all "/home/rmm" command calls +cd /home +./rmm & + + +### Rtsp server +cd /home/hd1/test/ +log "Start rtsp server : rtspsvr${RTSP_VERSION}..." +if [[ $(get_config DEBUG) == "yes" ]] ; then + ./rtspsvr${RTSP_VERSION} > /${LOG_DIR}/log_rtsp.txt 2>&1 & +else + ./rtspsvr${RTSP_VERSION} & +fi +sleep 1 +log "Check for rtsp process : " +ps | grep rtspsvr | grep -v grep >> ${LOG_FILE} + +sleep 5 + ### List the processes after startup log "Processes after startup :" ps >> ${LOG_FILE} +### List storage status +log "Storage status :" +df -h >> ${LOG_FILE} + ### to make sure log are written... sync diff --git a/sd/test/voice/bindkey_fail.g726 b/sd/test/voice/bindkey_fail.g726 new file mode 100644 index 0000000..d8112a2 Binary files /dev/null and b/sd/test/voice/bindkey_fail.g726 differ diff --git a/sd/test/voice/connectting.g726 b/sd/test/voice/connectting.g726 new file mode 100644 index 0000000..edc81d7 Binary files /dev/null and b/sd/test/voice/connectting.g726 differ diff --git a/sd/test/voice/download_fail.g726 b/sd/test/voice/download_fail.g726 new file mode 100644 index 0000000..dcc4691 Binary files /dev/null and b/sd/test/voice/download_fail.g726 differ diff --git a/sd/test/voice/downloading.g726 b/sd/test/voice/downloading.g726 new file mode 100644 index 0000000..8e28643 Binary files /dev/null and b/sd/test/voice/downloading.g726 differ diff --git a/sd/test/voice/forbidden.g726 b/sd/test/voice/forbidden.g726 new file mode 100644 index 0000000..6eec234 Binary files /dev/null and b/sd/test/voice/forbidden.g726 differ diff --git a/sd/test/voice/pwdwrong.g726 b/sd/test/voice/pwdwrong.g726 new file mode 100644 index 0000000..78135d6 Binary files /dev/null and b/sd/test/voice/pwdwrong.g726 differ diff --git a/sd/test/voice/reset.g726 b/sd/test/voice/reset.g726 new file mode 100644 index 0000000..a4c478f Binary files /dev/null and b/sd/test/voice/reset.g726 differ diff --git a/sd/test/voice/scanok.g726 b/sd/test/voice/scanok.g726 new file mode 100644 index 0000000..2c7a3e3 Binary files /dev/null and b/sd/test/voice/scanok.g726 differ diff --git a/sd/test/voice/start_wait.g726 b/sd/test/voice/start_wait.g726 new file mode 100644 index 0000000..71f333a Binary files /dev/null and b/sd/test/voice/start_wait.g726 differ diff --git a/sd/test/voice/success.g726 b/sd/test/voice/success.g726 new file mode 100644 index 0000000..b71d1d9 Binary files /dev/null and b/sd/test/voice/success.g726 differ diff --git a/sd/test/voice/support_2d.g726 b/sd/test/voice/support_2d.g726 new file mode 100644 index 0000000..cc8da18 Binary files /dev/null and b/sd/test/voice/support_2d.g726 differ diff --git a/sd/test/voice/updating.g726 b/sd/test/voice/updating.g726 new file mode 100644 index 0000000..de57a64 Binary files /dev/null and b/sd/test/voice/updating.g726 differ diff --git a/sd/test/voice/wait.g726 b/sd/test/voice/wait.g726 new file mode 100644 index 0000000..c1efce3 Binary files /dev/null and b/sd/test/voice/wait.g726 differ diff --git a/sd/test/voice/wait_scan.g726 b/sd/test/voice/wait_scan.g726 new file mode 100644 index 0000000..abaf137 Binary files /dev/null and b/sd/test/voice/wait_scan.g726 differ diff --git a/sd/test/voice/welcome.g726 b/sd/test/voice/welcome.g726 new file mode 100644 index 0000000..f5ed0a1 Binary files /dev/null and b/sd/test/voice/welcome.g726 differ diff --git a/sd/test/voice/wifi_connected.g726 b/sd/test/voice/wifi_connected.g726 new file mode 100644 index 0000000..25009b5 Binary files /dev/null and b/sd/test/voice/wifi_connected.g726 differ diff --git a/sd/test/yi-hack.cfg b/sd/test/yi-hack.cfg index 287bc79..d4bb3b1 100644 --- a/sd/test/yi-hack.cfg +++ b/sd/test/yi-hack.cfg @@ -6,6 +6,7 @@ ROOT_PASSWORD=1234qwer IP=192.168.1.121 NETMASK=255.255.255.0 GATEWAY=192.168.1.254 +NAMESERVER=192.168.1.254 ### Led color after full boot # The sequence will be :