Giter Site home page Giter Site logo

python-firetv's Introduction

python-firetv

firetv is a Python 2 and 3 package that provides state information and some control of an Amazon Fire TV device over a network. This is achieved via ADB, so therefore requires ADB Debugging to be turned on. It includes firetv-server, an HTTP server to facilitate RESTful access to configured devices.

Installation

Install the package using the command:

pip install firetv

If you want the HTTP server component installed as a script, use:

pip install firetv[firetv-server]

NOTE: You may need to install the following ADB dependencies via your package manager:

  • with apt-get: swig libssl-dev python-dev libusb-1.0-0
  • with yum: swig openssl-devel python-devel libusbx-devel

Server

To run the server when installed as a script:

firetv-server

If you want to set a default Amazon Fire TV device:

firetv-server -d X.X.X.X:5555

If you want to run on a port other than 5556:

firetv-server -p XXXX

systemd

Copy the firetv.service file to /etc/systemd/system/. Modify the ExecStart path and arguments as necessary.

systemctl enable firetv.service  # Enable on boot
systemctl start firetv.service   # Start server
systemctl stop firetv.service    # Stop server

Persistence

To store multiple Amazon Fire TV devices persistent, you can load a yaml config file: firetv-server -c some/config/file.yaml

The config file has to be in the following format:

devices:
  sleepingroom:
    host: 192.168.0.13:5555
  livingroom:
    host: 192.168.0.16:5555

Note: If you use -d and -c option together you must not name one of the devices in config file default or give one of the devices the same host as in -d option.

Routes

All routes return JSON.

  • GET /devices/list (list all registered devices and state)
  • GET /devices/connect/<device_id> (force connection attempt)
  • GET /devices/state/<device_id> (return state)
  • GET /devices/action/<device_id>/<action_id> (request action)
  • GET /devices/<device_id>/apps/running (return running user apps)
  • GET /devices/<device_id>/apps/<app_id>/start (start an app)
  • GET /devices/<device_id>/apps/<app_id>/stop (stop an app)
  • GET /devices/<device_id>/apps/<app_id>/state (check app state)
  • GET /devices/<device_id>/apps/state/<app_id> (check app state, deprecated format)
  • POST /devices/add (see below)

Add A Device

If you use the -d option, the specified device is added automatically with the device identifier default. If you want to add further devices, or don't want to use the command line option for the initial device, use the POST /devices/add route. The device identifier can be any string meaningful to you, matching [-\w] (any alphanumeric character, plus -).

POST JSON in the following format with the HTTP header Content-Type: application/json:

{
  "device_id": "<your_device_id>",
  "host": "<address>:<port>"
}

Features

firetv can detect device state and issue a number of actions. It can also get the running state of user apps.

Detected States

  • off (TV screen is dark)
  • standby (standard UI is active - not apps)
  • idle (screen saver is active)
  • play (video is playing)
  • pause (video is paused)
  • disconnected (can't communicate with device)

Actions

  • turn_on (turn on the device, showing the UI on screen)
  • turn_off (turn off the device, screen goes dark)
  • home (emulate Home button)
  • media_play_pause (emulate Play/Pause button)
  • media_play (simulate Play button)
  • media_pause (simulate Pause button)
  • media_next (emulate Fast-Forward button)
  • media_previous (emulate Rewind button)
  • volume_up (raise volume)
  • volume_down (lower volume)

Apps

  • GET /devices/<device_id>/apps/running
  • /devices/<device_id>/apps/state/<app_id>
  • /devices/<device_id>/apps/<app_id>/state

app_id can be anything from a single word, e.g. 'netflix' or the full package name, e.g. com.netflix.ninja

You can start or stop an app with the following commands:

  • GET /devices/<device_id>/apps/<app_id>/start
  • GET /devices/<device_id>/apps/<app_id>/stop

app_id must be a package name, e.g. org.xbmc.kodi or com.netflix.ninja

Contribution

This package does not fully exploit the potential of ADB access to Amazon Fire TV devices, and lacks some robustness. Contributions are welcome.

python-firetv's People

Contributors

aareon avatar arraylabs avatar bart274 avatar codemonk avatar djburns avatar djdefi avatar gollo avatar happyleavesaoc avatar jefflirion avatar juliangeiges avatar kvn-stgl avatar kylmp avatar peschonaut avatar rytilahti avatar sytone avatar tuxuser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-firetv's Issues

FireTV Media Player not showing up in HASS

I got my FireTV setup using this guide: https://home-assistant.io/components/media_player.firetv/

However when I run the firetv-server it works fine when going to localhost and shows the proper state of my firetv, but I can't get Home Assistant to connect to it. I'm assuming this is due to the firetv server not starting at boot and rather me starting it up after boot?

Here is the error in homeassistant:

16-10-30 03:55:05 homeassistant.components.media_player.firetv: Could not connect to firetv-server at 192.168.1.202:5555

Unknown command: %x' % cmd, cmd, (arg0, arg1) on /devices/state/default

[2017-05-02 20:11:32,628] ERROR in app: Exception on /devices/state/default [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python2.7/dist-packages/firetv/__main__.py", line 120, in device_state
    return jsonify(state=devices[device_id].state)
  File "/usr/local/lib/python2.7/dist-packages/firetv/__init__.py", line 86, in state
    if not self._screen_on:
  File "/usr/local/lib/python2.7/dist-packages/firetv/__init__.py", line 227, in _screen_on
    return self._dump_has('power', 'Display Power', 'state=ON')
  File "/usr/local/lib/python2.7/dist-packages/firetv/__init__.py", line 285, in _dump_has
    return self._dump(service, grep=grep).strip().find(search) > -1
  File "/usr/local/lib/python2.7/dist-packages/firetv/__init__.py", line 274, in _dump
    return self._adb.Shell('dumpsys {0} | grep "{1}"'.format(service, grep))
  File "/usr/local/lib/python2.7/dist-packages/adb/adb_commands.py", line 251, in Shell
    timeout_ms=timeout_ms)
  File "/usr/local/lib/python2.7/dist-packages/adb/adb_protocol.py", line 364, in Command
    return ''.join(cls.StreamingCommand(usb, service, command, timeout_ms))
  File "/usr/local/lib/python2.7/dist-packages/adb/adb_protocol.py", line 388, in StreamingCommand
    timeout_ms=timeout_ms)
  File "/usr/local/lib/python2.7/dist-packages/adb/adb_protocol.py", line 331, in Open
    timeout_ms=timeout_ms)
  File "/usr/local/lib/python2.7/dist-packages/adb/adb_protocol.py", line 219, in Read
    'Unknown command: %x' % cmd, cmd, (arg0, arg1))
InvalidCommandError: ('Unknown command: 66666666', 1717986918, (808460390, 808464432))

Cannot install using raspberry pi 2b.

