/tree-v2

6.5’ white tree with 250 WS2811 RGB LEDs, driven by an ESP8266 microcontroller using the FastLED library, controlled with a web app over WiFi and/or an infrared remote control.

Primary LanguageCGNU General Public License v3.0GPL-3.0

Tree - v2

White xmas tree with 250 8mm WS2811 RGB LEDs, driven with an ESP8266, and controlled via a web app over Wi-Fi and/or IR remote control.

Demo Videos:

Demo Videos

More details and build instructions: https://www.evilgeniuslabs.org/tree-v2.html

Hardware

  • 250 x 8mm WS2811 Addressable RGB LED string
  • WeMos D1 mini pro ESP8266 development board:

WeMos D1 mini pro

Features

  • Turn the LEDs on and off
  • Adjust the brightness
  • Change the display pattern
  • Adjust the color

Web App

Web App Simple Web App

Patterns are requested by the app from the ESP8266, so as new patterns are added, they're automatically listed in the app.

The web app is stored in SPIFFS (on-board flash memory).

The web app is a single page app with separate files for js and css, using jQuery and Bootstrap. It has buttons for On/Off, a slider for brightness, a pattern selector, and a color picker (using jQuery MiniColors). Event handlers for the controls are wired up, so you don't have to click a 'Send' button after making changes. The brightness slider and the color picker use a delayed event handler, to prevent from flooding the ESP8266 web server with too many requests too quickly.

Infrared Remote Control

Control via infrared remote control is also supported, via the ESP8266 port of the IRremote library.

Compiling

Follow the instructions on the following pages to install the required software for your OS (Windows, Linux, Mac):

  1. Install Arduino
  2. Install Arduino core for ESP8266

Download and install the following libraries, using the instructions here: https://www.arduino.cc/en/Guide/Libraries

Download the source code here.

In Arduino, choose the following options from the Tools menu:

  • Board: WeMos D1 R2 & mini
  • Flash Size: 4M (3M SPIFFS)
  • CPU Frequency: 160MHz
  • Upload Speed: 921600

Select the correct port for your board (it's easiest to unplug any other USB serial devices).

Finally, click the Upload button. Please report any errors, problems, questions, etc to the Issue Tracker.

SPIFFS

The web app needs to be uploaded to the ESP8266's SPIFFS. You can do this within the Arduino IDE after installing the Arduino ESP8266FS tool.

With ESP8266FS installed run the sketch and then upload the web app using the ESP8266 Sketch Data Upload command in the Arduino Tools menu.

Compression

The web app files can be gzip compressed before uploading to SPIFFS by running recompress.sh or the following command:

gzip -r data/

The ESP8266WebServer will automatically serve any .gz file. The file index.htm.gz will get served as index.htm, with the content-encoding header set to gzip, so the browser knows to decompress it. The files can be decompressed for editing with this command:

gunzip -r data/

REST Web services

The firmware implements basic RESTful web services using the ESP8266WebServer library. Current values are requested with HTTP GETs, and values are set with POSTs using query string parameters. It can run in connected or standalone access point modes.

Support

Please report any errors, problems, questions, etc to the Issue Tracker.