Reboot a Chromecast

我怕爱的太早我们不能终老 提交于 2020-07-07 11:30:48

问题


How can I, using the Cast SDK or otherwise, have my app trigger a Chromecast reboot, in the manner of the official Chromecast app?

In the case of 'otherwise', is Google Play likely to look unkindly on this approach?


回答1:


There is no API in the SDK to reboot a Cast device and frankly, it is scary to me that you would want to do that programmatically. What is the reason you would want to do that?




回答2:


You definitely should be able to. It's just a HTTP post after all. This from pychromecast

CC_SESSION.post(FORMAT_BASE_URL.format(host) + "/setup/reboot", data='{"params":"now"}', timeout=10)

That might point you in the right direction.




回答3:


Following on the answer from davewasthere (thanks!), I found that I can reboot a Chromecast by performing the following command from Linux prompt:

curl -Lv -H Content-Type:application/json \
--data-raw '{"params":"now"}' \
http://10.10.2.49:8008/setup/reboot

Some other useful DIAL commands




回答4:


A recent firmware update seems to have disabled the HTTP endpoint on port 8008 (HTTP/1.1 403 Forbidden) so the solution posted by norganna does not work any longer.

Working alternative is the HTTPS endpoint on port 8443:

curl -Lv --insecure -H Content-Type:application/json --data-raw '{"params":"now"}' https://10.10.2.49:8443/setup/reboot


来源:https://stackoverflow.com/questions/31385469/reboot-a-chromecast

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!