using the installation guide described by you, m2crypto does not work.
checking out commit 7e9f6b9810af02509212bfc2471bcf51ea1bb155 for m2crypto fixes this.
maybe update dependencies for pip?

also pyyaml should be included in the installation guide

AdbCommands instance as first argument

(firetv) firetv@debian:/srv$ firetv-server -d 192.168.1.108:5555
Traceback (most recent call last):
File "/srv/firetv/firetv/bin/firetv-server", line 11, in
sys.exit(main())
File "/srv/firetv/firetv/local/lib/python2.7/site-packages/firetv/main.py", line 244, in main
if args.default and not add('default', args.default):
File "/srv/firetv/firetv/local/lib/python2.7/site-packages/firetv/main.py", line 88, in add
devices[device_id] = FireTV(str(host))
File "/srv/firetv/firetv/local/lib/python2.7/site-packages/firetv/init.py", line 99, in init
self.connect()
File "/srv/firetv/firetv/local/lib/python2.7/site-packages/firetv/init.py", line 109, in connect
serial=self.host)
TypeError: unbound method ConnectDevice() must be called with AdbCommands instance as first argument (got nothing instead)

Python 2.7 VirtualEnv

Could be due to this version of python-adb? v1.3.0
https://github.com/google/python-adb/releases

Backwards Incompatible changes
adb_commands.AdbCommands() is now a normal class rather than a collection of staticmethods. Using the following example code to get started:

device = adb_commands.AdbCommands()
device.ConnectDevice(rsa_keys=[signer])

`androidtv` integration

@happyleavesaoc I'd like to combine your firetv package and my androidtv package. Since firetv was the original package, I propose that we use your repository but we rename the package from firetv to androidtv, since Fire TVs are Android TVs but the reverse is not always true. Alternatively, I could integrate the firetv functionality into my androidtv repo and package.

Please let me know how you'd like to proceed.

Server fails to load any firetv devices to control.

Has been running fine, running under Python 2.7 under Ubuntu.

Since a recent restart, server only starts if it has no firetv to connect to. If started with either a default on command line or from a config file, it fails.

When trying to add a device via the api on a running server it also fails.

When adding a device via API, error message thrown is as follows:

[2018-02-10 16:23:26,917] ERROR in app: Exception on /devices/add [POST]
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functionsrule.endpoint
File "/usr/local/lib/python2.7/dist-packages/firetv/main.py", line 100, in add_device
success = add(req['device_id'], req['host'])
File "/usr/local/lib/python2.7/dist-packages/firetv/main.py", line 81, in add
devices[device_id] = FireTV(str(host))
File "/usr/local/lib/python2.7/dist-packages/firetv/init.py", line 61, in init
self.connect()
File "/usr/local/lib/python2.7/dist-packages/firetv/init.py", line 74, in connect
raise serr
error: [Errno 104] Connection reset by peer

no route to host - device offline - server doesnt start

I have setup the server on ubuntu 16.04 and configured with persistent configuration:

service is installed via systemd

[Unit]
Description=FireTV-Server
After=network.target

[Service]
Type=simple
User=homeassistant
ExecStart=/usr/local/bin/firetv-server -c /home/homeassistant/.homeassistant/firetv_conf.yaml

[Install]
WantedBy=multi-user.target

the server fails to start with the below message if any of the configured devices is offline

Traceback (most recent call last):
File "/usr/local/bin/firetv-server", line 11, in
load_entry_point('firetv==1.0.5', 'console_scripts', 'firetv-server')()
File "/usr/local/lib/python2.7/dist-packages/firetv/main.py", line 235, in main
_add_devices_from_config(args)
File "/usr/local/lib/python2.7/dist-packages/firetv/main.py", line 224, in _add_devices_from_config
add(device, config['devices'][device]['host'])
File "/usr/local/lib/python2.7/dist-packages/firetv/main.py", line 81, in add
devices[device_id] = FireTV(str(host))
File "/usr/local/lib/python2.7/dist-packages/firetv/init.py", line 61, in init
self.connect()
File "/usr/local/lib/python2.7/dist-packages/firetv/init.py", line 74, in connect
raise serr
socket.error: [Errno 113] No route to host

the configuration however states - intends are correct though not showing below

devices:
default:
host: 192.168.1.26:5555
bedroom:
host: 192.168.1.27:5555

ping completes for default:

PING 192.168.1.26 (192.168.1.26) 56(84) bytes of data.
64 bytes from 192.168.1.26: icmp_seq=1 ttl=64 time=1.31 ms
64 bytes from 192.168.1.26: icmp_seq=2 ttl=64 time=1.21 ms

Cannot get firetv-server or firetv to install from pip

