Home Assistant Community Add-on: ADB - Android Debug Bridge

same issue here. it stopped working after updating ADB addon.
I have the same error log

I have the same issue. After updating the add-on, I got the same error message. Both devices, my Nvidia Shield as well as the Amazon Fire TV are not available anymore.

:tada: Release v0.4.1

Full Changelog

This release fixes an issue with the Android Debug Bridge crashing on start (mainly ARMv7/Raspberry Pi).
It does this by downgrading the adb package since there is no workaround available.
No functionality is lost by this downgrade from the perspective of this add-on.

:hammer: Changes

  • :ambulance: :arrow_down: Downgrades adb to 7.0.0+r33-2 (#12)

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work: https://patreon.com/frenck

2 Likes

Thanks @frenck for very quick fix.
Hope people know snapshots, usually there is always possibility to roll back addon, however always remember or setup automation :wink: to make snapshot before upgrade.
As a noob I learnt that hard way but now I am smart :wink:

How to automate backup before update of any addon as well as homeassistant?
Guide
Thanks

@kirpat Guide please? Would be nicer but anyway, here it is my approach:

  1. I am not doing update immediately, if everything what I need is working I can not see need for rush.
  2. One per week I am checking what is new, read realise notes and decide do/ not do update.
  3. If I am going to update I am checking do I have recent backup if yes I am doing upgrade, one component at time.
    All usually is taking half an hour or so.

After upgrade checking if everything’s working. If yes I have week off ;-).

Reason for this is … WAF on my automation, if I screw thing up as sometimes happen as this platform is still in development (they are doing fantastic jon but shit happens sometimes), my lovely wife has a point as he can’t turn on light in the kitchen ;-).

So not so much automation per se, however I you want to learn co to Configuration/Automation and set up snapshot automation elements are there ready to use, just a bit of reading.

Cheers

Is this still needed? I had the addon working, but since officially added, it stopped working.

Log of Hassio gives the following error

RuntimeError: ERROR: ‘FAIL’ 00a7device unauthorized.
This adb server’s $ADB_VENDOR_KEYS is not set

and also

‘Service media_player.androidtv_key not found’

the adb android debug bridge has the following in the log:

Add-on version: 0.4.1
You are running the latest version of this add-on.
System: HassOS 2.11 (armv7 / raspberrypi3)
Home Assistant version: 0.92.2
Supervisor version: 162

Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing…
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] adb.sh: executing…
[cont-init.d] adb.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[21:40:21] INFO: Starting the Android Debug Bridge server…
[21:40:21] INFO: Connecting to device: 192.168.1.205…
connected to 192.168.1.205:5555
[21:41:54] INFO: Connecting to device: 192.168.1.205…
already connected to 192.168.1.205:5555

I’m not getting any notification on the shield, can’t remember if I did get it the first time I installed it.

What can be wrong?

Turned the developer mode off and on, and now the promt appeared!

2 Likes

Anyone having trouble with the “apps” appearing in the UI? None of the apps I specify are showing up. Everything else appears functional though. No errors in the logs.

Hass.io v0.92.2
Android Debug Bridge v0.4.1

relevant configuration.yaml section:

media_player:
  - platform: androidtv
    name: Bravia TV
    host: 192.168.254.45
    adb_server_ip: 127.0.0.1
    apps:
      com.netflix.ninja: "Netflix"
      com.hulu.livingroomplus: "Hulu"
      com.google.android.youtube.tvunplugged: "Youtube TV"
      com.google.android.youtube.tv: "Youtube"

ADB config:

{
  "devices": [
    "192.168.254.45"
  ],
  "reconnect_timeout": 90,
  "log_level": "debug"
}

Go to the States page and check the app_id attribute. Does it match one of the app ID’s in your config?

Hmm I don’t see anything with an app_id attribute. Would it be under the media player entity I’m using? Here are the attributes it shows:

friendly_name: Bravia TV
supported_features: 21945

The app id’s should be correct I think. I got them by connecting to the TV via adb from my computer, and running a command I found on this forum that lists out available intents. I am able to verify they are correct by manually sending the adb commands to the TV from my computer. Here’s the full list of intents I got:

com.cloudmosa.puffinTV/com.cloudmosa.app.LemonActivity
com.sony.rvu/.Activity
com.spotify.tv.android/.SpotifyTVActivity
com.pandora.android.atv/com.pandora.android.MainActivity
com.android.vending/com.google.android.finsky.tvmainactivity.TvMainActivity
com.hulu.livingroomplus/.MainActivity
com.crackle.androidtv/com.crackle.alwayson.app.HomeActivity
com.nbadigital.gatv/com.nbadigital.gametimelite.features.splash.SplashActivity
com.hbo.go/.LaunchActivity
com.google.android.youtube.tv/com.google.android.apps.youtube.tv.activity.ShellActivity
com.accuweather.android/com.accuweather.accutv.core.MainActivity
com.google.android.tv.remote.service/.settings.SettingsActivity
com.google.android.play.games/com.google.android.gms.games.ui.destination.main.MainActivity
com.netflix.ninja/.MainActivity

