You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HI,
using your work.
I wrote a translation in php which I think is easier to read and easier to encode the wifi passphrase
There is some little changes because it's for GoogleTV.
Unfortunately I must miss something with googleTV.
Maybe the mandatory connection to a google account.
Because after using this script I'm connected to the SSID (I Can see the device listed on the right SSID in my WIFI controller, with an IP in the range)
BUt then screen remains on "CONNECTED" and if I reboot I lost all the setup.
Any ideas ? anyone who wants to work on this ?
`<?php
// Set your Chromecast's IP, WiFi SSID, and WiFi Password
$CHROMECAST_IP = "192.168.XXX.XXX";
$WIFI_SSID = "XXX";
$WIFI_PASSWORD = "XXX";
$VERBOSITY = "-vvv";
echo "Connecting $CHROMECAST_IP to $WIFI_SSID with password $WIFI_PASSWORD\n";
// Get the device's public key
$info_json = shell_exec("curl $VERBOSITY --insecure --tlsv1.2 --tls-max 1.2 https://$CHROMECAST_IP:8443/setup/eureka_info?params=version,audio,name,build_info,detail,device_info,net,wifi,setup,settings,opt_in,opencast,multizone,proxy,night_mode_params,user_eq,room_equalizer,sign,aogh,ultrasound,mesh");
$info_dict = json_decode($info_json, true);
// Scan for and find the network we want to get the encryption parameters
shell_exec("curl $VERBOSITY --insecure --tlsv1.2 --tls-max 1.2 -X POST https://$CHROMECAST_IP:8443/setup/scan_wifi");
sleep(20);
$wifi_json = shell_exec("curl $VERBOSITY --insecure --tlsv1.2 --tls-max 1.2 https://$CHROMECAST_IP:8443/setup/scan_results");
$wifi_networks = json_decode($wifi_json, true);
foreach ($wifi_networks as $wifi_network) {
if ($wifi_network["ssid"] == $WIFI_SSID) {
$WIFI_AUTH_NUMBER = $wifi_network["wpa_auth"];
$WIFI_CIPHER_NUMBER = $wifi_network["wpa_cipher"];
break;
}
}
// Encrypt the password to the device
$public_key = "-----BEGIN RSA PUBLIC KEY-----\n" . $CHROMECAST_PUBKEY . "\n-----END RSA PUBLIC KEY-----";
openssl_public_encrypt($WIFI_PASSWORD, $encrypted_data, $public_key, OPENSSL_PKCS1_PADDING);
$ENCRYPTED_KEY = base64_encode($encrypted_data);
Hi all and forget to mention to thank you for all this work.
Does anyone managed to configure a googleTV (ccwgtv) using scripts ?
If someone is working on itn I would be happy to help.
Allready been in the HOME app and check the http requests sent to CHromecast but cannot figure everything yet.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
HI,
using your work.
I wrote a translation in php which I think is easier to read and easier to encode the wifi passphrase
There is some little changes because it's for GoogleTV.
Unfortunately I must miss something with googleTV.
Maybe the mandatory connection to a google account.
Because after using this script I'm connected to the SSID (I Can see the device listed on the right SSID in my WIFI controller, with an IP in the range)
BUt then screen remains on "CONNECTED" and if I reboot I lost all the setup.
Any ideas ? anyone who wants to work on this ?
`<?php
// Set your Chromecast's IP, WiFi SSID, and WiFi Password
$CHROMECAST_IP = "192.168.XXX.XXX";
$WIFI_SSID = "XXX";
$WIFI_PASSWORD = "XXX";
$VERBOSITY = "-vvv";
echo "Connecting $CHROMECAST_IP to $WIFI_SSID with password $WIFI_PASSWORD\n";
// Get the device's public key
$info_json = shell_exec("curl $VERBOSITY --insecure --tlsv1.2 --tls-max 1.2 https://$CHROMECAST_IP:8443/setup/eureka_info?params=version,audio,name,build_info,detail,device_info,net,wifi,setup,settings,opt_in,opencast,multizone,proxy,night_mode_params,user_eq,room_equalizer,sign,aogh,ultrasound,mesh");
$info_dict = json_decode($info_json, true);
$CHROMECAST_PUBKEY = $info_dict["device_info"]["public_key"];
// Scan for and find the network we want to get the encryption parameters
shell_exec("curl $VERBOSITY --insecure --tlsv1.2 --tls-max 1.2 -X POST https://$CHROMECAST_IP:8443/setup/scan_wifi");
sleep(20);
$wifi_json = shell_exec("curl $VERBOSITY --insecure --tlsv1.2 --tls-max 1.2 https://$CHROMECAST_IP:8443/setup/scan_results");
$wifi_networks = json_decode($wifi_json, true);
foreach ($wifi_networks as $wifi_network) {
if ($wifi_network["ssid"] == $WIFI_SSID) {
$WIFI_AUTH_NUMBER = $wifi_network["wpa_auth"];
$WIFI_CIPHER_NUMBER = $wifi_network["wpa_cipher"];
break;
}
}
// Encrypt the password to the device
$public_key = "-----BEGIN RSA PUBLIC KEY-----\n" . $CHROMECAST_PUBKEY . "\n-----END RSA PUBLIC KEY-----";
openssl_public_encrypt($WIFI_PASSWORD, $encrypted_data, $public_key, OPENSSL_PKCS1_PADDING);
$ENCRYPTED_KEY = base64_encode($encrypted_data);
// Generate the command to connect
$CONNECT_COMMAND = json_encode([
"ssid" => $WIFI_SSID,
"wpa_auth" => $WIFI_AUTH_NUMBER,
"wpa_cipher" => $WIFI_CIPHER_NUMBER,
"enc_passwd" => $ENCRYPTED_KEY
]);
// And the command to save the connection
$SAVE_COMMAND = json_encode([
"keep_hotspot_until_connected" => true
]);
// Send the commands
shell_exec("curl $VERBOSITY --insecure --tlsv1.2 --tls-max 1.2 -H 'content-type: application/json' -d '$CONNECT_COMMAND' https://$CHROMECAST_IP:8443/setup/connect_wifi");
shell_exec("curl $VERBOSITY --insecure --tlsv1.2 --tls-max 1.2 -H 'content-type: application/json' -d '$SAVE_COMMAND' https://$CHROMECAST_IP:8443/setup/save_wifi");
$info_json = shell_exec("curl $VERBOSITY --insecure --tlsv1.2 --tls-max 1.2 -H 'content-type: application/json' -d '{"name": "Living room"}' https://$CHROMECAST_IP:8443/setup/set_eureka_info");
echo "Chromecast connected to WiFi.\n";
?>
`
The text was updated successfully, but these errors were encountered: