v 2.2.1
- checkForRequests() is vital for e131 mode, remove from #ifdef ENABLE_LEGACY_ANIMATIONS - Minor fixes related to NeoPixelBus UART methods - Modify platformio.ini for future bump to esp8266-arduino v2.5.0 (shamelessly stolen settings from espurna project) - Gzipped index2.htm & edit.htm.gz(untouched), convereted to hex format using xxd -i abcd.gz > html_gz.h - Think about using pointers for WS2812FX (no code regarding this in initial push)
This commit is contained in:
parent
1578cafbf0
commit
f3157deb1e
8 changed files with 15714 additions and 28 deletions
|
@ -64,6 +64,9 @@
|
|||
ESPAsyncE131 e131(END_UNIVERSE - START_UNIVERSE + 1);
|
||||
#endif
|
||||
|
||||
#ifdef USE_HTML_MIN_GZ
|
||||
#include "html_gz.h"
|
||||
#endif
|
||||
|
||||
// ***************************************************************************
|
||||
// Instanciate HTTP(80) / WebSockets(81) Server
|
||||
|
@ -533,8 +536,11 @@ void setup() {
|
|||
#if defined(USE_WS2812FX_DMA)
|
||||
json["animation_lib"] = "WS2812FX_DMA";
|
||||
json["pin"] = 3;
|
||||
#elif defined(USE_WS2812FX_UART)
|
||||
json["animation_lib"] = "WS2812FX_UART";
|
||||
#elif defined(USE_WS2812FX_UART1)
|
||||
json["animation_lib"] = "WS2812FX_UART1";
|
||||
json["pin"] = 1;
|
||||
#elif defined(USE_WS2812FX_UART2)
|
||||
json["animation_lib"] = "WS2812FX_UART2";
|
||||
json["pin"] = 2;
|
||||
#else
|
||||
json["animation_lib"] = "WS2812FX";
|
||||
|
@ -581,6 +587,25 @@ void setup() {
|
|||
server.send(200, "application/json", json_str);
|
||||
});
|
||||
|
||||
server.on("/", HTTP_GET, [&](){
|
||||
#ifdef USE_HTML_MIN_GZ
|
||||
server.sendHeader("Content-Encoding", "gzip", true);
|
||||
server.send_P(200, PSTR("text/html"), index_htm_gz, index_htm_gz_len);
|
||||
#else
|
||||
if (!handleFileRead(server.uri()))
|
||||
handleNotFound();
|
||||
#endif
|
||||
});
|
||||
|
||||
server.on("/edit", HTTP_GET, [&](){
|
||||
#ifdef USE_HTML_MIN_GZ
|
||||
server.sendHeader("Content-Encoding", "gzip", true);
|
||||
server.send_P(200, PSTR("text/html"), edit_htm_gz, edit_htm_gz_len);
|
||||
#else
|
||||
if (!handleFileRead(server.uri()))
|
||||
handleNotFound();
|
||||
#endif
|
||||
});
|
||||
|
||||
//called when the url is not defined here
|
||||
//use it to load content from SPIFFS
|
||||
|
|
BIN
Arduino/McLighting/data/index2.htm.gz
Normal file
BIN
Arduino/McLighting/data/index2.htm.gz
Normal file
Binary file not shown.
|
@ -19,10 +19,12 @@ 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 // Dont disbale this for now
|
||||
#define ENABLE_E131 // E1.31 implementation
|
||||
//#define USE_HTML_MIN_GZ //uncomment for using index.htm & edit.htm from PROGMEM instead of SPIFFs
|
||||
|
||||
#ifdef ENABLE_E131
|
||||
#define START_UNIVERSE 1 // First DMX Universe to listen for
|
||||
#define END_UNIVERSE 2 // Total number of Universes to listen for, starting at UNIVERSE
|
||||
#define END_UNIVERSE 2 // Last Universe to listen for, starting at UNIVERSE
|
||||
// MUST: END_UNIVERSE >= START_UNIVERSE
|
||||
#endif
|
||||
|
||||
//#define WIFIMGR_PORTAL_TIMEOUT 180
|
||||
|
|
15646
Arduino/McLighting/html_gz.h
Normal file
15646
Arduino/McLighting/html_gz.h
Normal file
File diff suppressed because it is too large
Load diff
|
@ -748,15 +748,13 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef ENABLE_LEGACY_ANIMATIONS
|
||||
void checkForRequests() {
|
||||
webSocket.loop();
|
||||
server.handleClient();
|
||||
#ifdef ENABLE_MQTT
|
||||
mqtt_client.loop();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
void checkForRequests() {
|
||||
webSocket.loop();
|
||||
server.handleClient();
|
||||
#ifdef ENABLE_MQTT
|
||||
mqtt_client.loop();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
|
|
|
@ -1 +1 @@
|
|||
#define SKETCH_VERSION "2.2.0"
|
||||
#define SKETCH_VERSION "2.2.1"
|
|
@ -59,4 +59,11 @@
|
|||
* 6 Jan 2018 v 2.2.0
|
||||
* - fix webserver not responding when E1.31 is mode is acivated: do a webserver.loop() for every 1.31 packet
|
||||
* - HA E1.31 mode added
|
||||
*
|
||||
* 24 Jan 2018 v 2.2.1
|
||||
* - checkForRequests() is vital for e131 mode, remove from #ifdef ENABLE_LEGACY_ANIMATIONS
|
||||
* - Minor fixes related to NeoPixelBus UART methods
|
||||
* - Modify platformio.ini for future bump to esp8266-arduino v2.5.0 (shamelessly stolen settings from espurna project)
|
||||
* - Gzipped index2.htm & edit.htm.gz(untouched), convereted to hex format using xxd -i abcd.gz > html_gz.h
|
||||
* - Think about using pointers for WS2812FX (no code regarding this in initial push)
|
||||
*/
|
||||
|
|
|
@ -1,13 +1,3 @@
|
|||
; PlatformIO Project Configuration File
|
||||
;
|
||||
; Build options: build flags, source filter
|
||||
; Upload options: custom upload port, speed and extra flags
|
||||
; Library options: dependencies, extra library storages
|
||||
; Advanced options: extra scripting
|
||||
;
|
||||
; Please visit documentation for the other options and examples
|
||||
; https://docs.platformio.org/page/projectconf.html
|
||||
|
||||
[platformio]
|
||||
src_dir = ./Arduino/McLighting/
|
||||
data_dir = ./Arduino/McLighting/data/
|
||||
|
@ -15,11 +5,27 @@ env_default = nodemcuv2
|
|||
description = The ESP8266 based multi-client lighting gadget
|
||||
|
||||
[common]
|
||||
# ------------------------------------------------------------------------------
|
||||
# PLATFORM:
|
||||
# !! DO NOT confuse platformio's ESP8266 development platform with Arduino core for ESP8266
|
||||
# We use Arduino Core 2.4.2 (platformIO 1.8.0) as default
|
||||
#
|
||||
# arduino core 2.3.0 = platformIO 1.5.0
|
||||
# arduino core 2.4.0 = platformIO 1.6.0
|
||||
# arduino core 2.4.1 = platformIO 1.7.3
|
||||
# arduino core 2.4.2 = platformIO 1.8.0
|
||||
# arduino core 2.5.0 Beta 2 = platformIO feature#stage (as of 1/24/2019)
|
||||
# ------------------------------------------------------------------------------
|
||||
arduino_core_2_3_0 = espressif8266@1.5.0
|
||||
arduino_core_2_4_0 = espressif8266@1.6.0
|
||||
arduino_core_2_4_1 = espressif8266@1.7.3
|
||||
arduino_core_2_4_2 = espressif8266@1.8.0
|
||||
arduino_core_2_5_0B2 = https://github.com/platformio/platform-espressif8266.git#feature/stage
|
||||
|
||||
framework = arduino
|
||||
platform = espressif8266@1.8.0
|
||||
; platform = https://github.com/platformio/platform-espressif8266.git
|
||||
; platform = https://github.com/platformio/platform-espressif8266.git#feature/stage
|
||||
; platform = https://github.com/platformio/platform-espressif8266.git#develop
|
||||
platform = ${common.arduino_core_2_4_2}
|
||||
;platform = ${common.arduino_core_2_5_0B2}
|
||||
|
||||
build_flags =
|
||||
-DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
|
||||
-DMQTT_MAX_PACKET_SIZE=2048 ; PubSubClient Specific flags
|
||||
|
@ -53,7 +59,9 @@ lib_deps = ${common.lib_deps}
|
|||
board = nodemcuv2
|
||||
framework = ${common.framework}
|
||||
platform = ${common.platform}
|
||||
build_flags = ${common.build_flags}
|
||||
build_flags =
|
||||
${common.build_flags}
|
||||
;-Wl,-Teagle.flash.4m3m.ld ;;;; Required for https://github.com/platformio/platform-espressif8266.git#feature/stage
|
||||
monitor_speed = ${common.monitor_speed}
|
||||
upload_speed = ${common.upload_speed}
|
||||
upload_resetmethod = ${common.upload_resetmethod}
|
||||
|
|
Loading…
Reference in a new issue