firetv@raspberrypi:~ $pip install firetv[firetv-server]
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting firetv[firetv-server]
Downloading https://files.pythonhosted.org/packages/78/f8/ec97e02ae8102ece206f3cf08643d10ba7cc8b9ab7a3d5855040804583e3/firetv-1.0.5.tar.gz
Collecting adb>=1.1.0 (from firetv[firetv-server])
Downloading https://files.pythonhosted.org/packages/39/c0/715acc4e0c37a6a93f73daf8536baea94ac9fb6539ef1fd9c42205e1c3fa/adb-1.3.0-py2-none-any.whl
Requirement already satisfied: Flask>=0.10.1 in ./firetv/lib/python2.7/site-packages (from firetv[firetv-server]) (1.0.2)
Collecting PyYAML>=3.12 (from firetv[firetv-server])
Downloading https://files.pythonhosted.org/packages/9e/a3/1d13970c3f36777c583f136c136f804d70f500168edc1edea6daa7200769/PyYAML-3.13.tar.gz (270kB)
100% |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 276kB 3.7MB/s
Collecting M2Crypto<=0.26.4,>=0.21.1 (from adb>=1.1.0->firetv[firetv-server])
Downloading https://files.pythonhosted.org/packages/dc/5b/1ff81e2dda5d2dee62d1c26f5df91b1ea3a560b6611cea67e6c55d1f2e15/M2Crypto-0.26.4.tar.gz (1.1MB)
100% |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 1.1MB 2.7MB/s
Collecting libusb1>=1.0.16 (from adb>=1.1.0->firetv[firetv-server])
Downloading https://files.pythonhosted.org/packages/ec/5d/4fdac6c53525786fe35cff035c3345452e24e2bee5627893be65d12555cb/libusb1-1.6.4.tar.gz (55kB)
100% |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 61kB 1.6MB/s
Requirement already satisfied: click>=5.1 in ./firetv/lib/python2.7/site-packages (from Flask>=0.10.1->firetv[firetv-server]) (6.7)
Requirement already satisfied: Werkzeug>=0.14 in ./firetv/lib/python2.7/site-packages (from Flask>=0.10.1->firetv[firetv-server]) (0.14.1)
Requirement already satisfied: itsdangerous>=0.24 in ./firetv/lib/python2.7/site-packages (from Flask>=0.10.1->firetv[firetv-server]) (0.24)
Requirement already satisfied: Jinja2>=2.10 in ./firetv/lib/python2.7/site-packages (from Flask>=0.10.1->firetv[firetv-server]) (2.10)
Collecting typing (from M2Crypto<=0.26.4,>=0.21.1->adb>=1.1.0->firetv[firetv-server])
Downloading https://files.pythonhosted.org/packages/0d/4d/4e5985d075d241d686a1663fa1f88b61d544658d08c1375c7c6aac32afc3/typing-3.6.4-py2-none-any.whl
Requirement already satisfied: MarkupSafe>=0.23 in ./firetv/lib/python2.7/site-packages (from Jinja2>=2.10->Flask>=0.10.1->firetv[firetv-server]) (1.0)
Building wheels for collected packages: firetv, PyYAML, M2Crypto, libusb1
Running setup.py bdist_wheel for firetv ... done
Stored in directory: /home/firetv/.cache/pip/wheels/06/92/a6/a1ee80fdb15392919a33a57f404e03238db1f119587dd596e5
Running setup.py bdist_wheel for PyYAML ... done
Stored in directory: /home/firetv/.cache/pip/wheels/ad/da/0c/74eb680767247273e2cf2723482cb9c924fe70af57c334513f
Running setup.py bdist_wheel for M2Crypto ... error
Complete output from command /home/firetv/firetv/bin/python2.7 -u -c "import setuptools, tokenize;file='/tmp/pip-install-XVZVug/M2Crypto/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/pip-wheel-9Hewwh --python-tag cp27:
running bdist_wheel
running build
running build_py
copying M2Crypto/six.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/RSA.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/Err.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/DH.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/Rand.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/m2.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/callback.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/util.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/EVP.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/RC4.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/ASN1.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/m2xmlrpclib.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/httpslib.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/SMIME.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/DSA.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/init.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/BIO.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/X509.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/EC.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/m2urllib.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/m2crypto.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/Engine.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/ftpslib.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/BN.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/threading.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/m2urllib2.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/AuthCookie.py -> build/lib.linux-armv7l-2.7/M2Crypto
creating build/lib.linux-armv7l-2.7/M2Crypto/PGP
copying M2Crypto/PGP/PublicKey.py -> build/lib.linux-armv7l-2.7/M2Crypto/PGP
copying M2Crypto/PGP/packet.py -> build/lib.linux-armv7l-2.7/M2Crypto/PGP
copying M2Crypto/PGP/RSA.py -> build/lib.linux-armv7l-2.7/M2Crypto/PGP
copying M2Crypto/PGP/constants.py -> build/lib.linux-armv7l-2.7/M2Crypto/PGP
copying M2Crypto/PGP/init.py -> build/lib.linux-armv7l-2.7/M2Crypto/PGP
copying M2Crypto/PGP/PublicKeyRing.py -> build/lib.linux-armv7l-2.7/M2Crypto/PGP
creating build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/SSLServer.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/Checker.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/Cipher.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/timeout.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/Connection.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/init.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/cb.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/Context.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/Session.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/ssl_dispatcher.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/TwistedProtocolWrapper.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
running build_ext
building 'M2Crypto._m2crypto' extension
swigging SWIG/m2crypto.i to SWIG/m2crypto_wrap.c
swig -python -D__armv7l
-I/usr/include/python2.7 -I/usr/include -I/usr/include/arm-linux-gnueabihf -includeall -modern -builtin -outdir /tmp/pip-install-XVZVug/M2Crypto/M2Crypto -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
/usr/include/arm-linux-gnueabihf/gnu/stubs.h:7: Error: Unable to find 'gnu/stubs-soft.h'
error: command 'swig' failed with exit status 1


Failed building wheel for M2Crypto
Running setup.py clean for M2Crypto
Running setup.py bdist_wheel for libusb1 ... done
Stored in directory: /home/firetv/.cache/pip/wheels/98/8d/8b/bac0a20eb9757e7dbf46e8ab1f1695c78ad919f53080a58bc1
Successfully built firetv PyYAML libusb1
Failed to build M2Crypto
Installing collected packages: typing, M2Crypto, libusb1, adb, PyYAML, firetv
Running setup.py install for M2Crypto ... error
Complete output from command /home/firetv/firetv/bin/python2.7 -u -c "import setuptools, tokenize;file='/tmp/pip-install-XVZVug/M2Crypto/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-Psnwge/install-record.txt --single-version-externally-managed --compile --install-headers /home/firetv/firetv/include/site/python2.7/M2Crypto:
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-2.7
creating build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/six.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/RSA.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/Err.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/DH.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/Rand.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/m2.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/callback.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/util.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/EVP.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/RC4.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/ASN1.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/m2xmlrpclib.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/httpslib.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/SMIME.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/DSA.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/init.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/BIO.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/X509.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/EC.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/m2urllib.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/m2crypto.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/Engine.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/ftpslib.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/BN.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/threading.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/m2urllib2.py -> build/lib.linux-armv7l-2.7/M2Crypto
copying M2Crypto/AuthCookie.py -> build/lib.linux-armv7l-2.7/M2Crypto
creating build/lib.linux-armv7l-2.7/M2Crypto/PGP
copying M2Crypto/PGP/PublicKey.py -> build/lib.linux-armv7l-2.7/M2Crypto/PGP
copying M2Crypto/PGP/packet.py -> build/lib.linux-armv7l-2.7/M2Crypto/PGP
copying M2Crypto/PGP/RSA.py -> build/lib.linux-armv7l-2.7/M2Crypto/PGP
copying M2Crypto/PGP/constants.py -> build/lib.linux-armv7l-2.7/M2Crypto/PGP
copying M2Crypto/PGP/init.py -> build/lib.linux-armv7l-2.7/M2Crypto/PGP
copying M2Crypto/PGP/PublicKeyRing.py -> build/lib.linux-armv7l-2.7/M2Crypto/PGP
creating build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/SSLServer.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/Checker.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/Cipher.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/timeout.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/Connection.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/init.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/cb.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/Context.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/Session.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/ssl_dispatcher.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
copying M2Crypto/SSL/TwistedProtocolWrapper.py -> build/lib.linux-armv7l-2.7/M2Crypto/SSL
running build_ext
building 'M2Crypto._m2crypto' extension
swigging SWIG/m2crypto.i to SWIG/m2crypto_wrap.c
swig -python -D__armv7l
-I/usr/include/python2.7 -I/usr/include -I/usr/include/arm-linux-gnueabihf -includeall -modern -builtin -outdir /tmp/pip-install-XVZVug/M2Crypto/M2Crypto -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
/usr/include/arm-linux-gnueabihf/gnu/stubs.h:7: Error: Unable to find 'gnu/stubs-soft.h'
error: command 'swig' failed with exit status 1

----------------------------------------

