gordonturner / stupid-remote Goto Github PK
View Code? Open in Web Editor NEWA web app to control devices over HDMI-cec, turning tvs on and off, switching inputs adjusting volume.
License: GNU General Public License v3.0
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
¿Where can i adjust volume?
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.