Initial commit with Arduino and client
This commit is contained in:
@@ -9,6 +9,69 @@
|
||||
- A WS2811 or WS2812 led strip that you can get in many sizes and forms. I'm using a ring of 12 leds. When you use more than about 15-20 leds you may have to use a dedicated 5V power source.
|
||||
- Power via USB
|
||||
|
||||
## Wiring
|
||||
|
||||
Fritzing:
|
||||
|
||||
Parts via:
|
||||
- https://github.com/squix78/esp8266-fritzing-parts
|
||||
- https://github.com/adafruit/Fritzing-Library/
|
||||
|
||||
## Software installation
|
||||
You need to complete the following steps to build your development environment that enables you to flash the Mc Lighting software to the ESP8622.
|
||||
|
||||
### Arduino Software (tested with 1.6.8)
|
||||
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
|
||||
--> arduino_preferences.png
|
||||
|
||||
Go to "Tools" > "Board: <some board>" > "Boards Manager ...", search for "esp" and install the "esp8266 by ESP8266 Community" in version 2.2.0 (https://github.com/esp8266/Arduino):
|
||||
--> arduino_boards_manager.png
|
||||
|
||||
Now go to "Tools" > "Board: <some board>" and choose "NodeMCU 1.0 (ESP-12E Module)", set CPU frequency to 80 MHz, and Flash size to "4M (1M SPIFFS)"leave upload spped at 115200. Select the right COM port.
|
||||
|
||||
### Used Libraries
|
||||
Go to "Sketch" > "Include Library" > "Manage LIbraries ..." and install the following libraries by searching for them and installing:
|
||||
- WiFiManager by @tzapu (tested with version 0.11.0)
|
||||
https://github.com/tzapu/WiFiManager
|
||||
- WebSockets by @Links2004 (tested with version 2.0.2)
|
||||
https://github.com/Links2004/arduinoWebSockets
|
||||
- Adafruit NeoPixel by @adafruit (tested with 1.0.5)
|
||||
https://github.com/adafruit/Adafruit_NeoPixel
|
||||
|
||||
The sketch also uses the following built-in library:
|
||||
- Ticker by @igrr
|
||||
|
||||
Parts of the code were taken or inspired by the following sources:
|
||||
- HSB3RGB conversion
|
||||
https://blog.adafruit.com/2012/03/14/constant-brightness-hsb-to-rgb-algorithm/
|
||||
- TV simulator logic inspired by @BulldogLowell
|
||||
https://github.com/BulldogLowell/PhoneyTV
|
||||
- SPIFS Webserver by Hristo Gochkov
|
||||
https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266WebServer/examples/FSBrowser
|
||||
|
||||
Thank you to all the authors for distributing their software that way.
|
||||
I hope I didn't miss any sources and mentioned every author. In case I forgot someone please let me know and I will fix it.
|
||||
|
||||
### 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:
|
||||
```c
|
||||
// Neopixel
|
||||
#define PIN 5 // PIN where neopixel / WS2811 strip is attached
|
||||
#define NUMLEDS 12 // Number of leds in the strip
|
||||
|
||||
#define HOSTNAME "ESP8266_01" // Friedly hostname
|
||||
```
|
||||
|
||||
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" (or by clicking the right arrow in the tool bar).
|
||||
|
||||
## Todos
|
||||
- [x] Fix issue with websockets connection problems
|
||||
- [ ] Switch to the [NeoPixelBus library](https://github.com/Makuna/NeoPixelBus/wiki)
|
||||
@@ -23,4 +86,4 @@
|
||||
|
||||
|
||||
|
||||
*More information will be added as soon as I clean up the code.*
|
||||
*More information will be added as soon as I clean up the code and complete documentation.*
|
||||
|
||||
Reference in New Issue
Block a user