Ahh nevermind… I see what it does now :blush:

For some reason I thought that the apps defined in the config would be rendered as a list or dropdown of some sort that I clicked to switch the app.

I started playing around with it and see that it’s actually specifying what name will be displayed in the UI as opposed to “com.netflix.ninja” or the likes.

@JeffLIrion thanks for the time!

it looks like this is not very stable or at least not with FireTV
previously i was using Hass and androidtv component under hassbian and it was fine.

Now I usually get this:

Platform androidtv not ready yet. Retrying in 60 seconds.
5:01 PM helpers/entity_platform.py (WARNING)
Could not connect to Fire TV Salotto at 192.168.1.168:5555 using ADB server at 127.0.0.1:5037
5:01 PM components/androidtv/media_player.py (WARNING) - message first occured at 5:00 PM and shows up 2 times

and it down not connect to my FireTV.
Once I had it connecting after rebooting FireTV: not sure if I need to reboot FireTV every time i restart the add-on?

Related: Hassio 0.93.1.
Following restart of Hassio, neither of my firetv devices show as “entities” until I power-cycle the firetv devices, and then restart the ADB service.

The ADB log will show “connected” without the entities being available.
The entities appear once the log shows “already connected.”

See this log messages following device power cycling and restarting the ADB service:

[16:56:07] INFO: Starting the Android Debug Bridge server...
[16:56:07] INFO: Connecting to device: 192.168.2.127...
connected to 192.168.2.127:5555
[16:56:07] INFO: Connecting to device: 192.168.2.137...
connected to 192.168.2.137:5555
[16:57:38] INFO: Connecting to device: 192.168.2.127...
already connected to 192.168.2.127:5555
[16:57:38] INFO: Connecting to device: 192.168.2.137...
already connected to 192.168.2.137:5555

I noticed that the ADB code seems to provide return codes and statuses. Is there a way to tell, for example, that plex has finished loading? I’d like to issue some commands post load of the app, but don’t want to wait a fixed number of seconds before doing so, in the hope that the app has loaded.

I have exactly the same issue

Hi guys anyone able to assist a newbie with this. Trying to get my shield TV to work.
Log shows it’s connected on port 5555. I have turned on network debugging (had the trust window “add keys” come up on the shield which I accepted.

Here’s the config:

media_player:

  • platform: androidtv
    host: 192.168.2.13
    name: “Nvidia Shield”
    adb_server_ip: 127.0.0.1
    adb_server_port: 5037
    apps:
    com.google.android.tvlauncher: “Home”
    com.google.android.youtube.tv: “Youtube”
    com.amazon.amazonvideo.livingroom: “Amazon Prime Video”
    com.plexapp.android: “Plex”
    com.netflix.ninja: “Netflix”
    com.google.android.tv: “Live Channels”
    org.xbmc.kodi: “Kodi”

But whenever I try and send a call service to the Android TV I get the follow errors:

I FTP’d into the shield to see if i could find a place where keys were stored, but was unable to locate .android… (am clutching at straws here).

I am able to turn on and off the shield by pressing the power icon in the UI, so there is definitely some connection, but am at a loss from here how to get it controlled.

Anyone able to show a pointer?
thx

Oh, sorry nearly forgot:

Add-on version: 0.4.1
You are running the latest version of this add-on.
System: HassOS 2.11 (amd64 / intel-nuc)
Home Assistant version: 0.93.2
Supervisor version: 164


[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing…
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] adb.sh: executing…
[cont-init.d] adb.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[16:24:45] INFO: Starting the Android Debug Bridge server…
[16:24:45] INFO: Connecting to device: 192.168.2.13…
connected to 192.168.2.13:5555

Same here

2019-05-29 20:21:30 INFO (MainThread) [homeassistant.components.media_player] Setting up media_player.androidtv
2019-05-29 20:21:30 ERROR (SyncWorker_3) [root] ADB device is unavailable; encountered an error when searching for device.
2019-05-29 20:21:30 WARNING (SyncWorker_3) [homeassistant.components.androidtv.media_player] Could not connect to FireTV at 10.0.20.61:5555 using ADB server at 127.0.0.1:5037
2019-05-29 20:21:30 WARNING (MainThread) [homeassistant.components.media_player] Platform androidtv not ready yet. Retrying in 60 seconds.

A recent pull request for the python-adb package might fix the issues that the Python ADB implementation had with newer devices. If you’d like to test it, please use this as a custom component and report back!

https://github.com/JeffLIrion/home-assistant/tree/patch-19/homeassistant/components/androidtv

You’ll need to follow the instructions for generating an adbkey file:

https://www.home-assistant.io/components/androidtv#2-python-adb-implementation

You’ll also need to stop the ADB server and restart your Android TV / Fire TV device.