Command "/home/firetv/firetv/bin/python2.7 -u -c "import setuptools, tokenize;file='/tmp/pip-install-XVZVug/M2Crypto/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-Psnwge/install-record.txt --single-version-externally-managed --compile --install-headers /home/firetv/firetv/include/site/python2.7/M2Crypto" failed with error code 1 in /tmp/pip-install-XVZVug/M2Crypto/

Cannot find firestick device

I followed the installation readme but this error persists. What am I missing?

pi@raspberrypi:~ $ sudo firetv-server -d 192.168.0.12:5555
WARNING:root:Couldn't connect to host: 192.168.0.12:5555, error: None

The device is reachable if I use adb connect 192.168.0.12 from windows shell

Exception on /devices/default/apps/running

[2017-05-02 20:15:23,874] ERROR in app: Exception on /devices/default/apps/running [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python2.7/dist-packages/firetv/__main__.py", line 143, in running_apps
    return jsonify(running_apps=devices[device_id].running_apps())
  File "/usr/local/lib/python2.7/dist-packages/firetv/__init__.py", line 102, in running_apps
    return self._ps('u0_a')
  File "/usr/local/lib/python2.7/dist-packages/firetv/__init__.py", line 307, in _ps
    self.connect()
  File "/usr/local/lib/python2.7/dist-packages/firetv/__init__.py", line 71, in connect
    serial=self.host)
  File "/usr/local/lib/python2.7/dist-packages/adb/adb_commands.py", line 87, in ConnectDevice
    return cls.Connect(handle, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/adb/adb_commands.py", line 110, in Connect
    device_state = cls.protocol_handler.Connect(usb, banner=banner, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/adb/adb_protocol.py", line 272, in Connect
    cmd, arg0, arg1, banner = cls.Read(usb, ['CNXN', 'AUTH'])
  File "/usr/local/lib/python2.7/dist-packages/adb/adb_protocol.py", line 215, in Read
    cmd, arg0, arg1, data_length, data_checksum = cls.Unpack(msg)
  File "/usr/local/lib/python2.7/dist-packages/adb/adb_protocol.py", line 200, in Unpack
    raise ValueError('Unable to unpack ADB command.', cls.format, message, e)
ValueError: ('Unable to unpack ADB command.', '<6I', '', error('unpack requires a string argument of length 24',))

Syntax error

I'm using your firetv server within a homeassistant addon vor hassio (https://github.com/mpneuried/hassio-custom-addons)

starting version 3.2.4
Traceback (most recent call last):
File "/usr/bin/firetv-server", line 11, in
load_entry_point('firetv==1.0.5', 'console_scripts', 'firetv-server')()
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 561, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 2631, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 2291, in load
return self.resolve()
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 2297, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/lib/python2.7/site-packages/firetv/main.py", line 36
def is_valid_host(host: str):
^
SyntaxError: invalid syntax

adb Connect Error

starting the firetvserver with arguments -d ip:port I got this error:

    self._adb = adb_commands.AdbCommands().ConnectDevice(serial=self.host)
TypeError: __init__() takes exactly 3 arguments (1 given)

using the latest git version for firetv and adb

Timeout?

My Fire TV if turned off most of the time. This is causing python-firetv to hang and not giving a timeout for 9.5 minutes! And this prevents e. g. Home Assistant from starting up, because it's waits for python-firetv.

My suggestion would be something like "giving up after 10 seconds and reply with 'offline'"

Connection reset by peer

Hi,
i have a problem with connecting this tool to my Fire TV.

$ firetv-server -d 192.168.10.8:5555                                                                                                                                                                                                                                                               1 [11:16:13]
Traceback (most recent call last):
  File "/usr/local/bin/firetv-server", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/firetv/__main__.py", line 237, in main
    if args.default and not add('default', args.default):
  File "/usr/local/lib/python2.7/dist-packages/firetv/__main__.py", line 81, in add
    devices[device_id] = FireTV(str(host))
  File "/usr/local/lib/python2.7/dist-packages/firetv/__init__.py", line 61, in __init__
    self.connect()
  File "/usr/local/lib/python2.7/dist-packages/firetv/__init__.py", line 74, in connect
    raise serr
socket.error: [Errno 104] Connection reset by peer

However, ADB is activated on the FireTV, and apps like Apps2Firetv for Android are able to connect to the FireTV and install Kodi or similar. The port 5555 on this device is open, nmap reports servicetype freeciv on this port.

Cannot find adb=1.3.0.dev for Docker installation

I've had this working beautifully with an older version of firetv-server. But then my firetv updated, and I'm getting the "missing key" issue. I see the latest version added an 'adbkey' property.

However, building the latest version with Docker results in this:

Collecting adb==1.3.0.dev (from firetv==1.0.5.dev0)
  Could not find a version that satisfies the requirement adb==1.3.0.dev (from firetv==1.0.5.dev0) (from versions: 1.1.1, 1.2.0, 1.3.0)
No matching distribution found for adb==1.3.0.dev (from firetv==1.0.5.dev0)
The command '/bin/sh -c pip install /tmp/python-firetv-master[firetv-server] --process-dependency-links' returned a non-zero code: 1

I'm on a Raspberry Pi 3 with a modified Dockerfile (required for the base image, and previous versions of M2Cyrpto don't compile on this platform):

FROM arm32v7/python:2.7.13-stretch

RUN apt-get update && apt-get install -y \
        libssl-dev \
        libusb-1.0-0 \
        python-dev \
        swig \
        curl \
        unzip \
        && curl -L -o /tmp/master.zip https://github.com/happyleavesaoc/python-firetv/archive/master.zip \
        && cd /tmp \
        && unzip master.zip \
        && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

RUN pip --no-cache-dir install --upgrade pip
RUN pip --no-cache-dir install flask
RUN pip --no-cache-dir install https://pypi.python.org/packages/01/bd/a41491718f9e2bebab015c42b5be7071c6695acfa301e3fc0480bfd6a15b/M2Crypto-0.27.0.tar.gz
RUN pip install /tmp/python-firetv-master[firetv-server] --process-dependency-links

VOLUME ["/config"]

CMD ["firetv-server", "-c", "/config/devices.yaml"]

Tried adding a "RUN pip --no-cache install adb" before the main install of python-firetv-master, but that has a require for a previous version of M2Crypto (0.26.4) which, again, won't compile (hard vs soft float).

Any ideas?

Cant't connect to FireTV

pi@wohnraspi:~ $ /home/pi/.local/bin/firetv-server -d 10.6.65.31:5555

  • Serving Flask app "firetv.main" (lazy loading)
  • Environment: production
    WARNING: Do not use the development server in a production environment.
    Use a production WSGI server instead.
  • Debug mode: off
  • Running on http://0.0.0.0:5556/ (Press CTRL+C to quit)
    10.6.65.43 - - [07/May/2019 22:38:34] "GET /devices/list HTTP/1.1" 200 -
    10.6.65.43 - - [07/May/2019 22:38:39] "GET /devices/list HTTP/1.1" 200 -

Response:
{"devices":{"default":{"host":"10.6.65.31:5555","state":"unknown"}}}

Ping OK
pi@wohnraspi:~ $ ping 10.6.65.31
PING 10.6.65.31 (10.6.65.31) 56(84) bytes of data.
64 bytes from 10.6.65.31: icmp_seq=1 ttl=64 time=145 ms
64 bytes from 10.6.65.31: icmp_seq=2 ttl=64 time=174 ms

Port is open:
pi@wohnraspi:~ $ telnet 10.6.65.31 5555
Trying 10.6.65.31...
Connected to 10.6.65.31.
Escape character is '^]'.
^]
telnet> quit

Implement Persistence

What do you think about implementing some persistence? Adding different Fire TV Devices every reboot needs a lot of automation in my HA-System.

Getting error when trying to start server, either with IP or without

(my_project) pi@raspberrypi:~/my_project $ firetv-server -d 192.168.1.119:5555

Traceback (most recent call last):
File "/usr/local/bin/firetv-server", line 5, in
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2876, in
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 449, in _build_master
ws.require(requires)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 745, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 639, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: libusb1>=1.0.16
(my_project) pi@raspberrypi:~/my_project $

This is the error I keep getting. installing on fresh 2.7 virtual environment on my raspberry pi.

Installation on Raspberry Pi requires the flask module.

I have installed Raspbian Jessie, added the Home-Assistant.io "all-in-one" kit. Following that, I have done:

sudo adduser --system --uid 998 firetv
sudo apt install libssl-dev swig python-dev libusb-1.0-0
sudo su - firetv -s /bin/bash
virtualenv -p /usr/bin/python2.7 firetv
source firetv/bin/activate
pip install firetv[firetv-server]

After running the above, I get the following:

(firetv) firetv@homeassistant:~$ firetv-server -h
Traceback (most recent call last):
  File "/home/firetv/firetv/bin/firetv-server", line 7, in <module>
    from firetv.__main__ import main
  File "/home/firetv/firetv/local/lib/python2.7/site-packages/firetv/__main__.py", line 23, in <module>
    from flask import Flask, jsonify, request, abort
ImportError: No module named flask

Following a pip install flask, it works.

python dependencies

Needed

pip install pyyaml flask

to get it working. Maybe you could to add the depencies in the readme.

Error during Install in Raspberry pi with Openhab

While install I am getting following error

pi@homepi:~ $ pip install firetv
Downloading/unpacking firetv
Downloading firetv-1.0.9.tar.gz
Running setup.py (path:/tmp/pip-build-uNWvlE/firetv/setup.py) egg_info for package firetv

Downloading/unpacking pycryptodome (from firetv)
Downloading pycryptodome-3.8.2.tar.gz (12.4MB): 12.4MB downloaded
Running setup.py (path:/tmp/pip-build-uNWvlE/pycryptodome/setup.py) egg_info for package pycryptodome
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
Testing support for clang
Target does not support clang
Testing support for gcc
Target does support gcc
Testing support for stdint.h header
Target does support stdint.h header
Testing support for 128-bit integer
Target does not support 128-bit integer
Testing support for intrin.h header
Target does not support intrin.h header
Testing support for cpuid.h header
Target does not support cpuid.h header
Testing support for posix_memalign
Target does support posix_memalign
Testing support for SSE2 (x86intrin.h)
Target does not support SSE2 (x86intrin.h)
Warning: compiler does not support AESNI instructions
Warning: compiler does not support CLMUL instructions

warning: no files found matching '.separate_namespace'
no previously-included directories found matching 'Doc/_build'
warning: no previously-included files matching '*.pyc' found under directory 'src'
no previously-included directories found matching 'src/test/build'

Downloading/unpacking rsa (from firetv)
Downloading rsa-4.0-py2.py3-none-any.whl
Downloading/unpacking adb-homeassistant (from firetv)
Downloading adb-homeassistant-1.3.2.tar.gz
Running setup.py (path:/tmp/pip-build-uNWvlE/adb-homeassistant/setup.py) egg_info for package adb-homeassistant
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'extra_requires'
warnings.warn(msg)

Downloading/unpacking pure-python-adb-homeassistant (from firetv)
Could not find a version that satisfies the requirement pure-python-adb-homeassistant (from firetv) (from versions: 0.1.5.dev0, 0.1.6.dev0, 0.1.7.dev0)
Cleaning up...
No distributions matching the version for pure-python-adb-homeassistant (from firetv)
Storing debug log for failure in /home/pi/.pip/pip.log
pi@homepi:~ $ ^C
pi@homepi:~ $ nano /home/pi/.pip/pip.log
pi@homepi:~ $ pip install -U pure-python-adb-homeassistant
Downloading/unpacking pure-python-adb-homeassistant
Could not find a version that satisfies the requirement pure-python-adb-homeassistant (from versions: 0.1.5.dev0, 0.1.6.dev0, 0.1.7.dev0)
Cleaning up...
No distributions matching the version for pure-python-adb-homeassistant
Storing debug log for failure in /home/pi/.pip/pip.log
pi@homepi:~ $ nano /home/pi/.pip/pip.log
pi@homepi:~ $ pip3 install firetv
Downloading/unpacking firetv
Downloading firetv-1.0.9-py3-none-any.whl
Downloading/unpacking pure-python-adb-homeassistant (from firetv)
Could not find a version that satisfies the requirement pure-python-adb-homeassistant (from firetv) (from versions: 0.1.5.dev0, 0.1.5.dev0, 0.1.6.dev0, 0.1.6.dev0, 0.1.7.dev0, 0.1.7.dev0)
Cleaning up...
No distributions matching the version for pure-python-adb-homeassistant (from firetv)
Storing debug log for failure in /home/pi/.pip/pip.log

/home/pi/.pip/pip.log :

/usr/bin/pip run on Mon Aug 5 19:43:53 2019
Downloading/unpacking pure-python-adb-homeassistant
Getting page https://pypi.python.org/simple/pure-python-adb-homeassistant/
URLs to search for versions for pure-python-adb-homeassistant:

Runs, but can't connect

I got the damon running, by using Python 2.7. However there appears to be a change in how the adb library works, and I can't figure out the fix. I even had to add some of my own debugging in the FireTV class to get the error. When the code in connect(self) runs, it throws an error I was able to catch by putting "print serr" after the log line. Here's the result:

pi@lirc-officerack:~ $ sudo firetv-server -d 192.168.0.80:5555
WARNING:root:Couldn't connect to host: 192.168.0.80:5555, error: None
getaddrinfo() argument 2 must be integer or string
 * Serving Flask app "firetv.__main__" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off

Something is clearly happening inside the adb library for argument 2, but I can't find any good documentation on it to figure out what's wrong.

Enhancement: Functionality with Android TV

