It is NodeMcu and WS2812 LED Strip "hello world" project.
After power on strip shows some different effects in random order:
Each cycle (length of LED strip) changeing fill method.
- rainbow (smooth color change)
- waterfall (random color for each led)
- solid (one random color)
- sometimes runs "dead pixels" (about 1 time for cycle)
- sometimes strip flow revercing
- Install drivers for CH340. For macos sierra use this driver
- Go to https://nodemcu-build.com and build firmware with modules: file, gpio, net, node, timer, uart, wifi, ws2801 You can build firmware with Docker (see above):
- Flash float version of binary. Crossplatform way (replace port and path to firmware to yours):
pip install esptool
esptool.py --port /dev/tty.wchusbserial1450 write_flash 0x00000 ~/projects/esp8266/nodemcu-firmware/bin/nodemcu_float_master_20161210-1855.bin
At step 2 from setup NodeMcu, if you build firmwares frequently, more faster way to do it is build you own.
- Clone nodemcu-firmware:
git clone https://github.com/nodemcu/nodemcu-firmware.git
- Go to
nodemcu-firmware/app/include/user_modules.h
and comment/uncomment needed modules - Build firmware (replace path to nodemcu-firmware):
docker run --rm -ti -v /Users/popstas/projects/esp8266/nodemcu-firmware:/opt/nodemcu-firmware marcelstoer/nodemcu-build
Firmwares integer and float will be placed at nodemcu-firmware/app/bin, flash float version.
Ajust some variables at start.lua
Easiest way: use ESPlorer, open each file and press "Save to ESP"
- init.lua - proxy file, need for disable script execution if needed. Just send any data to serial port in first 1 second for stop script.
- start.lua - main file, just includes other scripts.
- color_functions.lua - rgb <--> hsl convert
- ws2812_functions.lua - clean functions for ws2812
- ws2812.lua - led strip scripts