commit
af1a8c9908
6 changed files with 39 additions and 7 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -8,3 +8,5 @@ lib/readme.txt
|
|||
*.h.gch
|
||||
.clang_complete
|
||||
.gcc-flags.json
|
||||
|
||||
.vscode/*
|
|
@ -52,6 +52,12 @@
|
|||
WiFiEventHandler wifiDisconnectHandler;
|
||||
#endif
|
||||
|
||||
#ifdef ARDUINOJSON_VERSION
|
||||
#if !(ARDUINOJSON_VERSION_MAJOR == 6 and ARDUINOJSON_VERSION_MINOR == 6)
|
||||
#error "Install ArduinoJson v6.6.0-beta"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// Instanciate HTTP(80) / WebSockets(81) Server
|
||||
|
@ -317,11 +323,15 @@ void setup() {
|
|||
|
||||
// Uncomment if you want to restart ESP8266 if it cannot connect to WiFi.
|
||||
// Value in brackets is in seconds that WiFiManger waits until restart
|
||||
//wifiManager.setConfigPortalTimeout(180);
|
||||
#ifdef WIFIMGR_PORTAL_TIMEOUT
|
||||
wifiManager.setConfigPortalTimeout(WIFIMGR_PORTAL_TIMEOUT);
|
||||
#endif
|
||||
|
||||
// Uncomment if you want to set static IP
|
||||
// Order is: IP, Gateway and Subnet
|
||||
//wifiManager.setSTAStaticIPConfig(IPAddress(192,168,0,128), IPAddress(192,168,0,1), IPAddress(255,255,255,0));
|
||||
#ifdef WIFIMGR_SET_MANUAL_IP
|
||||
wifiManager.setSTAStaticIPConfig(IPAddress(_ip[0], _ip[1], _ip[2], _ip[3]), IPAddress(_gw[0], _gw[1], _gw[2], _gw[3]), IPAddress(_sn[0], _sn[1], _sn[2], _sn[3]));
|
||||
#endif
|
||||
|
||||
//fetches ssid and pass and tries to connect
|
||||
//if it does not connect it starts an access point with the specified name
|
||||
|
@ -415,6 +425,10 @@ void setup() {
|
|||
// ***************************************************************************
|
||||
// Configure MQTT
|
||||
// ***************************************************************************
|
||||
#ifdef ENABLE_MQTT_HOSTNAME_CHIPID
|
||||
snprintf(mqtt_clientid, 64, "%s-%08X", HOSTNAME, ESP.getChipId());
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_MQTT
|
||||
if (mqtt_host != "" && atoi(mqtt_port) > 0) {
|
||||
snprintf(mqtt_intopic, sizeof mqtt_intopic, "%s/in", HOSTNAME);
|
||||
|
@ -1007,6 +1021,7 @@ void loop() {
|
|||
exit_func = false;
|
||||
}
|
||||
#endif
|
||||
if (prevmode == SET_MODE) prevmode = HOLD;
|
||||
}
|
||||
#ifdef ENABLE_LEGACY_ANIMATIONS
|
||||
if (mode == TV) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//#define USE_WS2812FX_UART // Uses PIN is ignored & set to D4/GPIO2 Uses WS2812FX, see: https://github.com/kitesurfer1404/WS2812FX
|
||||
|
||||
// Neopixel
|
||||
#define PIN D1 // PIN (14 / D5) where neopixel / WS2811 strip is attached
|
||||
#define PIN 14 // PIN (14 / D5) where neopixel / WS2811 strip is attached
|
||||
#define NUMLEDS 24 // Number of leds in the strip
|
||||
#define BUILTIN_LED 2 // ESP-12F has the built in LED on GPIO2, see https://github.com/esp8266/Arduino/issues/2192
|
||||
#define BUTTON 4 // Input pin (4 / D2) for switching the LED strip on / off, connect this PIN to ground to trigger button.
|
||||
|
@ -18,6 +18,15 @@ const char HOSTNAME[] = "McLighting01"; // Friedly hostname
|
|||
//#define MQTT_HOME_ASSISTANT_SUPPORT // If defined, use AMQTT and select Tools -> IwIP Variant -> Higher Bandwidth
|
||||
#define ENABLE_LEGACY_ANIMATIONS
|
||||
|
||||
//#define WIFIMGR_PORTAL_TIMEOUT 180
|
||||
//#define WIFIMGR_SET_MANUAL_IP
|
||||
|
||||
#ifdef WIFIMGR_SET_MANUAL_IP
|
||||
uint8_t _ip[4] = {192,168,0,128};
|
||||
uint8_t _gw[4] = {192,168,0,1};
|
||||
uint8_t _sn[4] = {255,255,255,0};
|
||||
#endif
|
||||
|
||||
#if defined(USE_WS2812FX_DMA) and defined(USE_WS2812FX_UART)
|
||||
#error "Cant have both DMA and UART method."
|
||||
#endif
|
||||
|
@ -72,9 +81,9 @@ uint32_t autoParams[][4] = { // color, speed, mode, duration (seconds)
|
|||
|
||||
//#define ENABLE_MQTT_HOSTNAME_CHIPID // Uncomment/comment to add ESPChipID to end of MQTT hostname
|
||||
#ifdef ENABLE_MQTT_HOSTNAME_CHIPID
|
||||
const char* mqtt_clientid = String(String(HOSTNAME) + "-" + String(ESP.getChipId())).c_str(); // MQTT ClientID
|
||||
char mqtt_clientid[64];
|
||||
#else
|
||||
const char* mqtt_clientid = HOSTNAME; // MQTT ClientID
|
||||
const char* mqtt_clientid = HOSTNAME;
|
||||
#endif
|
||||
|
||||
char mqtt_host[64] = "";
|
||||
|
|
|
@ -1 +1 @@
|
|||
#define SKETCH_VERSION "2.1.6"
|
||||
#define SKETCH_VERSION "2.1.7"
|
||||
|
|
|
@ -25,4 +25,10 @@
|
|||
* - Retire NeoAnimationFX
|
||||
* - Use DMA or UART method along with WS2812FX instead
|
||||
* - fix #248
|
||||
*
|
||||
* 3 Dec 2018 v 2.1.7
|
||||
* - Contributions by @ MrTheBarbarian from #270
|
||||
* - rethink ESP.getChipId implementaion
|
||||
* - check ArduinoJSON version
|
||||
* - Try restting prevmode as suggested in #276
|
||||
*/
|
||||
|
|
|
@ -47,7 +47,7 @@ upload_resetmethod = ${common.upload_resetmethod}
|
|||
lib_deps =
|
||||
WiFiManager@0.14
|
||||
AsyncMqttClient
|
||||
https://github.com/bblanchon/ArduinoJson.git#v6.5.0-beta
|
||||
https://github.com/bblanchon/ArduinoJson.git#v6.6.0-beta
|
||||
WS2812FX
|
||||
NeoPixelBus
|
||||
WebSockets
|
||||
|
|
Loading…
Add table
Reference in a new issue