Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reboot Chromecast Device #131

Open
testcu opened this issue Mar 16, 2022 · 9 comments
Open

Reboot Chromecast Device #131

testcu opened this issue Mar 16, 2022 · 9 comments

Comments

@testcu
Copy link

testcu commented Mar 16, 2022

It would be nice to be able to force a Chromecast Device to reboot (not by power off/on).

The following command should work, but needs the current ‘cast-local-authorization-token’ header / value.
curl -Lv -k -H Content-Type:application/json https://192.168.5.74:8443/setup/reboot -d "{""params"":""now""}"

If you have the Auth Token available, would you please add the Reset Device Function?

Thank you!

@vishen
Copy link
Owner

vishen commented Mar 16, 2022

This would be a cool feature. I don't think we currently have a way to talk to that API, we currently talk to the api on port :8009 (default port). Would be happy to add this if we can work out a way to get the auth token, do you know a good way to retrieve it?

@testcu
Copy link
Author

testcu commented Mar 16, 2022 via email

@vishen
Copy link
Owner

vishen commented Mar 18, 2022

I started down the path to get the auth token, but with my limited tool set- it was a manual process and the token expires.

How were you able to get the auth token? I am a little unsure how to get the auth token, and those code-snippets tend to want a username + password, are these a default username + password or is this something different for each chromecast?

@testcu
Copy link
Author

testcu commented Mar 18, 2022 via email

@vishen
Copy link
Owner

vishen commented Mar 18, 2022

Thanks! I'll have a look when I get a chance :)

@Cyber5imon
Copy link

I've 'been looking for ways to control my 1st gen Chromecast via command line and just stumbled across your project. Very impressive! You have created the most robust command set I've seen yet in a Chromecast CLI!

Here's my little contribution...
You can reboot a chromecast through a simple http request:
curl -Lv -H Content-Type:application/json http://192.168.22.99:8008/setup/reboot -d "{""params"":""now""}"

Don't fell bad. Many times, when you get very involved with a project, you naturally start making more and more complex functions. It's very easy to miss simple solutions once in a while after creating such a large application. That's why it's always a great idea to get a fresh set of eyes on the project once in a while. New blood can bring new perspectives and many times find a completely different way to accomplish something.

Anyway, that's my $0.02 worth of advice. I hope to provide some more assistance as I have time, and will fork the project at some point in the future to help with issues and new functionss.

Thank you for all your hard work and creating such a wonder Chromecast CLI!

@Cyber5imon
Copy link

This may also come in handy. To do a factory reset use;
curl -Lv -H Content-Type: application/json http://192.168.22.99:8008/setup/reboot -d ‘{“params”:”fdr”}’ -X POST

@joeyparrish
Copy link

@Cyber5imon wrote:

I've 'been looking for ways to control my 1st gen Chromecast via command line and just stumbled across your project. Very impressive! You have created the most robust command set I've seen yet in a Chromecast CLI!

Here's my little contribution... You can reboot a chromecast through a simple http request: curl -Lv -H Content-Type:application/json http://192.168.22.99:8008/setup/reboot -d "{""params"":""now""}"

Sadly, that only works on 1st gen Chromecast, and doesn't work on newer Chromecast models:

$ curl -Lv -H Content-Type:application/json http://192.0.0.42:8008/setup/reboot -d "{""params"":""now""}"
*   Trying 172.31.187.218:8008...
* Connected to 192.0.0.42 (192.0.0.42) port 8008 (#0)
> POST /setup/reboot HTTP/1.1
> Host: 192.0.0.42:8008
> User-Agent: curl/7.81.0
> Accept: */*
> Content-Type:application/json
> Content-Length: 12
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 403 Forbidden
< Content-Length:0
< 
* Connection #0 to host 192.0.0.42 left intact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants