wait for a week, a solid androidtv version is coming
It’s under review,
So may be next release
Strange, but since this became official I’m still getting the following in hassio v0.90.1:
019-03-22 20:59:52 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform androidtv
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.7/asyncio/tasks.py”, line 416, in wait_for
return fut.result()
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/androidtv/media_player.py”, line 105, in setup_platform
device_class=config[CONF_DEVICE_CLASS])
File “/usr/local/lib/python3.7/site-packages/androidtv/init.py”, line 53, in setup
aftv.device_properties = aftv.get_device_properties()
File “/usr/local/lib/python3.7/site-packages/androidtv/androidtv.py”, line 151, in get_device_properties
wifi_out = self.adb_shell(‘ip addr show wlan0’)
File “/usr/local/lib/python3.7/site-packages/androidtv/basetv.py”, line 99, in _adb_shell_python_adb
return self._adb.Shell(cmd)
File “/usr/local/lib/python3.7/site-packages/adb/adb_commands.py”, line 376, in Shell
timeout_ms=timeout_ms)
File “/usr/local/lib/python3.7/site-packages/adb/adb_protocol.py”, line 411, in Command
return ‘’.join(cls.StreamingCommand(usb, service, command, timeout_ms))
File “/usr/local/lib/python3.7/site-packages/adb/adb_protocol.py”, line 439, in StreamingCommand
for data in connection.ReadUntilClose():
AttributeError: ‘NoneType’ object has no attribute ‘ReadUntilClose’
Any other info I can offer here? No t sure where to start troubleshooting. This is on a new hassio vm install. Everything else seems to work fine after migrating from the docker.
This is covered in the documentation, although it wasn’t as clear as I thought it was so I submitted a pull request to make it more clear.
https://deploy-preview-9012–home-assistant-docs.netlify.com/components/androidtv#adb-troubleshooting
The Python ADB implementation isn’t working for your device, so you need to use the ADB server approach.
Thanks for that. I was under the impression that I had to use the add on for adb under hassio. That’s how I set it up. I didn’t add the adb server IP. Now that I’ve done that it’s all good. Thanks for the quick help.
Not sure wether I’m correct in this thread as I’m trying to use Home Assistants “native” component with FireTV support (introduced in 0.90). But I ran into an issue when trying to set it up. Posted about it here, maybe you can have a look?
I’m getting the same errors.
Did you use the server method by installing the ADB addon? @capstan1 looks like you have the Android TV addon configured to use the server so I just wanted to make sure you had the server set up and configured. You also need to make sure the server is able to connect to your devices. The device will prompt to trust this computer. If that doesn’t happen, then that’s your issue.
I have Hassio 90.1, ADB - Android Debug Bridge 0.3.0 installed.
ADB Bridge log:
[20:48:24] INFO: Connecting to device: 192.168.1.189…
connected to 192.168.1.189:5555
I accepted the auth on the TV so it looks they are communicating.
But in the Hassio log:
2019-03-25 20:49:45 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform androidtv
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.7/asyncio/tasks.py”, line 416, in wait_for
return fut.result()
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/androidtv/media_player.py”, line 115, in setup_platform
device_class=config[CONF_DEVICE_CLASS])
File “/usr/local/lib/python3.7/site-packages/androidtv/init.py”, line 53, in setup
aftv.device_properties = aftv.get_device_properties()
File “/usr/local/lib/python3.7/site-packages/androidtv/androidtv.py”, line 152, in get_device_properties
wifimac = re.findall(WIFIMAC_REGEX_PATTERN, wifi_out)[0]
IndexError: list index out of range
Any idea to fix? I googled it but that just caused me more confusion…
Thanks
I have Hassio 90.1, ADB - Android Debug Bridge 0.3.0 installed.
If i edit out the philipstv section below then the shieldtv is picked up and works great, if I include the philipstv section I get the errors below and neither devices are picked up…any ideas? I have had the secure box popup on both tv’s and have accepted the connection permanently.
configuration.yaml:
-
platform: androidtv
host: 192.168.10.35
name: ShieldTV
adb_server_ip: 127.0.0.1
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” -
platform: androidtv
host: 192.168.10.31
name: PhilipsTV
adb_server_ip: 127.0.0.1
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”
ADB Bridge log:
[22:58:13] INFO: Starting the Android Debug Bridge server…
error: could not install smartsocket listener: Address already in use
[22:58:14] INFO: Starting the Android Debug Bridge server…
error: could not install smartsocket listener: Address already in use
repeats…
if I restart app then the error goes and connects to both shieldtv & philipstv
the hassio log:
Error while setting up platform androidtv
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.7/asyncio/tasks.py”, line 416, in wait_for
return fut.result()
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/androidtv/media_player.py”, line 119, in setup_platform
if not aftv.available:
File “/config/deps/lib/python3.7/site-packages/androidtv/basetv.py”, line 218, in available
adb_devices = self._adb_client.devices()
File “/config/deps/lib/python3.7/site-packages/adb_messenger/command/host/init.py”, line 19, in devices
result = self._execute_cmd(cmd)
File “/config/deps/lib/python3.7/site-packages/adb_messenger/command/host/init.py”, line 10, in _execute_cmd
conn.send(cmd)
File “/config/deps/lib/python3.7/site-packages/adb_messenger/connection.py”, line 77, in send
return self._check_status()
File “/config/deps/lib/python3.7/site-packages/adb_messenger/connection.py”, line 80, in _check_status
recv = self._recv(4).decode(‘utf-8’)
File “/config/deps/lib/python3.7/site-packages/adb_messenger/connection.py”, line 56, in _recv
return self.socket.recv(length)
ConnectionResetError: [Errno 104] Connection reset by peer
–
Its great on the shieldtv, but frustrating that the philips won’t work especially as its just had a major update to the android interface (now same as shieldtv)
I’ve found that restarting the TV (not just turning off and on) and restarting hassio gets it to reconnect. Not ideal, but I have 5 Android TV’s so I was able to check as this happened in different sets multiple times.
I fixed this in the next release. In the meantime, you can use it as a custom component.
Thanks for your reply @panteragstk ! The addon is connecting succesfully:
[06:48:18] INFO: Connecting to device: 192.168.0.7…
connected to 192.168.0.7:5555
So my Mibox3 has been an absolute pain with this and the ADB binaries. Everything would work fine while it was on, but would constantly either drop connection or take about 30 secs per update cycle, fail to respond or just go into a reconnect loop when it was switched off. Testing with from the command line showed either horrible response times or a timeout.
And it finally dawned on me why! F#*king Android Doze! The damn thing is dropping into battery saving mode, throttling the cpu and dropping the wifi into “location and whitelisted apps only” mode.
One quick install of Wake Lock v3 on the Mibox, set to autostart and keep full CPU and Wifi locks, and everything works like magic…
I should just learn by now, if something is acting odd on Android, it’s probably Doze mode…
Now I’m off to test if that fixes the builtin adb server too…
Edit: Yes, yes, it looks like it does… Goddamn power saving…
I have Hassio 0.90.2 , ADB - Android Debug Bridge 0.3.0 installed.
This components work fine with my phone, but not with my androidtv
ADB Bridge log:
[18:23:02] INFO: Connecting to device: 192.168.1.10... connected to 192.168.1.10:5555
But in Hassio Log i get this
Error while setting up platform androidtv
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.7/asyncio/tasks.py”, line 416, in wait_for
return fut.result()
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/androidtv/media_player.py”, line 115, in setup_platform
device_class=config[CONF_DEVICE_CLASS])
File “/config/deps/lib/python3.7/site-packages/androidtv/init.py”, line 34, in setup
return AndroidTV(host, adbkey, adb_server_ip, adb_server_port)
File “/config/deps/lib/python3.7/site-packages/androidtv/androidtv.py”, line 59, in init
self.device_properties = self.get_device_properties()
File “/config/deps/lib/python3.7/site-packages/androidtv/androidtv.py”, line 152, in get_device_properties
wifimac = re.findall(WIFIMAC_REGEX_PATTERN, wifi_out)[0]
IndexError: list index out of range
How i can fix this?
Same problem today
Does anyone know where in tmp androidtv.media_player is stored? I replaced it already with androidtv.adb_command yet I still get an error that it found something in tmp with androidtv.media_player.
This is from my log:
Unable to prepare setup for platform androidtv.media_player: Could not install all requirements.
9:10 AM setup.py (ERROR)
Not initializing androidtv.media_player because could not install requirement androidtv==0.0.14
9:10 AM requirements.py (ERROR)
Unable to install package androidtv==0.0.14: Failed building wheel for pycryptodome python-jose-cryptodome 1.3.2 has requirement pycryptodome<3.4.0,>=3.3.1, but you’ll have pycryptodome 3.8.1 which is incompatible. pyrebase4 4.3.0 has requirement oauth2client==4.1.2, but you’ll have oauth2client 4.0.0 which is incompatible. broadlink 0.9 has requirement pycryptodome==3.4.11, but you’ll have pycryptodome 3.8.1 which is incompatible. Command “/usr/local/bin/python3 -u -c “import setuptools, tokenize;file=’/tmp/pip-install-i6pphdft/pycryptodome/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-record-5t4qnzmc/install-record.txt --single-version-externally-managed --prefix --compile --user --prefix=” failed with error code 1 in /tmp/pip-install-i6pphdft/pycryptodome/
9:10 AM util/package.py (ERROR)
Same error after updating to 0.91
I’ve got the same error after updating to 0.91
ADB is connecting 19:22:15] INFO: Connecting to device: 192.168.1.112... already connected to 192.168.1.112:5555
But get these messages in the log upon startup
Unable to install package androidtv==0.0.14: Failed building wheel for pycryptodome python-jose-cryptodome 1.3.2 has requirement pycryptodome<3.4.0,>=3.3.1, but you'll have pycryptodome 3.8.1 which is incompatible. pyrebase4 4.3.0 has requirement oauth2client==4.1.2, but you'll have oauth2client 4.0.0 which is incompatible. broadlink 0.9 has requirement pycryptodome==3.4.11, but you'll have pycryptodome 3.8.1 which is incompatible. Command "/usr/local/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-auja82e5/pycryptodome/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-9ss__l_o/install-record.txt --single-version-externally-managed --prefix --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-auja82e5/pycryptodome
Not initializing androidtv.media_player because could not install requirement androidtv==0.0.14
Unable to prepare setup for platform androidtv.media_player: Could not install all requirements.