Giter Site home page Giter Site logo

gordonturner / stupid-remote Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 1.0 1.2 MB

A web app to control devices over HDMI-cec, turning tvs on and off, switching inputs adjusting volume.

License: GNU General Public License v3.0

JavaScript 99.03% CSS 0.20% HTML 0.78%

stupid-remote's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

the-evil-bert

stupid-remote's Issues

Couple observations after installing this

Hi there,

Firstly, thank you for making this app. It's really cool!

I'm using it to turn on my TV when I want to airplay music to Kodi through my stereo (which due to how my setup is done is connected to the TV's audio out).

You might also be interested in http://kodi.wiki/view/Add-on:Kodi_Callbacks

I'm using it to look at syslog events, and do an action on matching when I start playing something via airplay to kodi. With the action field, I'm calling http://osmc:8080/cec/tvOn which so far is working well!

Just wanted to point out a couple things I had to do to get this working.

Firstly, it's missing "sleep" from "node_modules". I'll get to instructions for anyone reading later

To get this working on my raspberry pi, I needed to:

Install required apps

sudo apt-get install node npm nodejs
sudo npm install -g --unsafe-perm  node-gyp@latest
sudo npm install -g --unsafe-perm  npm@latest

I then attempted to run as per instructions, however it would fail due to missing node_module "sleep":

osmc@osmc:~/stupid-remote-3.0$ DEBUG=* node ./bin/www


 express:router use /cec router +0ms
  express:router:layer new /cec +1ms
module.js:487
    throw err;
    ^

Error: Cannot find module 'sleep'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/osmc/stupid-remote-3.0/routes/macro.js:7:13)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
osmc@osmc:~/stupid-remote-3.0$ npm install sleep

> [email protected] install /home/osmc/stupid-remote-3.0/node_modules/sleep
> node-gyp rebuild

gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack     at getNotFoundError (/usr/local/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack     at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack     at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Linux 4.9.29-8-osmc
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/osmc/stupid-remote-3.0/node_modules/sleep
gyp ERR! node -v v8.2.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/osmc/.npm/_logs/2017-07-28T06_20_07_433Z-debug.log

As I've only first used node etc for the first time a week ago, I went digging for what I needed to do to get things working.

The short story is I first tried to install sleep globally to node using npm. However this I found was failing due to other missing requirements. Specifically, "make" and "g++".

So to solve this I:

sudo apt-get install make g++

Attempting to install sleep again worked:

sudo npm install --unsafe-perm --verbose -g sleep

However, for some reason stupid-remote didn't seem to just pick this up from the global node library, and I did the following to get it to work:

osmc@osmc:~/stupid-remote-3.0$ cd node_modules/
osmc@osmc:~/stupid-remote-3.0/node_modules$ npm install sleep

> [email protected] install /home/osmc/stupid-remote-3.0/node_modules/sleep
> node-gyp rebuild

make: Entering directory '/home/osmc/stupid-remote-3.0/node_modules/sleep/build'
  CXX(target) Release/obj.target/node_sleep/sleep.o
  SOLINK_MODULE(target) Release/obj.target/node_sleep.node
  COPY Release/node_sleep.node
make: Leaving directory '/home/osmc/stupid-remote-3.0/node_modules/sleep/build'
npm notice created a lockfile as package-lock.json. You should commit this file.
+ [email protected]
added 2 packages in 24.823s
osmc@osmc:~/stupid-remote-3.0/node_modules$

Finally at this point I was able to get it working :-)

I don't understand node enough to do a Pull Request and submit the "sleep" module, but perhaps you could add it yourself so it works out of the box for anyone else trying this.

Thanks,

Matt

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.