{"id":13473472,"url":"https://github.com/roleoroleo/yi-hack-MStar","last_synced_at":"2025-03-26T19:34:08.988Z","repository":{"id":38983670,"uuid":"208753411","full_name":"roleoroleo/yi-hack-MStar","owner":"roleoroleo","description":"Custom firmware for Yi 1080p camera based on MStar platform","archived":false,"fork":false,"pushed_at":"2025-03-14T18:51:22.000Z","size":4102,"stargazers_count":868,"open_issues_count":7,"forks_count":112,"subscribers_count":43,"default_branch":"master","last_synced_at":"2025-03-14T19:36:06.523Z","etag":null,"topics":["6fus","camera","custom","firmware","hack","rtsp","yi"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roleoroleo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-16T08:51:51.000Z","updated_at":"2025-03-14T18:51:32.000Z","dependencies_parsed_at":"2024-01-08T21:28:03.690Z","dependency_job_id":"1c3114eb-5c21-4e0c-9f04-0087f13afec9","html_url":"https://github.com/roleoroleo/yi-hack-MStar","commit_stats":null,"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roleoroleo%2Fyi-hack-MStar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roleoroleo%2Fyi-hack-MStar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roleoroleo%2Fyi-hack-MStar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roleoroleo%2Fyi-hack-MStar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roleoroleo","download_url":"https://codeload.github.com/roleoroleo/yi-hack-MStar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245722831,"owners_count":20661831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["6fus","camera","custom","firmware","hack","rtsp","yi"],"created_at":"2024-07-31T16:01:03.925Z","updated_at":"2025-03-26T19:34:08.553Z","avatar_url":"https://github.com/roleoroleo.png","language":"C","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=JBYXDMR24FW7U\u0026currency_code=EUR\u0026source=url"],"categories":["C"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\t\u003cimg height=\"200\" src=\"https://user-images.githubusercontent.com/39277388/85948999-59034780-b954-11ea-8fb3-c4c88727cf5b.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003ca target=\"_blank\" href=\"https://github.com/roleoroleo/yi-hack-MStar/releases\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/github/downloads/roleoroleo/yi-hack-MStar/total.svg\" alt=\"Releases Downloads\"\u003e\n\t\u003c/a\u003e\n\u003c/p\u003e\n\n# Custom firmware for Yi camera based on MStar platform\nThis firmware is based on the work done by TheCrypt0\nhttps://github.com/TheCrypt0/yi-hack-v4\nIt's a clone made for Yi cameras based on MStar platform.\n\n**But you can't choose between TheCrypt0 and MStar: if your cam is based on Hi3518e Chipset then you have to use TheCrypt0, if your cam is based on MStar Infinity Chipset then you have to use MStar.**\n\nI have no time to support the project, so feel free to clone/fork this git and modify it as you want.\n\n## Table of Contents\n- [Table of Contents](#table-of-contents)\n- [Installation](#installation)\n- [Contributing](#contributing-and-bug-reports)\n- [Features](#features)\n- [RTSP Server](#rtsp-server)\n- [Performance](#performance)\n- [Supported cameras](#supported-cameras)\n- [Is my cam supported?](#is-my-cam-supported)\n- [Home Assistant integration](#home-assistant-integration)\n- [Build your own firmware](#build-your-own-firmware)\n- [Unbricking](#unbricking)\n- [License](#license)\n- [Acknowledgments](#acknowledgments)\n- [Disclaimer](#disclaimer)\n- [Donation](#donation)\n\n## Installation\n\n### Install Procedure\n1. Check if your cam is supported in the \"Supported cameras\" section and note the file prefix.\n2. Format an SD Card as FAT32. It's recommended to format the card in the camera using the camera's native format function. If the card is already formatted, remove all the files.\n3. Download the latest release from [the Releases page](https://github.com/roleoroleo/yi-hack-MStar/releases) based on the file prefix.\n4. Extract the contents of the archive to the root of your SD card (for example home_y203c and sys_y203c).\n5. Insert the SD Card and reboot the camera.\n6. The yellow light will come ON and flash for roughly 30 seconds, which means the firmware is being flashed successfully. The camera will boot up.\n7. The yellow light will come ON again for the final stage of flashing. This will take up to 2 minutes.\n8. Blue light should come ON indicating that your WiFi connection has been successful (if not disable using app).\n9. Go in the browser and access the web interface of the camera as a website (http://IP-CAM) where IP-CAM is the IP address of your cam and you can find it using the mobile app (Camera Settings --\u003e Network Info --\u003e IP Address). If the mobile app can't be paired, you may look for the IP on your router's portal (see connected devices).\n10. Done.\n\n### Online Update Procedure\n1. Go to the \"Maintenance\" web page\n2. Check if a new release is available\n3. Click \"Upgrade Firmware\"\n4. Wait for cam reboot\n\n### Manual Update Procedure\nCheck the wiki: https://github.com/roleoroleo/yi-hack-MStar/wiki/Manual-firmware-upgrade\n\n\n### Optional Utilities\nSeveral [optional utilities](https://github.com/roleoroleo/yi-hack-utils) are avaiable, some supporting experimental features like text-to-speech.\n\n\n## Contributing and Bug Reports\nSee [CONTRIBUTING](CONTRIBUTING.md)\n\n---\n\n## Features\nThis custom firmware contains features replicated from the [yi-hack-MStar](https://github.com/roleoroleo/yi-hack-MStar) project and similar to the [yi-hack-v4](https://github.com/TheCrypt0/yi-hack-v4) project.\n\n- FEATURES\n  - RTSP server - allows a RTSP stream of the video (high and/or low resolution) and audio (thanks to @PieVo for the work on MStar platform).\n    - rtsp://IP-CAM/ch0_0.h264             (high res)\n    - rtsp://IP-CAM/ch0_1.h264             (low res)\n    - rtsp://IP-CAM/ch0_2.h264             (only audio)\n  - ONVIF server (with support for stream, snapshot, ptz, presets, events and WS-Discovery) - standardized interfaces for IP cameras.\n  - Snapshot service - allows to get a jpg with a web request.\n    - http://IP-CAM/cgi-bin/snapshot.sh?res=low\u0026watermark=yes        (select resolution: low or high, and watermark: yes or no)\n    - http://IP-CAM/cgi-bin/snapshot.sh                              (default high without watermark)\n  - Timelapse feature\n  - MQTT events - Motion detection and baby crying detection through mqtt protocol.\n  - MQTT configuration\n  - Web server - web configuration interface.\n  - SSH server - dropbear.\n  - Telnet server - busybox.\n  - FTP server.\n  - FTP push: export mp4 video to an FTP server (thanks to @Catfriend1).\n  - Authentication for HTTP, RTSP and ONVIF server.\n  - Proxychains-ng - Disabled by default. Useful if the camera is region locked.\n  - Original watermark image removed.\n  - The possibility to change some camera settings (copied from official app):\n    - camera on/off\n    - video saving mode\n    - detection sensitivity\n    - motion detections (it depends on your cam and your plan)\n    - baby crying detection\n    - status led\n    - ir led\n    - rotate\n    - ...\n  - Management of motion detect events and videos through a web page.\n  - View recorded video through a web page (thanks to @BenjaminFaal).\n  - PTZ support through a web page (if the cam supports it).\n  - PTZ presets.\n  - The possibility to disable all the cloud features.\n  - Swap File on SD.\n  - Online firmware upgrade.\n  - Load/save/reset configuration.\n\n- ADDITIONAL FEATURES\n  - Google Drive synchronization - https://github.com/roleoroleo/yi-hack-MStar.gdrive\n  - Microsoft OneDrive synchronization - https://github.com/denven/yihack-onedrive-uploader  \n  - rsync synchronization thanks to @hetzbh - https://github.com/hetzbh/yi-cams-backup\n\n## RTSP Server\nI wrote a daemon that reads the video stream directly from the kernel driver memory and sends it to an application based on live555.\nI was inspired by the following topic:\n- @andy2301 - [Ideas for the RSTP rtsp and rtsp2301](https://github.com/xmflsct/yi-hack-1080p/issues/5#issuecomment-294326131)\n\nThe RTSP server code derives from live555 - http://www.live555.com/ and from the archive rtsp2303_srcbin_20170414-1630.zip posted in the link above.\n\n### RTSP audio support (many thanks to @PieVo for adding it)\nThe datapath of the audio is as follows:\nMic -\u003e ADC -\u003e Kernel sound driver -\u003e TinyAlsa lib -\u003e OMX ALSA plugin -\u003e Camera application (rmm)\n\nTo maintain audio support for the original Yi application, the audio should be cloned at one of the steps with the following in mind:\n- Kernel driver can be used by 1 \"sink\"\n- TinyAlsa can only openend by one \"sink\"\n- OMX libs are closed source and are not compatible with the \"available\" I1 SDK.\n\nAudio support is implemented by replacing the original TinyAlsa library with a version that copies the read audio frames to a pipe. This pipe is read by the RTSP server. The RTSP server uses a patched WAVFileSource to read the audio data from the pipe. (Since it tries to read the WAV header 2x I saw no (quick) other way than to hardcode the PCM format into the WAVFileSource code.)\n\nAdditionally:\n- The OMX ALSA library reads audio in 16-bit 16000Hz stereo, one channel is just empty. To reduce streaming bandwidth the TinyAlsa replacement library converts the stereo data to mono.\n- To reduce streaming bandwidth even further, the 16-bit PCM data is converted to 8-bit uLaw and finally results in 128kbit/s.\n\n## Performance\nThe performance of the cam is not so good (CPU, RAM, etc...).\nIf you enable all the services you may have some problems.\nFor example, enabling both rtsp streams is not recommended.\nDisable cloud is recommended to save resources.\n\n## Supported cameras\nCurrently this project supports only the following cameras:\n\n| Camera | Firmware | File prefix | Remarks |\n| --- | --- | --- | --- |\n| **Yi 1080p Home 4FUS** | 4.5.0* | y203c | - |\n| **Yi 1080p Home 6FUS** | 4.5.0* | y203c | - |\n| **Yi 1080p Home 9FUS** | 4.5.0* | y203c | - |\n| **Yi 1080p Home BFUS** | 4.5.0* | y203c | - |\n| **Yi 1080p Dome 6FUS** | 4.6.0* | h201c | Thanks to @skylarhays |\n| **Yi 1080p Dome BFUS** | 4.6.0* | h201c | Thanks to @skylarhays |\n| **Yi 1080p Dome 4FCN** | 4.6.0* | h201c | - |\n| **Yi 1080p Home 4FUS** | 4.2.0* | y25 | - |\n| **Yi 1080p Home 9FUS** | 4.2.0* | y25 | - |\n| **XiaoYi Camera Y3 9FCN**| 4.2.0* | y25 | - |\n| **Yi 1080p Home 6FUS** | 2.1.0* | y23 | - |\n| **Yi 1080p Home 6FCN** | unknown | y203c | - |\n| **Yi 1080p Home 4FCN** | unknown | y23 | - |\n| **YI Dome Camera X** | 4.0.0* | y30 | Experimental |\n| **YI Home Camera H7** | 4.4.0* | h307 | Experimental |\n| **ieGeek IE80** | 8.0.0* | h305r | Experimental |\n\n\nThis firmware completely overwrite the original firmware.\nSo, USE AT YOUR OWN RISK.\n\n**Do not try to use a fw on an unlisted model**\n\n**Do not try to force the fw loading renaming the files**\n\n## Is my cam supported?\nIf you want to know if your cam is supported, please check the serial number (first 4 letters) and the firmware version.\nIf both numbers appear in the same row in the table above, your cam is supported.\nIf not, check the other projects related to Yi cams:\n- https://github.com/TheCrypt0/yi-hack-v4 and previous\n- https://github.com/roleoroleo/yi-hack-Allwinner\n- https://github.com/roleoroleo/yi-hack-Allwinner-v2\n\n## Home Assistant integration\nAre you using Home Assistant? Do you want to integrate your cam? Try these custom integrations:\n- https://github.com/roleoroleo/yi-hack_ha_integration\n- https://github.com/AlexxIT/WebRTC\n\nYou can also use the [web services](https://github.com/roleoroleo/yi-hack-MStar/wiki/Web-services-description) in Home Assistant -- here's one way to do that. (This example requires the nanotts optional utility to be installed on the camera.) Set up a rest_command in your configuration.yaml to call one of the [web services](https://github.com/roleoroleo/yi-hack-MStar/wiki/Web-services-description). \n```\nrest_command:\n  camera_announce:\n    url: http://[camera address]/cgi-bin/speak.sh?lang={{language}}\u0026voldb={{volume}}\n    method: POST\n    payload: \"{{message}}\"\n```\nCreate an automation and use yaml in the action to send data to the web service. \n```\nservice: rest_command.camera_announce\ndata:\n  language: en-US\n  message: \"All your base are belong to us.\"\n  volume: '-8'\n``` \n\n## Build your own firmware\nIf you want to build your own firmware, clone this git and compile using a linux machine.\nQuick explanation:\n- Download and install the SDK for MStar platform: the file name is \"MStar MSC3XX SDK.zip\" (Google is your friend).\n- Prepare the system installing all the necessary packages.\n- Or you can use the following docker image https://hub.docker.com/r/borodiliz/yi-hack (thanks to@ borodiliz).\n- Copy original home and rootfs partition files to ./stock_firmware/... (don't ask me where to find them).\n- git submodule update --init\n- ./scripts/init_sysroot.all.sh\n- ./scripts/compile.sh\n- ./scripts/pack_fw.all.sh\n\n### Dev tips\n- If you kill the \"rmm\" process, the watchdog will reset the camera. This can be prevented by kicking it yourself in a seperate shell: while [ 1 ] ; do sleep 1; echo .; echo V \u003e /dev/watchdog; done\n- The \"rmm\" process can be started with a different set of OMX Libraries by setting environment variables OMX_LIB_PATH and LD_LIBRARY_PATH. That way you dont have to overwrite the original files and possibly brick the system. For instance: OMX_LIB_PATH=/tmp/sd/test/ms LD_LIBRARY_PATH=/home/lib:/lib:/usr/lib:/usr/local/lib:/tmp/sd/test/ms:/home/app/locallib /home/app/rmm\n- The I1 SDK is not compatible with this camera. When using the OMX libraries from the system with the headers from the SDK, most applications end up with a \"Floating point exception\". Possibly the headers do not match the libraries or one of the kernel interfaces.\n\n## Unbricking\nIf your camera doesn't start repeat the hack as described above (with a lower/higher version) .\nYou can use the same procedure even if you have a backup copy of the original partitions.\nIf the bootloader works correctly the camera will restart.\n\n----\n\n## License\n[GPLv3](https://choosealicense.com/licenses/gpl-3.0/)\n\n## Acknowledgments\nSpecial thanks to the following people for the previous projects I started from.\n- @TheCrypt0 - [https://github.com/TheCrypt0/yi-hack-v4](https://github.com/TheCrypt0/yi-hack-v4)\n- @andy2301 - [Ideas for the RTSP](https://github.com/xmflsct/yi-hack-1080p/issues/5#issuecomment-298093437)\n- All the people who worked on the previous projects \"yi-hack\".\n\n## DISCLAIMER\n**NOBODY BUT YOU IS RESPONSIBLE FOR ANY USE OR DAMAGE THIS SOFTWARE MAY CAUSE. THIS IS INTENDED FOR EDUCATIONAL PURPOSES ONLY. USE AT YOUR OWN RISK.**\n\n## Donation\nIf you like this project, you can buy roleo a beer :)\n\nClick [here](https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=JBYXDMR24FW7U\u0026currency_code=EUR\u0026source=url) or use the below QR code to donate via PayPal\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/roleoroleo/yi-hack-MStar/assets/39277388/35b9db58-4013-4bf9-845c-2028a769662d\"/\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froleoroleo%2Fyi-hack-MStar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froleoroleo%2Fyi-hack-MStar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froleoroleo%2Fyi-hack-MStar/lists"}