Skip to content

Commit

Permalink
Pin noVNC, add balena.yml
Browse files Browse the repository at this point in the history
Change-type: patch
Signed-off-by: Chris Crocker-White <[email protected]>
  • Loading branch information
chrisys committed Dec 16, 2020
1 parent d32664d commit a5e6898
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 9 deletions.
53 changes: 49 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,43 @@
# Fadecandy RGB LED Pixel Controller
# LED Pixel Controller

This project provides a VNC or web-client VNC interface to Glediator, which ultimately allows you to control an array of WS2811 or compatible RGB LED pixels/neopixels via an Adafruit Fadecandy board.

The project is set up and configured to run with a 25x10 matrix based on 5 folded strings of 50 LEDs each. This is entirely configurable, and there's more information in [this blog post](https://www.balena.io/blog/build-festive-lighting-for-the-holidays-with-balena/) that explains how.
---
## Hardware needed
The project has been built to run on Raspberry Pi 3 or 4 and balenaFin.

* 250 5-volt WS2811 LEDs in the form of 5x 50 LED strings - I got mine [from AliExpress](https://www.aliexpress.com/item/32791781404.html) of course, but Amazon and others carry them too.
* A Raspberry Pi 3B/3B+, 4 or balenaFin (others will likely work too, but probably not the Pi Zero for this project)
* SD Card - 8GB is plenty, but go for the Sandisk Extreme Pro
* A 5V power supply - get the [Mean Well LRS-100-5](https://www.digikey.co.uk/product-detail/en/mean-well-usa-inc/LRS-100-5/1866-3318-ND/7705010)
* An [Adafruit Fadecandy board](https://www.amazon.co.uk/Adafruit-FadeCandy-Dithering-Controlled-Neopixel/dp/B00K9M3VLE)
* [LED string connectors](https://www.amazon.co.uk/MENGCORE%C2%AE-20Pair-20sets-Connector-WS2812B/dp/B01DF0UL8C/ref=pd_bxgy_147_2/258-7672630-7267061) - you can just solder the wires but the connectors are nice for modularity
* Optionally, if you want to print your own case, a 3D printer or 3D printing service to print [the case](https://www.thingiverse.com/thing:3297031) - recommended!


---
## Assembly and building

A full [blog post is published here](https://www.balena.io/blog/control-your-christmas-tree-a-raspberry-pi-powered-rgb-led-matrix-v2/) with a complete tutorial on assembly and setup.

---

## Deployment

This project has been built to be deployed to balenaCloud in order to enable remote access from anywhere and management of multiple devices and updates.

Get started deploying all the software you need by clicking the button below.

**Note:** this project includes freely available software (Glediator) from [solderlab.de](https://solderlab.de). At the time of writing the site is currently down and so we have mirrored the download within this project. This will be removed upon request by the author or when the site comes back online.
[![](https://balena.io/deploy.svg)](https://dashboard.balena-cloud.com/deploy?repoUrl=https://github.com/balena-io-playground/internetspeedtest)

The deployment process will ask you to sign up or sign in to balenaCloud, and then add a device to the application. This will automatically set up your device with all the software required.

---
## Customization

### Different matrix sizes
The project is set up and configured to run with a 25x10 matrix based on 5 folded strings of 50 LEDs each. This is entirely configurable, and there's more information in [this blog post](https://www.balena.io/blog/build-festive-lighting-for-the-holidays-with-balena/) that explains how.

### Scheduler

What good is a light controller if you can’t schedule a simple on and off time?! Set the device service variables below for the `glediator` service within the balenaCloud dashboard to enable automated switching of the lighting. This works by toggling the output of Glediator on and off, so although the device itself will stay powered on and online, the LEDs themselves will turn on and off.
Expand All @@ -22,4 +52,19 @@ After you've set your on and off time, set `ENABLE_TIMER` to `1` to enable the t

### Timezone

In order for the scheduler to work correctly, you'll of course have to tell the device what timezone you'd like to use. Set the `TZ` environment variable to any [IANA timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones), e.g. `Europe/London`, `America/Los_Angeles`, `Asia/Taipei` etc.
In order for the scheduler to work correctly, you'll of course have to tell the device what timezone you'd like to use. Set the `TZ` environment variable to any [IANA timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones), e.g. `Europe/London`, `America/Los_Angeles`, `Asia/Taipei` etc.

---

## Credits

This project is made possible by some great free software, both in terms of usage and inspiration:
* [Fadecandy](https://github.com/scanlime/fadecandy)
* [Glediator](https://solderlab.de)
* [noVNC](https://github.com/novnc/noVNC)
* [openpixelcontrol](https://github.com/zestyping/openpixelcontrol)
* [Fadecandy with Glediator](https://github.com/chunk100/Glediator-with-Fadecandy)

Amongst a lot of other supporting software, too!

**Note:** this project includes freely available software (Glediator) from [solderlab.de](https://solderlab.de). At the time of writing the site is currently down and so we have mirrored the download within this project. This will be removed upon request by the author or when the site comes back online.
21 changes: 21 additions & 0 deletions balena.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: "2"
slug: "fadecandy-led-controller"
name: "LED Pixel Controller"
type: "sw.application"
assets:
- url: "https://github.com/balenalabs-incubator/fadecandy-led-controller"
name: "repository"
- url: "https://raw.githubusercontent.com/balenalabs-incubator/fadecandy-led-controller/master/logo.png"
name: "logo"
data:
description: "Remotely control and program configurable RGB LED pixel matrices, strings, trees, and more with this handy all-in-one setup."
applicationEnvironmentVariables:
- ENABLE_TIMER: 0
- TIMER_ON: '0 9 * * *'
- TIMER_OFF: '0 2 * * *'
- TZ: 'Europe/London'
defaultDeviceType: "raspberrypi3"
supportedDeviceTypes:
- "raspberrypi3"
- "raspberrypi4-64"
- "fincm3"
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion vnc/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ RUN install_packages \
git

# Pull down noVNC
RUN git clone https://github.com/novnc/noVNC
RUN curl -LO https://github.com/novnc/noVNC/archive/v1.2.0.tar.gz
RUN tar xfzv v1.2.0.tar.gz
RUN mv noVNC-1.2.0 noVNC

# Copy over script
COPY ./start.sh ./
Expand Down
4 changes: 0 additions & 4 deletions vnc/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@
# Rename the files to allow for default connection html page
ln -s /noVNC/vnc.html /noVNC/index.html

# Change the default quality and compression (this is available in UI but not on startup it seems)
sed -i 's/this._qualityLevel = 6;/this._qualityLevel = 2;/g' /noVNC/core/rfb.js
sed -i 's/this._compressionLevel = 2;/this._compressionLevel = 0;/g' /noVNC/core/rfb.js

# Start noVNC
exec /noVNC/utils/launch.sh --vnc 172.20.0.4:5900 --listen 80

0 comments on commit a5e6898

Please sign in to comment.