louis49 / androidtv-remote

MIT License
68 stars 23 forks source link

Connection times out on tv shutoff #20

Closed zerbzman closed 2 years ago

zerbzman commented 2 years ago

Hey,

Is there something I'm missing or something I need to turn on so the connection doesn't close and time out when I turn off the TV. I'm not able to turn on the TV via this protocol.

piyush2greedy commented 2 years ago

@zerbzman what is code u r using nodejs or android.

zerbzman commented 2 years ago

node

louis49 commented 2 years ago

You need to turn off deep sleep on your androidtv settings

zerbzman commented 2 years ago

I have tried to using Wakelock but that doesn't seem to work anymore. Do you know of a way to prevent deep sleep?

louis49 commented 2 years ago

It's in AndroidTV parameters - it could be different between devices

zerbzman commented 1 year ago

Ok, I found an option that wakes the TV periodically to look for casting devices.

The tv will connect to my app and authenticate but the power on command doesn't work. I have tried sending it right after authentication but it doesn't work. Any thoughts?

zerbzman commented 1 year ago

OK! Here is what worked for me.

  1. Make sure that Networked Standby is turned on in the settings
    • Go to Settings -> Network & Internet -> Networked Standby
  2. Turn ON the TV by sending 1 Wake On Lan packet and then another at least 3 seconds after.

I have to do more testing to see if this still works to turn on the TV a day later.