├── README.md ├── sd ├── home.bin └── test │ ├── factory_test.sh │ ├── v2 │ ├── audio │ │ └── fr │ │ │ ├── ants_welcome.aac │ │ │ ├── bind_success.aac │ │ │ ├── bind_timeout.aac │ │ │ ├── bindkey_fail.aac │ │ │ ├── connectting.aac │ │ │ ├── connectting_wifi.aac │ │ │ ├── download_fail.aac │ │ │ ├── downloading.aac │ │ │ ├── find_wifi.aac │ │ │ ├── ipc_connectted.aac │ │ │ ├── offline.aac │ │ │ ├── online.aac │ │ │ ├── please_reset.aac │ │ │ ├── please_use.aac │ │ │ ├── pwdwrong.aac │ │ │ ├── reboot.aac │ │ │ ├── record_finish.aac │ │ │ ├── record_start.aac │ │ │ ├── reset.aac │ │ │ ├── scanok.aac │ │ │ ├── start_wait.aac │ │ │ ├── start_wait.snd │ │ │ ├── support_2d.aac │ │ │ ├── updating.aac │ │ │ ├── upload_fail.aac │ │ │ ├── upload_success.aac │ │ │ ├── wait.aac │ │ │ ├── wait_bind.aac │ │ │ ├── wait_wifi.aac │ │ │ ├── welcome.aac │ │ │ ├── welcome.snd │ │ │ ├── wifi_connect_fail.aac │ │ │ └── wifi_connected.aac │ ├── bin │ │ ├── libyihackv2.so │ │ └── tcpsvd │ └── scripts │ │ ├── capture.sh │ │ ├── led.sh │ │ ├── startup_modified.sh │ │ └── startup_official.sh │ ├── wpa_supplicant.conf │ └── yi-hack-v2.cfg └── yi-v2.png /README.md: -------------------------------------------------------------------------------- 1 | THIS PROJECT IS OUTDATED AND NOT MAINTAINED ANYMORE 2 | =============== 3 | 4 | yi-hack-v2 project 5 | =============== 6 | 7 | Special thanks go to **fritz-smh** : https://github.com/fritz-smh/yi-hack 8 | 9 | This yi-hack-v2 project is totally inspired from its own project. 10 | 11 | 12 | Purpose 13 | ======= 14 | 15 | This project is a collection of scripts and binaries file to hack your Xiaomi Yi Ants Camera 2. 16 | 17 | ![Alt text](yi-v2.png?raw=true "Yi Ants Camera 2") 18 | 19 | This camera has the default following features : 20 | * wifi 21 | * motion detection : a video file is generated if a motion have been detected in the last 60 seconds. 22 | * send video data over the network on Chinese servers in the cloud to allow people to view camera data from their smartphone wherever they are. 23 | * setup thanks to a smartphone application. 24 | * local video storage on a SD card 25 | * no RTSP server 26 | 27 | This hack includes : 28 | * Base firmware : 2.1.1_20160429113900 29 | * Telnet server activated 30 | * FTP server activated 31 | * Ability to make a "China only" camera work outside China 32 | * Ability to choose voice between Chinese, English and French 33 | * Ability to choose timezone and format of date/time embedded in the video 34 | 35 | In early alpha stage : 36 | * Ability to disable Chinese cloud 37 | * Ability to activate RTSP server 38 | 39 | Warning about some models that are usable only in China 40 | ======================================================= 41 | 42 | My camera is a CN model, thus it can't be paired with a smartphone outside China. 43 | 44 | Thanks to https://diy.2pmc.net/solved-xiaomi-xiao-yi-ant-home-camera-can-used-china/ an old firmware (2.1.1_20160429113900) is available and make this CN model pairable with an Android device app (http://app.mi.com/detail/75646). It can also be paired with an iOS device if you succeed in installing Yi Home from Chinese App Store (tutorial is coming soon). 45 | 46 | The firmware comes from http://yi-version.qiniudn.com/@/familymonitor-h21/2.1.1_20160429113900home 47 | 48 | Warning, even if a chinese camera can be paired with your device, the application will fail with a -20009 network error code. This is due to recent changes on Xiaomi servers which prevent chinese cameras to work outside China. 49 | 50 | If you own a chinese camera, you can now use a custom proxy server to make Xiaomi servers think you are located in China. Special thanks to **shadow-1** who has made really great job for previous camera models (https://github.com/shadow-1/yi-hack-v3). 51 | 52 | To activate the proxy server, you need to modify **test/yi-hack-v2.cfg**, uncomment and fill the YI\_HACK\_PROXY line. Of course, you need to find a working proxy in China. 53 | 54 | Installation on the YI camera 55 | ============================= 56 | 57 | The memory card must stay in the camera ! If you remove it, the camera will start without using the hack. 58 | 59 | Prepare the memory card 60 | ----------------------- 61 | 62 | Clone this repository on a computer : 63 | 64 | git clone http://github.com/niclet/yi-hack-v2.git 65 | 66 | Then, format a micro SD card in fat32 (vfat) format and copy the content of the **yi-hack-v2/sd/** folder at the root of your memory card. 67 | 68 | The memory card will so contain : 69 | 70 | * home.bin : the official firmware file compliant with CN model 71 | * test : the folder which contains the hack scripts and binaries 72 | 73 | Start the camera 74 | ---------------- 75 | 76 | * If plugged, unplug the Yi camera 77 | * Insert the memory card in the Yi camera 78 | * Plug the Yi camera 79 | * Follow instructions to pair with your mobile app. This is only needed the first time. 80 | 81 | The camera will start. The led will indicate the current status : 82 | * yellow : camera startup 83 | * blue blinking : network configuration in progress (connect to wifi, set up the IP address) 84 | * blue : network configuration is OK. Camera is ready to use. 85 | 86 | How can I know which is the version of a firmware 'home.bin' file ? 87 | =============================================================== 88 | 89 | Just do : **strings home.bin | grep YUNYI_VERSION**. Example : 90 | 91 | $ strings home.bin | grep YUNYI_VERSION 92 | YUNYI_VERSION=2.1.1_20160429113900 93 | 94 | 95 | Use the camera 96 | ============== 97 | 98 | Telnet server 99 | ------------- 100 | 101 | The telnet server is on port 23. 102 | 103 | No authentication is needed, default user is root. 104 | 105 | FTP server 106 | ---------- 107 | 108 | The FTP server is on port 21. 109 | 110 | No authentication is needed, you can use anonymous user. 111 | 112 | RTSP server 113 | ----------- 114 | To activate the RTSP server, you need to modify **test/yi-hack-v2.cfg** and uncomment the line YI\_HACK\_STARTUP\_MODE=MODIFIED 115 | 116 | You must also modify **test/wpa_supplicant.conf** to be compliant with your own wifi network. 117 | 118 | Please note that when you activate RTSP server, you can't use your mobile app anymore. 119 | 120 | During camera startup, the led will indicate the current status : 121 | * yellow : camera startup 122 | * blue blinking : network configuration in progress (connect to wifi, set up the IP address) 123 | * blue : network configuration is OK. Camera is ready to use. 124 | * red : network configuration is KO. You should check your **test/wpa_supplicant.conf** file. 125 | 126 | Main stream is available from rtsp://\/stream1 127 | 128 | A secondary MJPEG stream is also available from rtsp://\/stream2 129 | 130 | Following **hostmit** suggestion, you can now use **test/v2/scripts/capture.sh** to capture a single frame as a JPG file. 131 | 132 | 133 | I want more ! 134 | ============= 135 | 136 | For now, it is just a kind of proof of concept. Many work has still to be done. 137 | 138 | Coming soon ! 139 | ============= 140 | 141 | Connection to wifi without Android app is in progress. 142 | RTSP server is also in progress, this will be the more important and difficult part. 143 | 144 | 145 | How it works ? 146 | ============== 147 | 148 | Hack content 149 | ------------ 150 | 151 | ```` 152 | home.bin Official firmware 2.1.1_20160429113900 153 | test/ Yi hack folder 154 | factory_test.sh This script is called on camera startup and will launch all the needed processes 155 | logs/ 156 | factory_test.log Log file of the hack (filled by factory_test.sh) 157 | v2/ 158 | audio/ 159 | fr/ 160 | * French voice files 161 | bin/ 162 | libyihackv2.so Native library to provide hacked features 163 | tcpsvd TCP Service Daemon (http://smarden.org/ipsvd/index.html) to launch FTP Server (ftpd) 164 | scripts/ 165 | capture.sh This script lets capture a single frame as a JPG file 166 | led.sh This script lets manipulate the led state 167 | startup_modified.sh This script is called from factory_test.sh when MODIFIED startup (aka RTSP server) is activated 168 | startup_official.sh This script is called from factory_test.sh when OFFICIAL startup is activated 169 | wpa_supplicant.conf This config file must be correctly filled to connect the camera to your wifi network when RTSP feature is enabled 170 | yi-hack-v2.cfg This config file lets you tune up various behaviors 171 | ```` 172 | 173 | 174 | factory_test.sh 175 | --------------- 176 | 177 | **TODO** 178 | 179 | -------------------------------------------------------------------------------- /sd/home.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/home.bin -------------------------------------------------------------------------------- /sd/test/factory_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # When script if started without any arguments, we assume it is called from main.sh 4 | # We restart if with useless param and redirect output to log file on sdcard 5 | 6 | if [ $# -eq 0 ]; then 7 | export YI_HACK_LOGS=/sdcard/test/logs 8 | mkdir -p "$YI_HACK_LOGS" 9 | $0 nop > "$YI_HACK_LOGS/factory_test.log" 2>&1 10 | exit $? 11 | fi 12 | 13 | # Export all variables available in yi-hack-v2.cfg 14 | if [ -f /sdcard/test/yi-hack-v2.cfg ]; then 15 | echo "### Export variables ... ###" 16 | while read assignment; do 17 | if [ "${assignment:0:8}" = "YI_HACK_" ]; then 18 | echo -e "export \"$assignment\"" 19 | export "$assignment" 20 | fi 21 | done < /sdcard/test/yi-hack-v2.cfg 22 | echo 23 | fi 24 | 25 | # Telnet server activation (no authentication required) 26 | if [ "$YI_HACK_TELNET_SERVER" = "YES" ]; then 27 | echo "### Activating telnet server ... ###" 28 | telnetd -l /bin/sh & 29 | echo 30 | fi 31 | 32 | # Launch ftp server 33 | if [ "$YI_HACK_FTP_SERVER" = "YES" ]; then 34 | if [ -f /sdcard/test/v2/bin/tcpsvd ]; then 35 | echo "### Activating FTP server ... ###" 36 | /sdcard/test/v2/bin/tcpsvd -vE 0.0.0.0 21 ftpd -w / & 37 | sleep 1s 38 | echo 39 | fi 40 | fi 41 | 42 | # Main hack 43 | rm -f "$YI_HACK_NATIVE_TRACES" 44 | if [ -f /sdcard/test/v2/bin/libyihackv2.so ]; then 45 | export LD_PRELOAD=/sdcard/test/v2/bin/libyihackv2.so 46 | fi 47 | 48 | # Mount config 49 | mkdir -p /mnt/cfg 50 | mount -t jffs2 /dev/mtdblock8 /mnt/cfg 51 | 52 | # Launch expected startup 53 | if [ "$YI_HACK_STARTUP_MODE" = "MODIFIED" ]; then 54 | if [ -f /sdcard/test/v2/scripts/startup_modified.sh ]; then 55 | /sdcard/test/v2/scripts/startup_modified.sh 56 | fi 57 | else 58 | if [ -f /sdcard/test/v2/scripts/startup_official.sh ]; then 59 | /sdcard/test/v2/scripts/startup_official.sh 60 | fi 61 | fi 62 | -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/ants_welcome.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/ants_welcome.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/bind_success.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/bind_success.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/bind_timeout.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/bind_timeout.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/bindkey_fail.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/bindkey_fail.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/connectting.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/connectting.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/connectting_wifi.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/connectting_wifi.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/download_fail.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/download_fail.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/downloading.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/downloading.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/find_wifi.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/find_wifi.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/ipc_connectted.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/ipc_connectted.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/offline.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/offline.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/online.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/online.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/please_reset.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/please_reset.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/please_use.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/please_use.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/pwdwrong.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/pwdwrong.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/reboot.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/reboot.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/record_finish.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/record_finish.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/record_start.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/record_start.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/reset.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/reset.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/scanok.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/scanok.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/start_wait.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/start_wait.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/start_wait.snd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/start_wait.snd -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/support_2d.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/support_2d.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/updating.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/updating.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/upload_fail.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/upload_fail.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/upload_success.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/upload_success.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/wait.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/wait.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/wait_bind.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/wait_bind.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/wait_wifi.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/wait_wifi.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/welcome.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/welcome.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/welcome.snd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/welcome.snd -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/wifi_connect_fail.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/wifi_connect_fail.aac -------------------------------------------------------------------------------- /sd/test/v2/audio/fr/wifi_connected.aac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/audio/fr/wifi_connected.aac -------------------------------------------------------------------------------- /sd/test/v2/bin/libyihackv2.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/bin/libyihackv2.so -------------------------------------------------------------------------------- /sd/test/v2/bin/tcpsvd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/sd/test/v2/bin/tcpsvd -------------------------------------------------------------------------------- /sd/test/v2/scripts/capture.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ $# -eq 4 ] && [ "$1" == "-o" ] && [ "$3" == "-q" ]; 3 | then 4 | TMPBASE=`mktemp -u` 5 | /usr/local/bin/test_yuvcap -b 0 -Y -f $TMPBASE -r 1 6 | if [ $? -eq 0 ]; 7 | then 8 | YUV_FILE=`ls ${TMPBASE}*` 9 | # we get something like /tmp/tmp.xr8C1d_prev_M_1920x1080.yuv 10 | # we want to extract width and height 11 | YUV_FILE_SIZE=${YUV_FILE##/*_} 12 | # we get 1920x1080.yuv 13 | WIDTH=${YUV_FILE_SIZE%%x*} 14 | HEIGHT_YUV=${YUV_FILE_SIZE##*x} 15 | HEIGHT=${HEIGHT_YUV%%.*} 16 | # convert yuv to jpg 17 | /usr/local/bin/jpg_enc -y $YUV_FILE -w $WIDTH -h $HEIGHT -q $4 -f $2 18 | rm -f $YUV_FILE 19 | else 20 | echo "Failed to capture frame, please ensure that test_encode has been correctly started." 21 | fi 22 | else 23 | echo "Usage: capture.sh -o -q " 24 | echo "Sample: capture.sh -o /sdcard/test/capture.jpg -q 70" 25 | fi 26 | -------------------------------------------------------------------------------- /sd/test/v2/scripts/led.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ $# -eq 2 ] && [ "$1" = "red" -o "$1" = "green" -o "$1" = "blue" ] && [ "$2" = "off" -o "$2" = "on" -o "$2" = "flash" -o "$2" = "flash_bg" -o "$2" = "init" ]; then 4 | num=0 5 | if [ "$1" = "red" ]; then 6 | num=33 7 | elif [ "$1" = "green" ]; then 8 | num=46 9 | else 10 | num=38 11 | fi 12 | 13 | if [ "$2" != "flash_bg" ]; then 14 | pkill -f "led.sh $1 flash_bg" 15 | fi 16 | 17 | if [ "$2" = "off" ]; then 18 | echo 0 > /sys/class/gpio/gpio${num}/value 19 | elif [ "$2" = "on" ]; then 20 | echo 1 > /sys/class/gpio/gpio${num}/value 21 | elif [ "$2" = "flash" ]; then 22 | $0 $1 flash_bg & 23 | elif [ "$2" = "init" ]; then 24 | echo ${num} > /sys/class/gpio/export 25 | echo out > /sys/class/gpio/gpio${num}/direction 26 | echo 0 > /sys/class/gpio/gpio${num}/value 27 | else 28 | while true 29 | do 30 | echo 1 > /sys/class/gpio/gpio${num}/value 31 | sleep 0.5 32 | echo 0 > /sys/class/gpio/gpio${num}/value 33 | sleep 0.5 34 | done 35 | fi 36 | else 37 | echo "Usage: led.sh " 38 | fi 39 | 40 | -------------------------------------------------------------------------------- /sd/test/v2/scripts/startup_modified.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "### MODIFIED startup ... ###" 4 | 5 | # Copy wpa_supplicant.conf 6 | if [ -f /sdcard/test/wpa_supplicant.conf ]; then 7 | mkdir -p /tmp/config 8 | cp -f /sdcard/test/wpa_supplicant.conf /tmp/config/wpa_supplicant.conf 9 | else 10 | echo "Error: /sdcard/test/wpa_supplicant.conf is not available" 11 | exit 12 | fi 13 | 14 | # Wifi 15 | 16 | # USB 2.0 'Enhanced' Host Controller (EHCI) Driver 17 | modprobe ehci-hcd 18 | # Ambarella USB Device Controller Gadget 19 | modprobe ambarella_udc 20 | # Mass Storage Gadget 21 | modprobe g_mass_storage file=/dev/mmcblk0p1 stall=0 removable=1 22 | 23 | echo device > /proc/ambarella/usbphy0 24 | 25 | sleep 1s 26 | /usr/local/bin/amba_debug -g 26 -d 0x1 27 | sleep 2s 28 | 29 | echo host > /proc/ambarella/usbphy0 30 | 31 | # M-WLAN MLAN Driver 32 | modprobe mlan 33 | # M-WLAN Driver 34 | modprobe usb8801 35 | sleep 2 36 | ifconfig mlan0 up 37 | 38 | # Set wifi wmm 39 | /lib/firmware/mrvl/mlanutl mlan0 wmmparamcfg 0 2 3 2 150 1 2 3 2 150 2 2 3 2 150 3 2 3 2 150 40 | /lib/firmware/mrvl/mlanutl mlan0 macctrl 0x13 41 | /lib/firmware/mrvl/mlanutl mlan0 psmode 0 42 | 43 | # Set wifi countrycode 44 | /lib/firmware/mrvl/mlanutl mlan0 countrycode CN 45 | 46 | # Init led 47 | /sdcard/test/v2/scripts/led.sh red init 48 | /sdcard/test/v2/scripts/led.sh green init 49 | /sdcard/test/v2/scripts/led.sh blue init 50 | 51 | # Make blue led flash during wifi connection 52 | /sdcard/test/v2/scripts/led.sh red off 53 | /sdcard/test/v2/scripts/led.sh green off 54 | /sdcard/test/v2/scripts/led.sh blue flash 55 | 56 | # Connect to wifi 57 | wifi_auto.sh 58 | 59 | if [ $? != 0 ]; then 60 | # Turn off blue led and turn on red led, wifi is KO 61 | /sdcard/test/v2/scripts/led.sh blue off 62 | /sdcard/test/v2/scripts/led.sh red on 63 | exit 1 64 | fi 65 | 66 | # Turn on blue led, wifi is OK 67 | /sdcard/test/v2/scripts/led.sh blue on 68 | 69 | # MN34220PL 1/3 -Inch, 1944x1213, 2.4-Megapixel CMOS Digital Image Sensor 70 | modprobe mn34220pl bus_addr=0x36 71 | 72 | /usr/local/bin/init.sh --na 73 | 74 | /usr/local/bin/test_tuning -a 0 & 75 | /usr/local/bin/test_encode -A -i 1920x1080 --bitrate 1200000 -f 25 --enc-mode 4 --hdr-expo 2 --hdr-mode 1 -J --btype off -K --btype off -X --bmaxsize 1920x1080 --bsize 1920x1080 --smaxsize 1920x1080 -Y --bmaxsize 640x360 --bsize 640x360 -B -m 640x360 --smaxsize 640x360 76 | /usr/local/bin/rtsp_server & 77 | /usr/local/bin/test_encode -A -h 1080p -e --bitrate 1200000 78 | /usr/local/bin/test_encode -B -e 79 | 80 | -------------------------------------------------------------------------------- /sd/test/v2/scripts/startup_official.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "### ORIGINAL startup ... ###" 4 | 5 | /bak/usr/local/bin/gpio_check.sh 6 | 7 | # Wifi 8 | /bak/usr/local/bin/usb_wifi.sh 9 | 10 | # 2018 by pass 11 | /usr/local/bin/amba_debug -g 51 -d 0x1 12 | 13 | # Cryptography engine 14 | modprobe ambarella_crypto config_polling_mode=1 15 | modprobe ambac 16 | 17 | # ipc 18 | modprobe pwm_bl 19 | 20 | modprobe mn34220pl bus_addr=0x36 21 | /usr/local/bin/init.sh --na 22 | 23 | #miio 24 | /usr/local/bin/mosquitto -c /etc/mosquitto.conf -d 25 | 26 | #real init ipc 27 | /home/web/show_stack & 28 | 29 | /home/web/ipc -w & 30 | -------------------------------------------------------------------------------- /sd/test/wpa_supplicant.conf: -------------------------------------------------------------------------------- 1 | ctrl_interface=/var/run/wpa_supplicant 2 | ap_scan=1 3 | network={ 4 | ssid="your_wifi_ssid" 5 | scan_ssid=1 6 | proto=WPA RSN 7 | key_mgmt=WPA-PSK 8 | pairwise=CCMP TKIP 9 | group=CCMP TKIP 10 | psk="your_password" 11 | } 12 | -------------------------------------------------------------------------------- /sd/test/yi-hack-v2.cfg: -------------------------------------------------------------------------------- 1 | ### Yi Hack v2 provides several startup modes 2 | # OFFICIAL : various improvements on official startup, requires Xiaomi account and Yi/Mi mobile application (this is the default) 3 | # MODIFIED : modified startup, doesn't require any connection to Xiomi servers, nor any mobile application 4 | 5 | #YI_HACK_STARTUP_MODE=MODIFIED 6 | 7 | ### Language used to initialize camera 8 | # CN : chinese voice (this is the default) 9 | # US : english voice 10 | # FR : french voice 11 | 12 | YI_HACK_LANGUAGE=FR 13 | 14 | ### Telnet server activation 15 | # YES : telnet server is activated 16 | # NO : telnet server is deactivated (this is the default) 17 | 18 | YI_HACK_TELNET_SERVER=YES 19 | 20 | ### FTP server activation 21 | # YES : FTP server is activated 22 | # NO : FTP server is deactivated (this is the default) 23 | 24 | YI_HACK_FTP_SERVER=YES 25 | 26 | ### Timezone 27 | # Example timezones, see more at http://svn.fonosfera.org/fon-ng/trunk/luci/modules/admin-fon/root/etc/timezones.db 28 | # -Europe/London GMT0BST,M3.5.0/1,M10.5.0 29 | # -Europe/Paris CET-1CEST,M3.5.0,M10.5.0/3 30 | # -US/Central CST6CDT,M3.2.0,M11.1.0 31 | 32 | YI_HACK_TIME_TIMEZONE=CET-1CEST,M3.5.0,M10.5.0/3 33 | 34 | ### Time format 35 | # Same format as strftime, output is limited to 19 characters 36 | # Please note that the shadow behind the displayed time has always the same width for now 37 | 38 | #YI_HACK_TIME_FORMAT=%Y-%m-%d %H:%M:%S 39 | 40 | ### Proxy to bypass non China location issue 41 | # To bypass China restrictions, you can use a custom proxy 42 | 43 | #YI_HACK_PROXY=socks5h://127.0.0.1:1080 44 | -------------------------------------------------------------------------------- /yi-v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niclet/yi-hack-v2/9d0e15766f86c68875de2e568dbe8b2643332379/yi-v2.png --------------------------------------------------------------------------------