{"id":1584,"date":"2016-09-19T03:55:29","date_gmt":"2016-09-18T19:55:29","guid":{"rendered":"http:\/\/www.computersolutions.cn\/blog\/?p=1584"},"modified":"2016-09-19T04:09:53","modified_gmt":"2016-09-18T20:09:53","slug":"xiaomi-camera-bs-region-locking-fix","status":"publish","type":"post","link":"https:\/\/www.computersolutions.cn\/blog\/2016\/09\/xiaomi-camera-bs-region-locking-fix\/","title":{"rendered":"XiaoMi Camera BS region locking fix"},"content":{"rendered":"<p>\u5c0f\u7c73 sells a small little wifi camera which works quite painlessly.<br \/>\nI&#8217;ve bought several over the last few years.<\/p>\n<p>My recent ones don&#8217;t work oversea&#8217;s though (which is where I install them).<br \/>\nIts extremely bogus selling equipment that is limited to a country, especially when they don&#8217;t tell you about it.<\/p>\n<p>Annoying, as my older models aren&#8217;t &#8220;region locked&#8221;, but the newer ones are.<\/p>\n<p>There is a fix for it, although it will likely get more difficult to patch at xiaomi&#8217;s whim.<br \/>\nIf so, I&#8217;ll probably stop buying the camera&#8217;s.  Lovely how vendors want to mess with customers&#8230;<\/p>\n<p>&#8212;<\/p>\n<p>First up, enable telnet on the camera.<br \/>\nGet an SD card or take the card out of the camera.<\/p>\n<p>Create a folder named test on the card.<br \/>\nCreate a plain text file called equip_test.sh in that folder, and add the following bash script:<\/p>\n<p><code><br \/>\n#!\/bin\/sh<br \/>\n# Telnet<br \/>\nif [ ! -f \"\/etc\/init.d\/S88telnet\" ]; then<br \/>\necho \"#!\/bin\/sh\" > \/etc\/init.d\/S88telnet<br \/>\necho \"telnetd &\" >> \/etc\/init.d\/S88telnet<br \/>\nchmod 755 \/etc\/init.d\/S88telnet<br \/>\nfi<br \/>\ndr=`dirname $0`<br \/>\n# fix bootcycle<br \/>\nmv $dr\/equip_test.sh $dr\/equip_test.sh.moved<br \/>\nreboot<\/code><\/p>\n<p>The script will enable telnet on the camera, and then rename the script so it doesn&#8217;t run again on the next boot.<\/p>\n<p>Stick the prepared card into the camera, power on, and it should reboot (twice).<br \/>\nIf you check the open ports on the camera ip you should now see port 23 (telnet) is open.<\/p>\n<p>Login with the default user\/pass (as below) via telnet<\/p>\n<p><code>User: root<br \/>\nPassword: 1234qwer<br \/>\n<\/code><\/p>\n<p>Once telnet&#8217;d in, enter the following, line by line &#8211; <\/p>\n<p>Find and kill the watchdog process<br \/>\n<code><br \/>\n killall watch_process<br \/>\n<\/code><\/p>\n<p>Find and kill \/home\/cloud process so we can edit it without the watchdog watch_process restarting it<br \/>\n<code><br \/>\n killall cloud<br \/>\n<\/code> <\/p>\n<p>Change the check within \/home\/cloud executable to query a fake domain so it never returns a failure, then reboot.<\/p>\n<p><code><br \/>\n sed -i  's|api.xiaoyi.com\/v4\/ipc\/check_did|api.xiaoyi.foo\/v4\/ipc\/check_did|g' \/home\/cloud<br \/>\n reboot<br \/>\n<\/code><\/p>\n<p>Notes &#8211; The camera checks for the country by running an executable called \/home\/cloud<br \/>\nThis calls an api at api.xiaoyi.com which does a ip check, then returns a true or false value if it thinks you&#8217;re in China or not.  We change the \/home\/cloud executable ip check call to a bad url, which means it can&#8217;t perform its check.<\/p>\n<p>Worked on my camera&#8217;s running version 1.8.6.1Q_201607271501<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5c0f\u7c73 sells a small little wifi camera which works quite painlessly. I&#8217;ve bought several over the last few years. My recent ones don&#8217;t work oversea&#8217;s though (which is where I install them). Its extremely bogus selling equipment that is limited to a country, especially when they don&#8217;t tell you about it. Annoying, as my older [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[282,25],"tags":[546,545,544,543],"class_list":["post-1584","post","type-post","status-publish","format-standard","hentry","category-firmware-2","category-technical-mumbo-jumbo","tag-bullshit","tag-region-locking","tag-yicam","tag-543"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts\/1584","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/comments?post=1584"}],"version-history":[{"count":3,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts\/1584\/revisions"}],"predecessor-version":[{"id":1587,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts\/1584\/revisions\/1587"}],"wp:attachment":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/media?parent=1584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/categories?post=1584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/tags?post=1584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}