Giter Site home page Giter Site logo

ht-menulet's Introduction

ht-menulet

A home theatre menulet to control devices over REST APIs.

Since my blu-ray player (OPPO) came with an app to control it, I figured It would be easy to reverse engineer the communication and be able to control it from my mac instead of my phone.

I set up a proxy on my laptop, configured my phone to use it, and used tcpdump to sniff all the HTTP calls the app was making. Realizing it was using a REST-like API, it was very easy to imitate.

For example, one of the calls was:

GET /sendremotekey?%7B%22key%22%3A%22RET%22%7D HTTP/1.1

Which curl can easily do:

curl -G 10.0.0.49:436/sendremotekey --data-urlencode {\"key\":\"OPEN\"}

And the tray opens! And then it was a simple google search to get all the possible commands. From there, I decided to build a menulet that will let me control the device with my own interface.

The code is written in a modular fashion to allow extensions to other devices. A long term goal includes integrating with a raspberry pi that would has an IR transciever to allow controlling every device with a remote.

I later discovered that the Roku has a similar interface and I could reverse engineer it as well. This portion is not yet complete but has the groundwork for it. For example, here's a sample program that will send the Roku the letters you write:

#/bin/bash

MyString=$1
echo $MyString | awk -v ORS="" '{ gsub(/./,"&\n") ; print }' | \ 
while read char
do
  curl -X POST 192.168.1.14:8060/keypress/Lit_$char
done

ht-menulet's People

Watchers

Zaid Kokaja avatar  avatar

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.