/ledcontroller

Firmware for an esp8266 based LED strip controller (ws2812), written in Lua (nodemcu)

Primary LanguageLuaMIT LicenseMIT

Ledcontroller

An esp8266 based controller for ws2812 LED strips, written in Lua.

Development

Setup

1 These tools should be installed globally.

Install as follows:

$ npm install -g gulp
$ npm install -g nodemcu-tool
$ pip install nodemcu-uploader
$ pip install esptool

2 Then install other dependencies locally by running:

$ npm install

Upload the NodeMCU firmware

Just run:

$ ./flash.sh

Upload the files for the LED controller

Just run:

$ gulp

This will copy over all Lua files in src to the esp8266. If you run this command again it will only copy files that have been changed.

Run a Lua script from the bash prompt

There are two kinds of script that are invocable from the the bash prompt: commands and patterns. Both are stored in there respective folders. To run a script inside the 'command' folder, you can run:

$ ./run.sh <command>

To run a script inside the 'pattern' folder, you can run:

$ ./pattern.sh <command>

More

Here a few more things you can do:

Remove *.lc files from the esp8266

  $ ./remove_lc.sh 

Copy over all Lua files in src, changed or not

  $ gulp all

Reset the synchroniztion cache

Deletes all files in 'dist'.

  $ gulp clean # 

Fast dev cycle

Does the following 3 things in order:

  1. copy modified files to esp8266
  2. reboot esp3266
  3. open serial connection to esp8266
$ ./cycle.sh

Lint your code Runs luacheck on your Lua files

$ gulp lint