The software runs on the ESP8266. The web app is stored in SPIFFS (on-board flash memory). I've forked [jasoncoon's esp8266 fastled webserver](https://github.com/jasoncoon/esp8266-fastled-webserver) and added some extra functionality, made a proper config area and created custom patterns for the lamp.
Amazon Alexa support and Node-RED integration will follow soon.
**The software can be found on [GitHub](https://github.com/NimmLor/esp8266-fastled-desk-light).**
For beginners I would recommend watching this setup tutorial below.
## 1. Programming Environment
1. The code requires an installed version of **Arduino IDE 1.8.8** which can be downloaded [here]( https://www.arduino.cc/en/Main/OldSoftwareReleases#previous ).
2. The ESP8266 boards need to be added to the Arduino IDE:
Click on *File >> Preferences* and paste the URL "http://arduino.esp8266.com/stable/package_esp8266com_index.json" into the **Additional Boards Manager URLs** field.
1. Download the Project from the [Releases at Github]( https://github.com/NimmLor/esp8266-fastled-desk-light/releases ) and extract the archive
2. Open the **.ino** file inside the folder in the Arduino IDE
3. Create the **Secrets.h** file
*Top Right Corner >> New Tab >> "Secrets.h"*
![](software_screenshots/newtab.png?raw=true)
4. Paste the following code and fill in your WiFi credentials
```c++
// AP mode password
const char WiFiAPPSK[] = "your-password";
// Wi-Fi network to connect to (if not in AP mode)
char* ssid = "your-ssid";
char* password = "your-password";
```
![](software_screenshots/secret.png?raw=true)
5. Configure the parameters
In the .ino file there are many parameters to change and tweak the essential settings are:
-`DATA_PIN`: The pin where the LED-Strip is connected
-`LED_TYPE`: The type of LED strip that is used (WS2812B, WS2811, ...)
-`COLOR_ORDER`: Ordering of the colors sent, **depends on the LED-Strip**, if colors are swapped, then swap the Letters (RGB, RBG, GRB, GBR, BRG, BGR)
-`LEDS_PER_LINE`: Amount of LEDs inside **1x** slot of the core
-`SOUND_REACTIVE`: Uncomment to enable a sound reactive pattern when using a sound sensor
-`SENSOR_TYPE`: Model of the [Sensor](http://s.click.aliexpress.com/e/_sYiUrz) used
-`ENABLE_ALEXA_SUPPORT`: Uncomment to disable the Amazon Alexa Support
![](software_screenshots/config.png?raw=true)
6. (Optional) Configure Alexa
- Installation of the **Espalexa** library required
- Requires `ENABLE_ALEXA_SUPPORT`
- The name of the device is set in the variable `ALEXA_DEVICE_NAME`
- Configuration of addition Devices
- In order to control more parameters, the code allows to create additional devices that control, i.e. a specific pattern or the autoplay functionality
- To make use of these features remove the `//` in front of the `#define ...`
1. Configure the upload settings in **Tools** menu, there are **3 essential settings**
- **Board: LOLIN(WEMOS) D1 R2 & mini**: when using the recommended Wemos D1 Mini
- **Flash Size: "4MB (FS:1MB OTA:~1019KB)"**
- **Port:** COMxx, if there are multiple ports, then replug your esp8266 to find the correct port. (**Hint:** COM1 is usually your PCs internal parallel port and not the esp8266)