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

GHLocalApi to configure a Chromecast With Google TV (gen4) #132

Open
Cyanatide opened this issue Dec 7, 2023 · 1 comment
Open

GHLocalApi to configure a Chromecast With Google TV (gen4) #132

Cyanatide opened this issue Dec 7, 2023 · 1 comment
Labels

Comments

@Cyanatide
Copy link

Hi!
I'm trying to use GHLocalApi (with help of interfect/castanet.sh) to deploy a Chromecast With Google TV (gen4).

It seems on CCwGTV, some API have changed. Here is my feedback:

  • API refuse connection (in ethernet) while your are on the first screen asking to pair your remote witht the CCwGTV. Hotspot is not enabled while on this page
  • eureka_info doesn't provide anymore public key:
    {"name":"Chromecast3943","net":{"ethernet_connected":true,"ip_address":"192.168.3.10","online":true},"setup":{"setup_state":63,"ssid_suffix":"ytb","tos_accepted":true},"
  • I managed to get the public key (I hope it's the good one) using openssl has follow:
    openssl s_client -showcerts -connect SERVER_IP:6467 </dev/null 2>/dev/null|openssl x509 -outform PEM > server.pem
  • I refactor this response to encrypt public key with this command:
ENCRYPTED_KEY="$(nodejs <<EOF
let crypto = require('crypto');
let cleartext = "${WIFI_PASSWORD}";
let publicKey = "${CHROMECAST_PUBKEY}";
publicKey = "-----BEGIN CERTIFICATE-----\n"+publicKey+"\n-----END CERTIFICATE-----"
const encryptedData = crypto.publicEncrypt({
  key: publicKey,
  padding: crypto.constants.RSA_PKCS1_PADDING,
  // This was in the original thorleifjaocbsen code but seems nonsensical/unneeded and upsest some Nodes
  //oaepHash: "sha256",
}, Buffer.from(cleartext));
console.log(encryptedData.toString("base64"));
EOF
)"
  • scan_wifi and scan_results seems to work as exepected
  • However, connect_wifi seems to have no effect on my CCwGTV, there is no return to my curl, save_wifi repond a strange "Default Response":

Here is my CONNECT_COMMAND:

{"ssid": "TestWifi", "wpa_auth": 7, "wpa_cipher": 4, "enc_passwd": "RNJr53ag7xZZ/53JW8crYz9lKv2hhtIBTaZgt1qB7LvGg65nMv9wi23LIzlSmHGUVutPBbMTyByoiqwoEZD/cmcoiqrQ62bGr4RY+ofyBVcgq1RJikgFehBy3+Ad2qwnKrDjeb7K0hi3cNLT1iu9fjn79MdT/qoMaKrADvzjbgmevuz5l15gc0XGjMZnzIBT+C7jNxS2UnjR+E/YP0fecACKKXxd0R1njK0cbV/tZLJgetwEnhfaLIs2vgY5Ka0DnkTm46xjaKxJtmid1OX3DaP7PbpFaS/6YmtRnhjxjxZI9Jjnlpws6dALAmyBL8z7RrNZqghFa0MYUbvzHtJYFA=="}

Call
curl ${VERBOSITY} --insecure --tlsv1.2 --tls-max 1.2 -H "content-type: application/json" -d "${CONNECT_COMMAND}" https://${CHROMECAST_IP}:8443/setup/connect_wifi respond with a {}
Call Call
curl ${VERBOSITY} --insecure --tlsv1.2 --tls-max 1.2 -H "content-type: application/json" -d "${SAVE_COMMAND}" https://${CHROMECAST_IP}:8443/setup/save_wifi respond with a Default Response
But for sure, my CCwGTV is not connected to my wifi.
Any idea of what's wrong here? Is someone aware of changes in the API?
Thanks!

Copy link

stale bot commented Jan 7, 2024

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.

@stale stale bot added the stale label Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant