This is a python3 script for Android TV and Google TV remote control.
It uses the newer protocol of remote services version >= 5
Check on your Android TV device the Remote Services
version (in Settings > Apps > See all apps > Android TV Remote Service).
The version should be >= 5.
This script runs on a Reaspberry Pi to control an Android TV.
It can accept keycodes via a http connection and will pass these on to the Android TV or Box.
To install, follow these steps:
Goto home directory, clone this git and make the script executable
cd ~
git clone https://github.com/rvk01/android_tv_remote.git``
cd android_tv_remote
chmod +x android_tv_remote.py
Run the script one first time to create client.pem (certificate) and server.txt (chosen device)
./andoid_tv_remote.py
Choose your device and check if everything works correctly.
Install, enable and start the script as service
sudo cp atvr.service /etc/systemd/system/atvr.service
sudo systemctl enable atvr.service
sudo systemctl start atvr.service
You can now browse to http://ip_of_your_device:6468/index (or /index0 for all keys) for a small http remote to test page.
View messages from the script (-f is follow output live)
journalctl -u -f atvr
to be done
This project wouldn't have been possible without these awesome projects which reverse-engineered these protocols.
- Aymkdn's wiki on the protocol Remote Control (v2)
- louis49's androidtv-remote js implementation (especially for the v2 proto files)