ADB server fails to reconnect when Android TV Turned Off/On

I realize my question might be better suited for a Raspbian forum, but it supports my Hassio installation, so am hoping someone here can point me in the right direction.

When Hassbian lost support, I manually installed Hassio on a Raspbian image. I want Hassio to be able to connect to my Android TV. I need an ADB server to do so, but can’t use the Hassio docker add on, so manually installed an ADB server on Raspbian.

When I issue the command:

adb connect 192.168.XXX.XXX

it connects fine and continues to work.

However, when I turn the TV off, the ADB server loses its connection. It doesn’t re-connect when the TV turns back on until I issue the connect command again.

Any tips? Is there a configuration file I should be modifying or another way to force it to re-connect automatically?

Thanks,
Scott

I have the same issue. Did you find any solution?

I did find a solution! Unfortunately, though, it’s been so long that I forget what I changed to make it work.

I’ve copied my current configuration settings below, in case that helps you figure out what’s different. I also checked and I don’t have an ADB server service running. When I run the ADB command through SSH, it says it’s starting a server, which seems to confirm that.

I checked my python installed packages and see I added a package called ‘adb-shell’, which is on version 0.3.1, so that might be how I fixed it?? If so, you’d install it through these types of Instructions with a command (inside the virtual environment) like:

pip --install adb-shell

Here’s my configuration:

media_player:
  - platform: androidtv
    name: "Smart TV"
    host: 192.168.X.YYY
    device_class: androidtv
    adbkey: "/home/homeassistant/.homeassistant/.storage/androidtv_adbkey"

Hope this helps,
Scott