Skip to content

alimp5/lirc_web

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lirc_web

lirc_web is a nodejs app that creates a web interface & JSON API for the LIRC project. It uses lirc_node to handle communication between LIRC and nodejs.

This project allows you to control LIRC from any web browser - phone, tablet, or desktop. The mobile web interface is responsive and optimized for all sized displays. In addition, with the JSON API, you can control LIRC from any web connected device - pebble watch, myo armband, emotiv EEG headset, or beyond.

This is part of the Open Source Universal Remote project.

Installation

You'll need to have LIRC installed and configured on your machine to use lirc_web. In addition, you'll need to install nodejs. Once you have LIRC and nodejs installed and configured, you'll be able to install lirc_web and it's dependencies:

git clone git://github.com/alexbain/lirc_web.git
cd lirc_web
npm install
node app.js

You're set! Verify the web interface works by opening http://SERVER:3000/ in a web browser.

If you want to have the app available via port 80 and start on boot, there are example NGINX and Upstart configuration files included in the example_configs/ directory.

Configuration

As of v0.0.7, lirc_web will start supporting customization options through a configuration file (config.json) in the root of the project. There is only one available configuration option, but more are expected in future releases:

  1. repeaters - buttons that repeatedly send their commands while pressed. A common example are the volume buttons on most remote controls. While you hold the volume buttons down, the remote will repeatedly send the volume command to your device.
  2. (suggestions welcome)

Example:

{
  "repeaters": {
    "SonyTV": {
      "VolumeUp": true,
      "VolumeDown": true
    }
  }
}

Using the JSON API

Want to build your own app or device that uses lirc_web? No problem - an HTTP API is built in. If the language you are writing your app or device supports HTTP, you're set.

API endpoints:

  • GET /remotes.json - Returns all known remotes and commands
  • GET /remotes/:remote.json - Returns all known commands for remote :remote
  • POST /remotes/:remote/:command - Send :command to :remote one time
  • POST /remotes/:remote/:command/send_start - Begin sending :command
  • POST /remotes/:remote/:command/send_stop - Stop sending :command

Development

Would you like to contribute to and improve lirc_web? Fantastic. To contribute patches, run tests or benchmarks, install lirc_web using the instructions above. Once that is complete, you'll need to setup the development environment.

Now, you'll need to setup the development environment. lirc_web uses the GruntJS built system to make development easier.

Install GruntJS (build environment):

npm install -g grunt-cli
npm install -g grunt-init
grunt server

You may need to reload your shell before continuing so the Grunt binares are detected.

  • grunt will create all of the static assets.
  • grunt server will start a development server (using sample data) and watch all static assets for change

You can run the test suite by running:

make test

Contributing

Before you submit a pull request with your change, please be sure to:

  • Add new tests that prove your change works as expected.
  • Ensure all existing tests are still passing.

Once you're sure everything is still working, open a pull request with a clear description of what you changed and why. I will not accept a pull request which breaks existing tests or adds new functionality without tests.

The exception to this would be refactoring existing code or changing documentation.

License

(The MIT License)

Copyright (c) 2013 Alex Bain <alex@alexba.in>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

About

Control LIRC from the web using NodeJS and lirc_node

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • CSS 81.4%
  • JavaScript 18.6%