Any thoughts on what it would take to get it working with Android TV (nvidia shield). I connected to my shield via adb and the "pm dump" and "am start" commands work and I can launch apps by package name from an adb shell via the network. Adding the device ip:port to firetvserver essentially stops it from working at all (the rest interface at least) but i don't get any errors in the console.

Thoughts, ideas on where to start? I already have a fork with the start/stop fixes by juliangeiges and the persistance changes as well.

Thanks!!

Any route with "apps" gives error

Installed on a Raspberry Pi, functioning to the point where I can see two devices with http://192.168.0.110:5556/devices/list and issue media_play_pause commands successfully to both.

Any time I run a route with "apps" on either device I either get an error or it hangs.

Example:

devices:
lr:
host: 192.168.0.113:5555
mbr:
host: 192.168.0.117:5555

Trying to open http://192.168.0.110:5556/devices/lr/apps/running gives

image

sometimes it gives more information:
pi@raspi:~/python-firetv $ firetv-server -c /home/pi/python-firetv/devices.yaml

  • Running on http://0.0.0.0:5556/
    ('Received checksum %s != %s', (84025L, 107203))
    ^C----------------------------------------
    Exception happened during processing of request from ('192.168.0.128', 60683)
    Traceback (most recent call last):
    File "/usr/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock
    self.process_request(request, client_address)
    File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request
    self.finish_request(request, client_address)
    File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
    File "/usr/lib/python2.7/SocketServer.py", line 655, in init
    self.handle()
    File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 200, in handle
    rv = BaseHTTPRequestHandler.handle(self)
    File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
    self.handle_one_request()
    File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 235, in handle_one_request
    return self.run_wsgi()
    File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 177, in run_wsgi
    execute(self.server.app)
    File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 165, in execute
    application_iter = app(environ, start_response)
    File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1836, in call
    return self.wsgi_app(environ, start_response)
    File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
    File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
    File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functionsrule.endpoint
    File "/usr/local/lib/python2.7/dist-packages/firetv/main.py", line 130, in running_apps
    return jsonify(running_apps=devices[device_id].running_apps())
    File "/usr/local/lib/python2.7/dist-packages/firetv/init.py", line 92, in running_apps
    return self._ps('u0_a')
    File "/usr/local/lib/python2.7/dist-packages/firetv/init.py", line 273, in _ps
    self.connect()
    File "/usr/local/lib/python2.7/dist-packages/firetv/init.py", line 61, in connect
    serial=self.host)
    File "/usr/local/lib/python2.7/dist-packages/adb/adb_commands.py", line 87, in ConnectDevice
    return cls.Connect(handle, **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/adb/adb_commands.py", line 110, in Connect
    device_state = cls.protocol_handler.Connect(usb, banner=banner, **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/adb/adb_protocol.py", line 272, in Connect
    cmd, arg0, arg1, banner = cls.Read(usb, ['CNXN', 'AUTH'])
    File "/usr/local/lib/python2.7/dist-packages/adb/adb_protocol.py", line 214, in Read
    msg = usb.BulkRead(24, timeout_ms)
    File "/usr/local/lib/python2.7/dist-packages/adb/common.py", line 303, in BulkRead
    return self._connection.recv(numbytes)
    KeyboardInterrupt

192.168.0.128 - - [08/Jan/2017 18:28:11] "GET /devices/mbr/apps/running HTTP/1.1" 500 -

New release

Hi,

it would be nice to have a new release for pypi after #11 gets merged in, thanks!

Dockerfile does not build on armel

Hi,

I just tried building the Dockerfile on my armel box. It fails to build with the following error:

 ---> 7424d653b82a
Step 4/8 : RUN pip --no-cache-dir install --upgrade pip
 ---> Running in 629f7e46aa78
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 7, in <module>
    from pip import main
  File "/usr/local/lib/python2.7/site-packages/pip/__init__.py", line 5, in <module>
    import logging
  File "/usr/local/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/local/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (

The likely reason is that the FROM image is python:2, which contains a python built from source. The apt-get invocation however installs python packages from Debian.

Unable to run on Alpine Linux

Running into an issue with running this on alpine linux, I found this issue: swig/swig#344 which seems to be related, but am not quite sure the best way to address the problem in the context of this project.

Traceback (most recent call last):
  File "/usr/bin/firetv-server", line 7, in <module>
    from firetv.__main__ import main
  File "/usr/lib/python2.7/site-packages/firetv/__init__.py", line 11, in <module>
    from adb import adb_commands
  File "/usr/lib/python2.7/site-packages/adb/adb_commands.py", line 30, in <module>
    from M2Crypto import RSA
  File "/usr/lib/python2.7/site-packages/M2Crypto/__init__.py", line 24, in <module>
    import ASN1
  File "/usr/lib/python2.7/site-packages/M2Crypto/ASN1.py", line 12, in <module>
    import BIO
  File "/usr/lib/python2.7/site-packages/M2Crypto/BIO.py", line 221, in <module>
    class CipherStream(BIO):
  File "/usr/lib/python2.7/site-packages/M2Crypto/BIO.py", line 227, in CipherStream
    SALT_LEN = m2.PKCS5_SALT_LEN
AttributeError: 'module' object has no attribute 'PKCS5_SALT_LEN'

HDHomeRun Support

Hi,

I received the standard 404 error when sending app open commands for the HDHomeRun app. I traced the program name and cmp activity, and tried multiple combos. I then issued the following on my computer and I was able to open up the HDHomeRun app on my AFTV:

"ssh shell am start -n com.silicondust.view/.MediaCodecPlayer"

I have a subprocess running, and I'm confused on how I can pass that adb command. I imagine it's a simple one-liner, but I'm no expert. I think it sounds like I need to pass this adb command to 127.0.0.1, but I do not know how to do it.

Thanks for your help

pip git install of python-firetv wont complete

I could not install using pip install directly so I tried:

pip install git+https://github.com/happyleavesaoc/python-firetv

This produced the following error and output:

`root@cm0auto00:~# pip install git+https://github.com/happyleavesaoc/python-firetv
Collecting git+https://github.com/happyleavesaoc/python-firetv
Cloning https://github.com/happyleavesaoc/python-firetv to /tmp/pip-hRMgfg-build
Complete output from command python setup.py egg_info:
error in firetv setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-hRMgfg-build/
root@cm0auto00:~# `

yaml.load(config_file) error

got this error on startup with yaml file

    config = yaml.load(config_file)
  File "/usr/lib64/python3.5/site-packages/yaml/__init__.py", line 109, in load
    raise RuntimeError("Unsafe load() call disabled by Gentoo. See bug #659348")
RuntimeError: Unsafe load() call disabled by Gentoo. See bug #659348

this fix works for me:
config = yaml.safe_load(config_file)

Suggestion for adding a systemd file to the readme or the wiki

I added the following to /etc/systemd/system/firetv-server.service

[Unit]
Description=FireTV-Server
After=network.target

[Service]
Type=simple
User=firetv
ExecStart=/home/firetv/firetv/bin/firetv-server -d 192.168.1.45:5555

[Install]
WantedBy=multi-user.target

I then enabled it with:

systemctl daemon-reload
systemctl enable firetv-server
systemctl start firetv-server

No FIreTV entities showing in HA 38.2 running latest version of server

Running 1.0.5 version of firetv-server on [email protected]. Two FireTV boxes, both have ADB/USB debugging on, in same network. (pyyaml installed manually so I could use the -c option) Server loads without an error.

firetv-server config file:

devices:
  bedroom:
    host: 192.168.1.166:5555
  livingroom:
    host: 192.168.1.173:5555

Verify devices at 192.168.1.181:5556 works and shows the following:

{
  "devices": {
    "bedroom": {
      "host": "192.168.1.166:5555", 
      "state": "off"
    }, 
    "livingroom": {
      "host": "192.168.1.173:5555", 
      "state": "idle"
    }
  }
}

All states in update as expected in the browser when changed at the device. (State shown above is correct, livingroom device is currently paused and at the screen saver.)

Config in media_players.yaml (included properly as other media_players showing up fine):

- platform: firetv
    entity_namespace: 'ftv'
    host: 192.168.1.181
    port: 5556

No errors at all in the HA logs. Completely clear. Discovery is enabled.

Absolutely nothing is showing up in dev states panel for any FireTV media_players.

I'm pulling my hair out here because I can't think of anything else that I may have missed. Gone over every post in the forums as well as issues here. No errors in any logs.

Any idea what I may have missed?

Emulate select button, directional buttons

Is there any way to emulate the select button or directional keys of the firetv remote? I can launch an app, and the first tile that is highlighted is the live tv selection. I would like to have a script that launches the app, then after a delay emulate as if the select button had been pressed on the remote. This would launch the live tv portion of that app without any interaction with the remote.

app is HGTV (tv.accedo.hgtv)
running hass 0.50.2
just got firetv-server up and running last night. everything seems to be working correctly.

Device authentication required, no keys available

after update to 1.0.7 still get no connection

connection via adb command line works:

adb connect 192.168.1.22:5555
* daemon not running; starting now at tcp:5037
* daemon started successfully
connected to 192.168.1.22:5555

python3 with adb and adb-homeassistant:

./firetv-server -d 192.168.1.22:5555
Traceback (most recent call last):
  File "./firetv-server", line 11, in <module>
    load_entry_point('firetv==1.0.7', 'console_scripts', 'firetv-server')()
  File "/home/schlobsn/.local/lib64/python3.5/site-packages/firetv/__main__.py", line 246, in main
    if args.default and not add('default', args.default):
  File "/home/schlobsn/.local/lib64/python3.5/site-packages/firetv/__main__.py", line 89, in add
    devices[device_id] = FireTV(str(host), str(adbkey))
  File "/home/schlobsn/.local/lib64/python3.5/site-packages/firetv/__init__.py", line 106, in __init__
    self.connect()
  File "/home/schlobsn/.local/lib64/python3.5/site-packages/firetv/__init__.py", line 119, in connect
    self._adb = adb_commands.AdbCommands().ConnectDevice(**kwargs)
  File "/home/schlobsn/.local/lib64/python3.5/site-packages/adb/adb_commands.py", line 142, in ConnectDevice
    self._Connect(**kwargs)
  File "/home/schlobsn/.local/lib64/python3.5/site-packages/adb/adb_commands.py", line 173, in _Connect
    conn_str = self.protocol_handler.Connect(self._handle, banner=banner, **kwargs)
  File "/home/schlobsn/.local/lib64/python3.5/site-packages/adb/adb_protocol.py", line 318, in Connect
    'Device authentication required, no keys available.')
adb.usb_exceptions.DeviceAuthError: Device authentication required, no keys available.

python3 without adb and only adb-homeassistant:

./firetv-server -d 192.168.1.22:5555
Traceback (most recent call last):
  File "./firetv-server", line 11, in <module>
    load_entry_point('firetv==1.0.7', 'console_scripts', 'firetv-server')()
  File "/usr/lib64/python3.5/site-packages/pkg_resources/__init__.py", line 572, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib64/python3.5/site-packages/pkg_resources/__init__.py", line 2769, in load_entry_point
    return ep.load()
  File "/usr/lib64/python3.5/site-packages/pkg_resources/__init__.py", line 2422, in load
    return self.resolve()
  File "/usr/lib64/python3.5/site-packages/pkg_resources/__init__.py", line 2428, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/schlobsn/.local/lib64/python3.5/site-packages/firetv/__init__.py", line 13, in <module>
    from adb import adb_commands
ImportError: No module named 'adb'

python2 with adb and adb-homeassistant:

./firetv-server -d 192.168.1.22:5555
WARNING:root:Couldn't connect to host: 192.168.1.22:5555, error: None
 * Serving Flask app "firetv.__main__" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off

load_entry_point errors

:~$ firetv-server
Traceback (most recent call last):
File "/usr/local/bin/firetv-server", line 9, in
load_entry_point('firetv==1.0.5', 'console_scripts', 'firetv-server')()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2363, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load
entry = import(self.module_name, globals(),globals(), ['name'])
File "/usr/local/lib/python2.7/dist-packages/firetv/main.py", line 23, in
import yaml
ImportError: No module named yaml

Tried firetv-server -d my device address:5555 still same error message.
pip --version = pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)
Kept running install until all dependencies were met. Device is on and active. ADB works without issue. However cannot get server to run.

Thank you for any assistance.

latest version with -c arguement not on pip

Followed instructions to install and was wondering why the persistence option "-c" was not working but looks like the version installed via pip is from 2016-05-11.

Can this be updated rather than installing manually from github?

Fresh install, not working

Brand new install, on Raspbian. When I run the server, it sends a traceback:

`[18:49:25] openhabian@openHABianPi:/etc/firetv$ firetv-server -d 192.168.0.80:5555

Traceback (most recent call last):
File "/usr/local/bin/firetv-server", line 9, in
load_entry_point('firetv==1.0.7', 'console_scripts', 'firetv-server')()
File "/usr/local/lib/python3.4/dist-packages/firetv/main.py", line 246, in main
if args.default and not add('default', args.default):
File "/usr/local/lib/python3.4/dist-packages/firetv/main.py", line 89, in add
devices[device_id] = FireTV(str(host), str(adbkey))
File "/usr/local/lib/python3.4/dist-packages/firetv/init.py", line 106, in init
self.connect()
File "/usr/local/lib/python3.4/dist-packages/firetv/init.py", line 119, in connect
self._adb = adb_commands.AdbCommands().ConnectDevice(**kwargs)
File "/usr/local/lib/python3.4/dist-packages/adb/adb_commands.py", line 142, in ConnectDevice
self._Connect(**kwargs)
File "/usr/local/lib/python3.4/dist-packages/adb/adb_commands.py", line 173, in _Connect
conn_str = self.protocol_handler.Connect(self._handle, banner=banner, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/adb/adb_protocol.py", line 312, in Connect
data=b'host::%s\0' % banner)
TypeError: unsupported operand type(s) for %: 'bytes' and 'bytes'
`

Device authentication required, no keys available

DEBUG:root:Connecting to device "192.168.123.97:5555"
Traceback (most recent call last):
File "/usr/local/bin/firetv-server", line 11, in
load_entry_point('firetv==1.0.5', 'console_scripts', 'firetv-server')()
File "/usr/local/lib/python2.7/dist-packages/firetv/main.py", line 249, in main
_add_devices_from_config(args)
File "/usr/local/lib/python2.7/dist-packages/firetv/main.py", line 229, in _add_devices_from_config
add(device, config['devices'][device]['host'])
File "/usr/local/lib/python2.7/dist-packages/firetv/main.py", line 84, in add
devices[device_id] = FireTV(str(host))
File "/usr/local/lib/python2.7/dist-packages/firetv/init.py", line 61, in init
self.connect()
File "/usr/local/lib/python2.7/dist-packages/firetv/init.py", line 72, in connect
serial=self.host)
File "/usr/local/lib/python2.7/dist-packages/adb/adb_commands.py", line 76, in ConnectDevice
return cls.Connect(handle, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/adb/adb_commands.py", line 99, in Connect
device_state = cls.protocol_handler.Connect(usb, banner=banner, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/adb/adb_protocol.py", line 288, in Connect
'Device authentication required, no keys available.')
adb.usb_exceptions.DeviceAuthError: Device authentication required, no keys available.

Iโ€™m having the same issue:
https://community.home-assistant.io/t/firetv-server-component-adb-error/38546

pi@raspberrypi:~ $ adb connect 192.168.123.97
daemon not running. starting it now on port 5037 *
daemon started successfully *
connected to 192.168.123.97:5555

Incorrect states

When a video is running (also when paused vie pause or the home key) the API alsways shows "play" which is obviously not correct. Running v. 1.0.2 and latest FireTV-OS.

problem with new firetv uhd dongel

The FireTV Server has a problem with the new FireTV UHD Dongel.
On the FireTV, everything is correct configured but after I start the FireTV Server the Server crashs every time. I also have a normal FireTV Stick, it works with that Stick pritty fine!

Here are the Errors when the Config File contains the IP-Adress of the new FireTV UHD Dongel:
[2017-11-17 18:35:30,460] ERROR in app: Exception on /devices/list [GET]
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functionsrule.endpoint
File "/usr/local/lib/python2.7/dist-packages/firetv/main.py", line 111, in list_devices
'state': device.state
File "/usr/local/lib/python2.7/dist-packages/firetv/init.py", line 86, in state
if not self._screen_on:
File "/usr/local/lib/python2.7/dist-packages/firetv/init.py", line 227, in _screen_on
return self._dump_has('power', 'Display Power', 'state=ON')
File "/usr/local/lib/python2.7/dist-packages/firetv/init.py", line 285, in _dump_has
return self._dump(service, grep=grep).strip().find(search) > -1
File "/usr/local/lib/python2.7/dist-packages/firetv/init.py", line 274, in _dump
return self._adb.Shell('dumpsys {0} | grep "{1}"'.format(service, grep))
File "/usr/local/lib/python2.7/dist-packages/adb/adb_commands.py", line 227, in Shell
timeout_ms=timeout_ms)
File "/usr/local/lib/python2.7/dist-packages/adb/adb_protocol.py", line 376, in Command
return ''.join(cls.StreamingCommand(usb, service, command, timeout_ms))
File "/usr/local/lib/python2.7/dist-packages/adb/adb_protocol.py", line 403, in StreamingCommand
timeout_ms=timeout_ms)
File "/usr/local/lib/python2.7/dist-packages/adb/adb_protocol.py", line 343, in Open
timeout_ms=timeout_ms)
File "/usr/local/lib/python2.7/dist-packages/adb/adb_protocol.py", line 225, in Read
'Unknown command: %x' % cmd, cmd, (arg0, arg1))
InvalidCommandError: ('Unknown command: 4f3d6574', 1329423732, (1279461966, 2639187))
172.17.0.1 - - [17/Nov/2017 18:35:30] "GET /devices/list HTTP/1.1" 500 -

If somebody needs more Information to fix this Problem, please contact me.
If would be great to have the new FireTV Connected to the FireTV-Server

Getting 404 for default device when trying to start or stop an app

Running on raspberry pi, everything else seems to work like status endpoints but when trying to do an action or start/stop an app I get a 404. Which when looking through the source seems to be when a device is not recognised but this confuses me as I am using the default

Example run command

firetv-server -d 192.168.1.4:5555

Example call:

http://192.168.1.18:5556/devices/default/apps/netflix/stop

Installed using pip:

pip show firetv
---
Name: firetv
Version: 1.0.2
Location: /usr/local/lib/python2.7/dist-packages
Requires: adb

USB connection

I'm aiming to use firetv with an Nvidia Shield (which I understand should work fine).

I have my Raspberry Pi connection to my Shield via USB. Adb works fine. But firetv doesn't ... it doesn't find any devices.

Should it be possible to control my Shield using firetv over a USB connection? If so, how?

Failed to establish a new connection: [Errno 111] Connection refused

Hello,

it is expected, that the media_player component in Home Assistant cannot setup, because my Fire TVs are switched off? I mean do I need to verify that all Fire TVs are up & running each service restart? I get that traceback each restart if they are offline:

2018-03-06 14:44:30 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform firetv
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/usr/local/lib/python3.5/dist-packages/urllib3/util/connection.py", line 83, in create_connection
    raise err
  File "/usr/local/lib/python3.5/dist-packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 357, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.5/http/client.py", line 1107, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.5/http/client.py", line 1152, in _send_request
    self.endheaders(body)
  File "/usr/lib/python3.5/http/client.py", line 1103, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
    self.send(msg)
  File "/usr/lib/python3.5/http/client.py", line 877, in send
    self.connect()
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connection.py", line 166, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x6b85dbf0>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 440, in send
    timeout=timeout
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.5/dist-packages/urllib3/util/retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=5544): Max retries exceeded with url: /devices/list (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x6b85dbf0>: Failed to establish a new connection: [Errno 111] Connection refused',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/helpers/entity_platform.py", line 84, in async_setup
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/media_player/firetv.py", line 58, in setup_platform
    DEVICE_LIST_URL.format(proto, host, port)).json()
  File "/usr/local/lib/python3.5/dist-packages/requests/api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=5544): Max retries exceeded with url: /devices/list (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x6b85dbf0>: Failed to establish a new connection: [Errno 111] Connection refused',))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.