diff --git a/bin/wled03pd_wemosd1mini_170224.bin b/bin/wled03pd_wemosd1mini_170224.bin
new file mode 100644
index 000000000..6c27d35ee
Binary files /dev/null and b/bin/wled03pd_wemosd1mini_170224.bin differ
diff --git a/readme.md b/readme.md
index 57cab5c46..56ec4de6d 100644
--- a/readme.md
+++ b/readme.md
@@ -28,6 +28,10 @@ Upload speed: 115200
Quick start guide:
+-If you do not plan to change the software, you can use the supplied binary files instead-
+Just flash a basic HTTP OTA updater sketch and upload the bin!
+
+
1. Make sure your ESP module has a min. 4MB SPI flash module. (currently working on supporting 1MB modules)
Connect a WS2812B RGB led strip to GPIO2. Optionally connect a NO-pushbutton to GPIO0 (internal pull-up) and ground.
diff --git a/wled00/WS2812FX.cpp b/wled00/WS2812FX.cpp
index 1f26e005b..c32e02aad 100644
--- a/wled00/WS2812FX.cpp
+++ b/wled00/WS2812FX.cpp
@@ -1458,5 +1458,10 @@ void WS2812FX::unlockAll()
_locked[x] = false;
}
+void WS2812FX::setLedCount(uint16_t i)
+{
+ _led_count = i;
+}
+
diff --git a/wled00/WS2812FX.h b/wled00/WS2812FX.h
index d00971c7a..4aafb3018 100644
--- a/wled00/WS2812FX.h
+++ b/wled00/WS2812FX.h
@@ -245,6 +245,7 @@ class WS2812FX : public Adafruit_NeoPixel {
unlockRange(int i, int i2),
unlockAll(void),
trigger(void),
+ setLedCount(uint16_t i),
setFade(int sp);
boolean
diff --git a/wled00/data/settings.htm b/wled00/data/settings.htm
index e1fc52aff..a66b75602 100644
--- a/wled00/data/settings.htm
+++ b/wled00/data/settings.htm
@@ -32,6 +32,7 @@
document.S_form.APPASS.value = this.responseXML.getElementsByTagName('appass')[0].innerHTML; //fake pass like ******
document.S_form.APCHAN.value = this.responseXML.getElementsByTagName('apchan')[0].innerHTML;
document.S_form.DESC.value = this.responseXML.getElementsByTagName('desc')[0].innerHTML;
+ document.S_form.LEDCN.value = this.responseXML.getElementsByTagName('ledcn')[0].innerHTML;
document.S_form.CLDFR.value = this.responseXML.getElementsByTagName('cldef')[0].innerHTML;
document.S_form.CLDFG.value = this.responseXML.getElementsByTagName('cldef')[1].innerHTML;
document.S_form.CLDFB.value = this.responseXML.getElementsByTagName('cldef')[2].innerHTML;
@@ -52,8 +53,14 @@
document.S_form.NSDIR.checked = (this.responseXML.getElementsByTagName('nsdir')[0].innerHTML)!=0?true:false;
document.S_form.NSBTN.checked = (this.responseXML.getElementsByTagName('nsbtn')[0].innerHTML)!=0?true:false;
document.S_form.NSFWD.checked = (this.responseXML.getElementsByTagName('nsfwd')[0].innerHTML)!=0?true:false;
+ document.S_form.ALEXA.checked = (this.responseXML.getElementsByTagName('alexa')[0].innerHTML)!=0?true:false;
+ document.S_form.AINVN.value = this.responseXML.getElementsByTagName('ainvn')[0].innerHTML;
+ document.S_form.NSALX.checked = (this.responseXML.getElementsByTagName('nsalx')[0].innerHTML)!=0?true:false;
document.S_form.NTPON.checked = (this.responseXML.getElementsByTagName('ntpon')[0].innerHTML)!=0?true:false;
document.getElementsByClassName("times")[0].innerHTML = this.responseXML.getElementsByTagName('times')[0].innerHTML;
+ document.S_form.OLDEF.value = this.responseXML.getElementsByTagName('oldef')[0].innerHTML;
+ document.S_form.WOFFS.value = this.responseXML.getElementsByTagName('woffs')[0].innerHTML;
+ document.S_form.WOFFN.checked = (this.responseXML.getElementsByTagName('woffn')[0].innerHTML)!=0?true:false;
document.S_form.NOOTA.checked = (this.responseXML.getElementsByTagName('noota')[0].innerHTML)!=0?true:false;
document.S_form.NORAP.checked = (this.responseXML.getElementsByTagName('norap')[0].innerHTML)!=0?true:false;
document.getElementsByClassName("sip")[0].innerHTML = this.responseXML.getElementsByTagName('sip')[0].innerHTML;
@@ -116,6 +123,7 @@
Web setup
Server description:
LED setup
+ LED count (max. 255):
Default RGB color:
@@ -142,10 +150,18 @@
Send notifications on direct change:
Send notifications on button press:
Send nightlight notifications:
- Time
- Warning! NTP was updated but could still cause crashes. Requires reboot.
+ Interfaces
+ Emulate Alexa device:
+ Alexa invocation name:
+ Send Alexa notifications:
+ Time (highly experimental!)
+ Warning! NTP was updated but still causes crashes. Requires reboot.
+ It is really not recommended to use this!
Get time from NTP server:
Current local time is unknown
+ Advanced
+ Default overlay ID:
+ WARLS offset: negative
Security
OTA locked:
Passphrase:
@@ -167,6 +183,7 @@
ESP8266 Arduino Core
WS2812FX by kitesurfer1404 (Aircoookie fork)
Timezone library by JChristensen
+ arduino-esp8266-alexa-multiple-wemo-switch by kakopappa
Server message: XML response error!
diff --git a/wled00/htmls01.h b/wled00/htmls01.h
index 41954a562..12276f597 100644
--- a/wled00/htmls01.h
+++ b/wled00/htmls01.h
@@ -36,6 +36,7 @@ const char PAGE_settings[] PROGMEM = R"=====(
document.S_form.APPASS.value = this.responseXML.getElementsByTagName('appass')[0].innerHTML; //fake pass like ******
document.S_form.APCHAN.value = this.responseXML.getElementsByTagName('apchan')[0].innerHTML;
document.S_form.DESC.value = this.responseXML.getElementsByTagName('desc')[0].innerHTML;
+ document.S_form.LEDCN.value = this.responseXML.getElementsByTagName('ledcn')[0].innerHTML;
document.S_form.CLDFR.value = this.responseXML.getElementsByTagName('cldef')[0].innerHTML;
document.S_form.CLDFG.value = this.responseXML.getElementsByTagName('cldef')[1].innerHTML;
document.S_form.CLDFB.value = this.responseXML.getElementsByTagName('cldef')[2].innerHTML;
@@ -56,8 +57,14 @@ const char PAGE_settings[] PROGMEM = R"=====(
document.S_form.NSDIR.checked = (this.responseXML.getElementsByTagName('nsdir')[0].innerHTML)!=0?true:false;
document.S_form.NSBTN.checked = (this.responseXML.getElementsByTagName('nsbtn')[0].innerHTML)!=0?true:false;
document.S_form.NSFWD.checked = (this.responseXML.getElementsByTagName('nsfwd')[0].innerHTML)!=0?true:false;
+ document.S_form.ALEXA.checked = (this.responseXML.getElementsByTagName('alexa')[0].innerHTML)!=0?true:false;
+ document.S_form.AINVN.value = this.responseXML.getElementsByTagName('ainvn')[0].innerHTML;
+ document.S_form.NSALX.checked = (this.responseXML.getElementsByTagName('nsalx')[0].innerHTML)!=0?true:false;
document.S_form.NTPON.checked = (this.responseXML.getElementsByTagName('ntpon')[0].innerHTML)!=0?true:false;
document.getElementsByClassName("times")[0].innerHTML = this.responseXML.getElementsByTagName('times')[0].innerHTML;
+ document.S_form.OLDEF.value = this.responseXML.getElementsByTagName('oldef')[0].innerHTML;
+ document.S_form.WOFFS.value = this.responseXML.getElementsByTagName('woffs')[0].innerHTML;
+ document.S_form.WOFFN.checked = (this.responseXML.getElementsByTagName('woffn')[0].innerHTML)!=0?true:false;
document.S_form.NOOTA.checked = (this.responseXML.getElementsByTagName('noota')[0].innerHTML)!=0?true:false;
document.S_form.NORAP.checked = (this.responseXML.getElementsByTagName('norap')[0].innerHTML)!=0?true:false;
document.getElementsByClassName("sip")[0].innerHTML = this.responseXML.getElementsByTagName('sip')[0].innerHTML;
@@ -120,6 +127,7 @@ const char PAGE_settings[] PROGMEM = R"=====(
Web setup
Server description:
LED setup
+ LED count (max. 255):
Default RGB color:
@@ -146,10 +154,18 @@ const char PAGE_settings[] PROGMEM = R"=====(
Send notifications on direct change:
Send notifications on button press:
Send nightlight notifications:
- Time
- Warning! NTP was updated but could still cause crashes. Requires reboot.
+ Interfaces
+ Emulate Alexa device:
+ Alexa invocation name:
+ Send Alexa notifications:
+ Time (highly experimental!)
+ Warning! NTP was updated but still causes crashes. Requires reboot.
+ It is really not recommended to use this!
Get time from NTP server:
Current local time is unknown
+ Advanced
+ Default overlay ID:
+ WARLS offset: negative
Security
OTA locked:
Passphrase:
@@ -171,6 +187,7 @@ const char PAGE_settings[] PROGMEM = R"=====(
ESP8266 Arduino Core
WS2812FX by kitesurfer1404 (Aircoookie fork)
Timezone library by JChristensen
+ arduino-esp8266-alexa-multiple-wemo-switch by kakopappa
Server message: XML response error!
diff --git a/wled00/wled00.ino b/wled00/wled00.ino
index 116d889a2..a1bb99d41 100644
--- a/wled00/wled00.ino
+++ b/wled00/wled00.ino
@@ -22,7 +22,7 @@
#include "CallbackFunction.h"
//to toggle usb serial debug (un)comment following line
-#define DEBUG
+//#define DEBUG
#ifdef DEBUG
#define DEBUG_PRINT(x) Serial.print (x)
@@ -40,8 +40,8 @@
* @author Christian Schwinne
*/
//Hardware-settings (only changeble via code)
-#define LEDCOUNT 9
-#define MAXDIRECT 52 //for direct access like arls, should be >= LEDCOUNT
+#define LEDCOUNT 255 //maximum, exact count set-able via settings
+#define MAXDIRECT 255 //for direct access like arls, should be >= LEDCOUNT
uint8_t buttonPin = 0; //needs pull-up
uint8_t auxPin = 15; //use e.g. for external relay
uint8_t auxDefaultState = 0; //0: input 1: high 2: low
@@ -58,6 +58,7 @@ TimeChangeRule *tcr; //pointer to the time change rule, use to get the TZ
time_t local;
//Default CONFIG
+uint8_t ledcount = 255;
String serverDescription = "WLED 0.3pd";
String clientssid = "Your_Network_Here";
String clientpass = "Dummy_Pass";
@@ -92,6 +93,7 @@ IPAddress ntpServerIP;
const char* ntpServerName = "time.nist.gov";
//overlay stuff
+uint8_t overlayDefault = 0;
int overlayMin = 0, overlayMax = 9;
int analogClock12pixel = 25;
boolean analogClockSecondsTrail = false;
@@ -107,7 +109,7 @@ boolean realtimeEnabled = true;
//alexa
boolean alexaEnabled = true;
-String alexaInvocationName = "Schloss";
+String alexaInvocationName = "Light";
boolean alexaNotify = false;
double transitionResolution = 0.011;
@@ -157,6 +159,7 @@ unsigned long countdownTime = 1483225200L;
int arlsTimeoutMillis = 2500;
boolean arlsTimeout = false;
long arlsTimeoutTime;
+boolean arlsSign = true;
uint8_t auxTime = 0;
unsigned long auxStartTime;
boolean auxActive, auxActiveBefore;
diff --git a/wled00/wled01_eeprom.ino b/wled00/wled01_eeprom.ino
index 5cd0500b5..d2e8ce737 100644
--- a/wled00/wled01_eeprom.ino
+++ b/wled00/wled01_eeprom.ino
@@ -43,7 +43,7 @@ void saveSettingsToEEPROM()
EEPROM.write(226, notifyDirect);
EEPROM.write(227, apchannel);
EEPROM.write(228, aphide);
- EEPROM.write(229, LEDCOUNT);
+ EEPROM.write(229, ledcount);
EEPROM.write(230, notifyButton);
EEPROM.write(231, notifyNightlight);
EEPROM.write(232, buttonEnabled);
@@ -90,6 +90,15 @@ void saveSettingsToEEPROM()
//329 reserved for dst setting
EEPROM.write(330, useGammaCorrectionBri);
EEPROM.write(331, useGammaCorrectionRGB);
+ EEPROM.write(332, overlayDefault);
+ EEPROM.write(333, alexaEnabled);
+ for (int i = 334; i < 366; ++i)
+ {
+ EEPROM.write(i, alexaInvocationName.charAt(i-334));
+ }
+ EEPROM.write(366, alexaNotify);
+ EEPROM.write(367, arlsSign);
+ EEPROM.write(368, abs(arlsOffset));
EEPROM.commit();
}
@@ -137,7 +146,7 @@ void loadSettingsFromEEPROM()
if (apchannel > 13 || apchannel < 1) apchannel = 1;
aphide = EEPROM.read(228);
if (aphide > 1) aphide = 1;
- //LEDCOUNT = EEPROM.read(229);
+ ledcount = EEPROM.read(229);
notifyButton = EEPROM.read(230);
notifyNightlight = EEPROM.read(231);
buttonEnabled = EEPROM.read(232);
@@ -183,4 +192,16 @@ void loadSettingsFromEEPROM()
ntpEnabled = EEPROM.read(327);
useGammaCorrectionBri = EEPROM.read(330);
useGammaCorrectionRGB = EEPROM.read(331);
+ overlayDefault = EEPROM.read(332);
+ alexaEnabled = EEPROM.read(333);
+ alexaInvocationName = "";
+ for (int i = 334; i < 366; ++i)
+ {
+ if (EEPROM.read(i) == 0) break;
+ alexaInvocationName += char(EEPROM.read(i));
+ }
+ alexaNotify = EEPROM.read(366);
+ arlsSign = EEPROM.read(367);
+ arlsOffset = EEPROM.read(368);
+ if (!arlsSign) arlsOffset = -arlsOffset;
}
diff --git a/wled00/wled02_xml.ino b/wled00/wled02_xml.ino
index d6d977e06..c034ae4bb 100644
--- a/wled00/wled02_xml.ino
+++ b/wled00/wled02_xml.ino
@@ -100,6 +100,9 @@ void XML_response_settings()
resp = resp + "";
resp = resp + serverDescription;
resp = resp + " ";
+ resp = resp + "";
+ resp = resp + ledcount;
+ resp = resp + " ";
for (int i = 0; i < 3; i++)
{
resp = resp + "";
@@ -153,11 +156,26 @@ void XML_response_settings()
resp = resp + "";
resp = resp + bool2int(ntpEnabled);
resp = resp + " ";
+ resp = resp + "";
+ resp = resp + bool2int(alexaEnabled);
+ resp = resp + " ";
+ resp = resp + alexaInvocationName;
+ resp = resp + " ";
+ resp = resp + bool2int(alexaNotify);
+ resp = resp + " ";
DEBUG_PRINTLN("pretime");
resp = resp + "";
resp = resp + getTimeString();
resp = resp + " ";
- DEBUG_PRINTLN("posttime");
+ resp = resp + "";
+ resp = resp + overlayDefault;
+ resp = resp + " ";
+ resp = resp + "";
+ resp = resp + abs(arlsOffset);
+ resp = resp + " ";
+ resp = resp + "";
+ resp = resp + bool2int(!arlsSign);
+ resp = resp + " ";
resp = resp + "";
resp = resp + bool2int(ota_lock);
resp = resp +" ";
diff --git a/wled00/wled03_set.ino b/wled00/wled03_set.ino
index 5d4ed52a7..63b861132 100644
--- a/wled00/wled03_set.ino
+++ b/wled00/wled03_set.ino
@@ -98,6 +98,12 @@ void handleSettingsSet()
if (i >= 0 && i <= 255) staticsubnet[3] = i;
}
if (server.hasArg("DESC")) serverDescription = server.arg("DESC");
+ if (server.hasArg("LEDCN"))
+ {
+ int i = server.arg("LEDCN").toInt();
+ if (i >= 0 && i <= 255) ledcount = i;
+ strip.setLedCount(ledcount);
+ }
if (server.hasArg("CBEOR"))
{
col_s[0] = col[0];
@@ -174,7 +180,26 @@ void handleSettingsSet()
notifyDirect = server.hasArg("NSDIR");
notifyButton = server.hasArg("NSBTN");
notifyNightlight = server.hasArg("NSFWD");
+ alexaEnabled = server.hasArg("ALEXA");
+ if (server.hasArg("AINVN")) alexaInvocationName = server.arg("AINVN");
+ alexaNotify = server.hasArg("NSALX");
ntpEnabled = server.hasArg("NTPON");
+ if (server.hasArg("OLDEF"))
+ {
+ int i = server.arg("OLDEF").toInt();
+ if (i >= 0 && i <= 255) overlayDefault = i;
+ }
+ if (server.hasArg("WOFFS"))
+ {
+ int i = server.arg("WOFFS").toInt();
+ if (i >= 0 && i <= 255) arlsOffset = i;
+ arlsSign = true;
+ if (server.hasArg("WOFFN"))
+ {
+ arlsSign = false;
+ arlsOffset = -arlsOffset;
+ }
+ }
if (server.hasArg("OPASS"))
{
if (!ota_lock)
diff --git a/wled00/wled05_init.ino b/wled00/wled05_init.ino
index f9999b152..639829082 100644
--- a/wled00/wled05_init.ino
+++ b/wled00/wled05_init.ino
@@ -133,8 +133,11 @@ void wledInit()
MDNS.addService("http", "tcp", 80);
//Init alexa service
alexaInit();
+
+ overlayCurrent = overlayDefault;
// Initialize NeoPixel Strip
strip.init();
+ strip.setLedCount(ledcount);
strip.setMode(effectCurrent);
strip.setColor(0);
strip.setSpeed(effectSpeed);
diff --git a/wled00/wled07_notify.ino b/wled00/wled07_notify.ino
index f380bc8a1..b8463a2be 100644
--- a/wled00/wled07_notify.ino
+++ b/wled00/wled07_notify.ino
@@ -70,7 +70,7 @@ void handleNotifications()
arlsTimeout = false;
} else {
if (!arlsTimeout){
- strip.setRange(0, LEDCOUNT-1, 0);
+ strip.setRange(0, ledcount-1, 0);
strip.setMode(0);
}
arlsTimeout = true;
@@ -78,7 +78,7 @@ void handleNotifications()
}
for (int i = 2; i < packetSize -3; i += 4)
{
- if (udpIn[i] + arlsOffset < LEDCOUNT && udpIn[i] + arlsOffset >= 0)
+ if (udpIn[i] + arlsOffset < ledcount && udpIn[i] + arlsOffset >= 0)
if (useGammaCorrectionRGB)
{
strip.setIndividual(udpIn[i] + arlsOffset, ((uint32_t)gamma8[udpIn[i+1]] << 16) | ((uint32_t)gamma8[udpIn[i+2]] << 8) | gamma8[udpIn[i+3]]);