Skip to content

Latest commit

 

History

History
108 lines (90 loc) · 5.64 KB

README.md

File metadata and controls

108 lines (90 loc) · 5.64 KB

logo

RPiLC - The home for your RGB LEDs

GitHub package version GitHub (pre-)release Dependency Status

RPiLC allows you to control multiple RGB LEDs from a single server that can be run on one Raspberry Pi. it is also possible to run RPiLC Server on any machine that can run Node.js and connect RPiLC instances in remote mode to this server.

Imgur

Feature Description
🤹‍♀️ Control multipale RGB Leds from one server Brings all your LEDs to one place
🌐 Remote Mode Option to run the app in remote mode, Allows you to control your RGB LED from a RPiLC server
🏠 MQTT Support for Home Assistant Option to enable MQTT, works with Home Assistant's MQTT Discovery
🚦 Live Color Preview Watch the color change as you move the color picker
📲 Touch friendly The app was designed to be comfortable to use on any device
Client themes Make your RPiLC client match your style!
🕒 Recent Colors Choose a color from a list of recently used colors
Cycle Colors Select colors to cycle, choose transition effect
📱 iOS web app Add RPiLC to your home screen and use it like a normal app
🌐 Web Client Use RPiLC from any modern browser
🔄 Updater Get updates for RPiLC through the web client (Experimental)
API Interact with RPiLC via the API

Prerequisites

In order to use RPiLC you need:

  • A Raspberry Pi.
  • Node.js version 8.0.0 or newer installed (you can follow this to install the latest Node.js version on your Pi).
  • Pigpio C library (Version V41 or higher)
  • Python-setuptools & Python3-setuptools (required for Pigpio)
  • RGB led strip connected to the Pi's GPIO (you can follow this guide for wiring)

Install RPiLC on your Pi

1. Get the files

Get the latest release from here and extract it to a new folder, or do:

git clone https://github.com/Winor/RPiLC

2. Install dependencies

cd RPiLC
npm install

3. Run

Note that in order to run RPiLC, the app has to be ran with root privilags so it can have accsess to the Pi's GPIO.

sudo node index.js

4. Configure

Visit http://127.0.0.1 in your browser and configure the app to match your setup. (You can also edit config.json manually after it is generated by the app)

4.1 Pi GPIO settings

Specify the Pin number you used to connect each color channel to your Raspberry Pi GPIO, add new device for more RGB Leds. ("Use Pi GPIO" option must be checked in Backend settings)

4.2 Backend settings

Server port: the port for the server to run on (use 80 for default http port)

Server Mode:

  • Local Server: Run RPiLC as server, you must have one RPiLC instance running at that mode.
  • Remote: This option will run RPiLC as a Client. When selecting this mode, the rest of the Backend settings will be ignored and you will have to specify Server URL in the Remote Setings section. (the server must allow remote SIO devices)

4.3 Remote Setings

  • Server URL: will only take effect when running in remote mode, enter the URL of the machine running RPiLC Server. (for example: http://192.178.1.0)

Run RPiLC on startup using pm2

You can start RPiLC on startup by following these steps:

1. Install pm2

Note that in order to run RPiLC on startup, pm2 has to run the app as root so RPiLC can get accsess to the Pi's GPIO.

sudo npm install pm2@latest -g

2. Add RPiLC to pm2

cd [RPiLC location]
sudo pm2 start index.js --name RPiLC

3. Make pm2 run on startup

sudo pm2 startup

API

Use HTTP get requests to interact with your LED Devices, for example http://127.0.0.1/api/local-0/setcolor/blue will set the LED strip color to blue. Every request will return device info in JSON format.

Location Description
/api Returns array of devices by name and ID
/api/{deviceid} Returns object with device info
/api/{deviceid}/toggle Turns the Device on/off depending on the state
/api/{deviceid}/toggle/on Turns the Device on
/api/{deviceid}/toggle/off Turns the Device off
/api/{device}/setcolor/{color} Set the Device color to a specific color, accepts hex value, rgb(x, x, x) and color name
/api/group/{group}/setcolor/{color} Set all Devices within the same group to a specific color

Resources