Skip to content
This repository was archived by the owner on Apr 28, 2022. It is now read-only.

Software installation

Tobias Blum edited this page Jan 20, 2019 · 39 revisions

You need to complete the following steps to build your development environment that enables you to flash the Mc Lighting software to the ESP8622.

For instructions to setup McLighting using PlatformIO, see here: https://youtu.be/7axaXO8cFo8

Arduino Software (tested with 1.8.5)

Download and install the arduino software (IDE) at https://www.arduino.cc/en/Main/Software

ESP8266 board support for arduino IDE

In the Arduino IDE open the preferences dialog and enter the following URL as "Additional Boards Manger URL": http://arduino.esp8266.com/stable/package_esp8266com_index.json Preferences

Go to "Tools" > "Board: " > "Boards Manager ...", search for "esp" and install the "esp8266 by ESP8266 Community" in version 2.4.1 (https://github.com/esp8266/Arduino): Preferences

Now go to "Tools" > "Board: " and choose "NodeMCU 1.0 (ESP-12E Module)", set CPU frequency to 80 MHz, and Flash size to "4M (1M SPIFFS)" leave upload speed at 115200 (you could try to set it higher if it makes no problems). Select the right COM port.
Set "IwIP Variant" to "v2 Higher Bandwidth".

Note for ESP-01 users (boards with only 512k of memory):
Have a look here. User @carlymx has provided detailed instructions.

Board settings

Used Libraries

Go to "Sketch" > "Include Library" > "Manage Libraries ..." and install the following libraries by searching for them and installing:

Compiling and upload

Now open the MC Lighting Arduino sketch in the IDE via "File" > "Open ...". Have a look at the "definitions.h" and change the values here to fit your setup:

// Neopixel
#define PIN 5         // PIN where neopixel / WS2811 strip is attached
#define NUMLEDS 24    // Number of leds in the strip

const char HOSTNAME[] = "McLighting01";   // Friedly hostname

#define HTTP_OTA             // If defined, enable ESP8266HTTPUpdateServer OTA code
//#define ENABLE_OTA         // If defined, enable Arduino OTA code
#define ENABLE_AMQTT         // If defined, enable Async MQTT code
//#define ENABLE_MQTT        // If defined, enable MQTT client code

If you don't want to use Arduino OTA or ESP8266HTTPUpdateServer functionality, comment or delete the "HTTP_OTA" and "ENABLE_OTA" line, e.g. //#define ENABLE_OTA.

If you don't want to use MQTT functionality, comment or delete the "ENABLE_AMQTT" and "ENABLE_MQTT" line, e.g. //#define ENABLE_AMQTT. Make sure that you set a unique mqtt_clientid for each McLighting.

Now you have done everything to get all the dependencies. You should now be able to build the software by choosing "Sketch" > "Verify / Compile" (or clicking the tick mark in the tool bar).

Please verify that you have connected the ESP board correctly to your computer via USB and that the correct COM port is chosen.

Now you should be able to upload the compiled sketch to the board via "Sketch" > "Upload" (hit "Ctrl + U" or by clicking the right arrow in the tool bar). This could take a while for the first compilation.

Connecting to your WiFi

The next step is to connect the ESP8266 to your wifi. The project uses the great WiFiManger library to provide a captive portal.

The steps are shown in detail here: https://github.com/tzapu/WiFiManager#how-it-works

I also created a little video that shows the steps:
Captive Portal

If you have eabled MQTT-API you should enter your credentials here.

In short words:

  • Start up your ESP8266, the little LED on the module should blink now and the LEDs should all green.
  • The ESP8266 opens up a new WiFi Network with the name you provided in the definitions.h.
  • Connect your PC or Smartphone to the Wifi and follow the steps to provide your WiFi credentials.
  • The ESP8266 restarts and should be reachable via it's name or IP (have a look at the debug output in the Arduino software).

Upload the webpage to the SPIFFS filesystem

Next step is to upload the webpages to the ESP8266. This is done that way:

  1. Go to http://YOUR_ESP8266_HOSTNAME_OR_IP/upload.
  2. A simple upload form should appear.
  3. Upload the index.htm from the "McLighting\clients\web\build" directory. You should see a blank page as a result.
  4. Optional: Upload the edit.htm.gz to get a editor for your filesystem via http://YOUR_ESP8266_HOSTNAME_OR_IP/upload.

If upload doesn't work, please check if your setting for "Flash size" in the Arduino IDE is correct (at least 128K SPIFFS size).

Alternatively you can upload the files via this PlugIn: https://github.com/esp8266/arduino-esp8266fs-plugin

Clone this wiki locally