{"id":28138927,"url":"https://github.com/cavefire/cn360-proxy","last_synced_at":"2025-05-14T17:18:36.459Z","repository":{"id":289904207,"uuid":"972761138","full_name":"cavefire/cn360-proxy","owner":"cavefire","description":"Local control proxy for 360 / Qihoo Vacuum Robots","archived":false,"fork":false,"pushed_at":"2025-04-25T16:36:54.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-25T17:47:09.150Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cavefire.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-04-25T16:05:59.000Z","updated_at":"2025-04-25T16:36:58.000Z","dependencies_parsed_at":"2025-04-25T17:47:13.334Z","dependency_job_id":"c7debfdd-0ae0-43c9-8242-4979bac52bad","html_url":"https://github.com/cavefire/cn360-proxy","commit_stats":null,"previous_names":["cavefire/cn360-proxy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cavefire%2Fcn360-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cavefire%2Fcn360-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cavefire%2Fcn360-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cavefire%2Fcn360-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cavefire","download_url":"https://codeload.github.com/cavefire/cn360-proxy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254190411,"owners_count":22029639,"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":[],"created_at":"2025-05-14T17:15:30.358Z","updated_at":"2025-05-14T17:18:36.446Z","avatar_url":"https://github.com/cavefire.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 360 / Qihoo / Botslab 360 Vacuum Robot Proxy\n\nThis tool provides a proxy for your vacuum robot, enabling local control without roundtrips to China.\nIt does not disable the app.\n\n### Tested Devices\n- 360 S9\n\nOther devices may also work, but they have not been tested.\n\n---\n\n## Installation\n\n```bash\ngit clone https://github.com/cavefire/cn360-proxy.git\ncd cn360-proxy \n```\n\nNow edit the \"docker-compose.yml\" file with your editor of choice.\nAll variables you have to modify have been marked with a \"!\" as well as a description of their function.\n\nThen you can start the container with \n```bash\ndocker compose up -d\n```\n\nAfter that you will have to forward all traffic from the robot through your server. That can be done in your router by configuring a custom route. \n\nOtherwise you can create a VLAN and set your server's ip as the default gateway. In that case your server must be in the same VLAN (at least one interface).\nWhen thats done, create iptables rules like this:\n\n```bash\nsysctl -w net.ipv4.ip_forward=1 \u003e/dev/null\n\niptables -t nat -A POSTROUTING -s \"$ROBOT_IP\" -o \"$INTF\" -j MASQUERADE\niptables -t nat -A PREROUTING -s \"$ROBOT_IP\" -p tcp --dport 80  -j REDIRECT --to-port \"$PROXY_PORT\"\niptables -t nat -A PREROUTING -s \"$ROBOT_IP\" -p tcp --dport 443 -j REDIRECT --to-port \"$PROXY_PORT\"\n```\nwhere ...\n- $INTF is your interface (e.g. eth0 - in the VLAN of your robot)\n- $ROBOT_IP is the ip of your robot (reserve an ip in your dhcp / router for your robot)\n- $PROXY_PORT is the port of your proxy from the `docker-compose.yml` file\n\nYou can then save the configuration with `iptables-save \u003e /etc/iptables/rules.v4`\n\nNow make sure you restart your robot. Do it like this:\n1. Remove it from the charging dock\n2. Use something pointy to press the reset button (open the top cover, on the right side of the buttons)\n3. Wait approximately one minute\n4. Press and hold the power button for around 5-10 seconds, until you hear a sound.\n\nNow enter `docker compose logs -f --tail 10` in your server's console. You should see a message, that the robot is connected. If not, check all your routing.\nThe WiFi-LED of the robot should be on constantly. If it is flashing, it is not connected to the cloud server. Again, check your routing.\n\n## How does it work?\nAll tcp traffic from your robot is routed through your server now. Therefor we have access to all the traffic of the robot and can intercept it.\n\nFirst the robot is fetching a ip and port of the control server of Qihoo. The response is modified to point towards your server and your server opens the connection to the real server.\nThe robot then connects to your server, which relays all messages from Qihoo's server to your robot and the other way around. But we now have a way to send our own commands to the robot.\n\nSince the commands are encrypted, the proxy also catches the registration of the robot in the cloud and saves the encryption key. This key is stored in the file \"pushkey.txt\" and wil change on every reboot of the robot. The proxy will save it every time it sees a new key.\n\nThe robot does not send its status via the server. It does make https requests instead. These are even easier to capture and forward to the local control server.\n\n## Interfacing with the local control server\n\n- Open a connection with the server (port is configured in `docker-compose.yml`)\n- Wait for messages\n      The first 2 bytes of each message are 0x1616 as the magic, followed by 2 bytes defining the payload length. After that the payload is in json format, as it comes from the robot\n- To send a command to the robot, just send a json request. No header or trailer needed.\n\n## Contributing\nThis project is a work in progress, and contributions are welcome!\nIf you encounter issues, have feature requests, or want to contribute, feel free to submit a pull request or open an issue.\n\n## Disclaimer\nThis project is not affiliated with Qihoo 360 Technology Co. Ltd. The API and all functions are reverse-engineered and may break at any time. Use at your own risk.\n\n**To the Qihoo 360 legal team:**\nI found out all the functions with my own device and did not use any copyright-protected data. This activity is legally protected in Germany.\nHowever, if there are any concerns, we will surely find a way to mitigate them together.\n\n## License\nThis project is licensed under GNU GPLv3 - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcavefire%2Fcn360-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcavefire%2Fcn360-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcavefire%2Fcn360-proxy/lists"}