From 30ee42732e61ae21b23f0fbb53da265411ea20f1 Mon Sep 17 00:00:00 2001 From: cschwinne Date: Sat, 27 Jan 2018 23:28:20 +0100 Subject: [PATCH] Added support for default secondary color saving Started big rework with seperated settings page, new page design, themes, effect intensity, hue sync... --- wled00/WS2812FX.cpp | 4 + wled00/WS2812FX.h | 3 + wled00/data/index-min.htm | 92 ----- wled00/data/index.htm | 634 ++++++++++++++++++---------------- wled00/data/msg.htm | 43 +++ wled00/data/settings.htm | 162 ++------- wled00/data/settings_leds.htm | Bin 0 -> 8442 bytes wled00/data/settings_sec.htm | Bin 0 -> 7784 bytes wled00/data/settings_sync.htm | Bin 0 -> 7996 bytes wled00/data/settings_time.htm | Bin 0 -> 9774 bytes wled00/data/settings_ui.htm | Bin 0 -> 6176 bytes wled00/data/settings_wifi.htm | Bin 0 -> 7292 bytes wled00/data/settingssaved.htm | 18 - wled00/data/welcome.htm | 43 +++ wled00/htmls00.h | 134 +------ wled00/htmls01.h | 150 +------- wled00/htmls02.h | 33 ++ wled00/wled00.ino | 15 +- wled00/wled01_eeprom.ino | 19 +- wled00/wled02_xml.ino | 14 +- wled00/wled03_set.ino | 35 +- wled00/wled05_init.ino | 66 +++- wled00/wled07_notify.ino | 14 +- wled00/wled15_hue.ino | 4 + 24 files changed, 632 insertions(+), 851 deletions(-) delete mode 100644 wled00/data/index-min.htm create mode 100644 wled00/data/msg.htm create mode 100644 wled00/data/settings_leds.htm create mode 100644 wled00/data/settings_sec.htm create mode 100644 wled00/data/settings_sync.htm create mode 100644 wled00/data/settings_time.htm create mode 100644 wled00/data/settings_ui.htm create mode 100644 wled00/data/settings_wifi.htm delete mode 100644 wled00/data/settingssaved.htm create mode 100644 wled00/data/welcome.htm create mode 100644 wled00/htmls02.h create mode 100644 wled00/wled15_hue.ino diff --git a/wled00/WS2812FX.cpp b/wled00/WS2812FX.cpp index c161d8cd..f821ba04 100644 --- a/wled00/WS2812FX.cpp +++ b/wled00/WS2812FX.cpp @@ -101,6 +101,10 @@ void WS2812FX::decreaseSpeed(uint8_t s) { setSpeed(s); } +void WS2812FX::setIntensity(uint8_t in) { + _intensity=in; +} + void WS2812FX::setColor(uint8_t r, uint8_t g, uint8_t b) { setColor(((uint32_t)r << 16) | ((uint32_t)g << 8) | b); } diff --git a/wled00/WS2812FX.h b/wled00/WS2812FX.h index f29b1717..fdd997ae 100644 --- a/wled00/WS2812FX.h +++ b/wled00/WS2812FX.h @@ -235,6 +235,7 @@ class WS2812FX : public NeoPixelBrightnessBus { setCCFS(bool fs), setCCFE(bool fe), setSpeed(uint8_t s), + setIntensity(uint8_t in), increaseSpeed(uint8_t s), decreaseSpeed(uint8_t s), setColor(uint8_t r, uint8_t g, uint8_t b), @@ -272,6 +273,7 @@ class WS2812FX : public NeoPixelBrightnessBus { get_random_wheel_index(uint8_t), getMode(void), getSpeed(void), + getIntensity(void), getBrightness(void), getModeCount(void); @@ -372,6 +374,7 @@ class WS2812FX : public NeoPixelBrightnessBus { maxval(uint8_t v, uint8_t w), _mode_index, _speed, + _intensity, _cc_i1, _cc_i2, _cc_is, diff --git a/wled00/data/index-min.htm b/wled00/data/index-min.htm deleted file mode 100644 index e7a76aa8..00000000 --- a/wled00/data/index-min.htm +++ /dev/null @@ -1,92 +0,0 @@ - - - -WLED 0.5dev - - - - - Loading... - - -//Linearicons.com/free - - - - - - - - - - - - - - - -
- - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Effect Panel

- - - - -


-Set secondary color to - - - - - -or -
-
Custom Theater Chase
-using primary and - secondary color LEDs,
-doing steps per tick, -from start and end. -
-
-
-Favorite Presets

- - - - -


-Click checkmark to apply brightness, color and effects.
-Effect 0 is the configuration when the light is powered up. -
-
-

-
-
- - - \ No newline at end of file diff --git a/wled00/data/index.htm b/wled00/data/index.htm index d6f91849..50d3d6cb 100644 --- a/wled00/data/index.htm +++ b/wled00/data/index.htm @@ -1,23 +1,25 @@ + WLED 0.5dev - Loading... + Loading... //Linearicons.com/free @@ -584,63 +534,137 @@
- - - + + + - +

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Effect Panel

- - - - -


+ + + +

+

Set secondary color to - - - - - - or -
+ + + + + + or +

Custom Theater Chase
- using primary and - secondary color LEDs,
- doing steps per tick, + using primary and + secondary color LEDs,
+ doing steps per tick, from start and end.
+
+
+
+
-
- Favorite Presets

- - - - -


- Click checkmark to apply brightness, color and effects.
- Effect 0 is the configuration when the light is powered up. +
+ Favorite Presets

+ + + + +


+ Click checkmark to apply brightness, color and effects.
+ Effect 0 is the configuration when the light is powered up.
-
-

+
+ Timed Light

+

+ Gradually dim down
+ 1st slider sets duration (1-255min), 2nd sets target brightness. +
+
+
+
+
+
diff --git a/wled00/data/msg.htm b/wled00/data/msg.htm new file mode 100644 index 00000000..fbcd679d --- /dev/null +++ b/wled00/data/msg.htm @@ -0,0 +1,43 @@ + + + + WLED Message + + + + +

Sample message.

+ + + \ No newline at end of file diff --git a/wled00/data/settings.htm b/wled00/data/settings.htm index 327b47ea..02adbd7c 100644 --- a/wled00/data/settings.htm +++ b/wled00/data/settings.htm @@ -1,135 +1,41 @@ - - - Settings - + + WLED Settings - -

WLED Settings

-
-
-
-

WiFi setup

-

Connect to existing network

- Network SSID (leave empty to not connect):

- Network password:

- Static IP (leave at 0.0.0.0 for DHCP):
- . - . - . -
- Static gateway:
- . - . - . -
- Static subnet mask:
- . - . - . -
- mDNS address (leave empty for no mDNS):
- http:// .local
- Try connecting before opening AP for: s
- Client IP: Not connected
-

Configure Access Point

- AP SSID (leave empty for no AP):

- Hide AP SSID:
- AP password (leave empty for open):

- AP channel:
- AP IP: Not active
-
-

Application setup

-

Web setup

- Server description:
- Use HSB sliders instead of RGB by default:
-

LED setup

- LED count (max. 255):
- The default boot color is always saved in preset slot 0.
- Alternatively, apply preset at boot
- Default RGB color: - - -
- Default brightness: (0-255)
- Default white value (only RGBW, -1 to disable):
- Default effect ID:
- Default effect speed:
- Ignore and use current color, brightness and effects:
- Turn on after power up/reset:
- Use Gamma correction for brightness:
- Use Gamma correction for color:
- Brightness factor: %
-

Button setup

- On/Off button enabled:
-

Transitions

- Fade:
- Sweep: Invert direction:
- Transition Delay: ms
-

Timed light

- Target brightness: (0-255)
- Change after: min
- Fade:
-

Broadcast

- UDP Port:
- Receive notifications:
- Send notifications on direct change:
- Send notifications on button press:
-

Interfaces

- Emulate Alexa device:
- Alexa invocation name:
- Send Alexa notifications:
-

Time (experimental!)

- Requires reboot.
- Get time from NTP server:
- Current local time is unknown
-

Advanced

- Default overlay ID:
- WARLS offset:
-

Security

- OTA locked:
- Passphrase:
- To enable OTA, for security reasons you need to also enter the correct password!
- The password may/should be changed when OTA is enabled.
- Disable OTA when not in use, otherwise an attacker could reflash device software!

- Disable recovery AP:
- In case of a connection error there will be no wireless recovery possible!
- Completely disables all Access Point functions.
- Setting only changable if OTA is enabled!

- Factory reset:
- All EEPROM content (settings) will be erased.

- - HTTP traffic is not encrypted. An attacker in the same network could intercept form data!
-

About

- WLED version 0.5dev
- (c) 2016-2018 Christian Schwinne
- Licensed under the MIT license

- Uses libraries:
- ESP8266 Arduino Core
- WS2812FX by kitesurfer1404 (Aircoookie fork)
- Timezone library by JChristensen
- arduino-esp8266-alexa-multiple-wemo-switch by kakopappa

- UI icons by Linearicons created by Perxis! (CC-BY-SA 4.0)

- Server message: XML response error! -


-
-
+ +
+
+
+
+
+
\ No newline at end of file diff --git a/wled00/data/settings_leds.htm b/wled00/data/settings_leds.htm new file mode 100644 index 0000000000000000000000000000000000000000..bdc1feb0760cd823a82a8a80ea17659663f71958 GIT binary patch literal 8442 zcmc(lYfl?T6o%(3mHHoCsz^kNfh3|$6WR)M3sP>1NoZ76m5ohIF*dbLF0K04+rG~^ z3_H7C8yrFqidoN`J(u@fXUKp5u7+>IMtC09!)|yJUWCn137s$s$Dtd33SWn>!fMI) zc4&l__E$yM7Iow7tx-4$RjvFPPQzh%7k&)$;@l5C(X{QeD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}=Iphs=rL;9fpn$!R>F>QXu7|)!Y`uP zRHmWD<*IM7R;=jUJ*ie)R2}mAaxQ4=$4{w~bF=;#w4SYJOvjn(PlWZ9AM|2B*G$%b z=f?G?M^TZv5#TN$%Yp^nSP|((&rP;wT{GXNZcc8pR=Wl_S*u-x>#Eh4=~u47EY+u& z$kV3 z{eI2*J_r^wyKYh6R>WUbN?pBVQ$Ow}=8>MAZU)LRpRTALSv+4|-iBm&t{1H;L%1Rg zIBUh5$jLo!SCmhL*&EryNt9`gnUFgSZZ4SI{Hzi041Jb!%a4`M(Sw}0-Q$Pi?Hu*WFu80j&o+_zsl14GQR`hHHjs_n0bRCQ z745jroGj`e^Nc8^3zXqJTgE+6&M|41Wn7GjHA&-d1Kdjy85c)G|16(8hA%VmKevdu z+QdJ-x)rh9Q{KFk)Ve(1R~e^fSsawXSSWmteis!;CM=v^2jo*Kz m_hb2tNq3My_T}#nZ~i{ds|Ils?`XY}uo7>6vz7e+YWN>~IsZ-o literal 0 HcmV?d00001 diff --git a/wled00/data/settings_sec.htm b/wled00/data/settings_sec.htm new file mode 100644 index 0000000000000000000000000000000000000000..f8b5d624ed3df034d6d127b449804e7f711c1d67 GIT binary patch literal 7784 zcmc(kYfl?T6o%(3mHHnxRIP{uuj> zj)$FDuYrJ?2!Yo#XV2w5*BSo(r|NFGCvL}WxPAAl+jW~Ra~(H!C$8((+?VbPS1tM8 za&_0#epPfWQP(GLjorXiwDPArb#L5T_t?#gbKmtu)AD~SlJj0vE$w9PFxi6|x-{i@;{mxHxo|9%{(Trt9OKaPD9!Xl}_B;pn zdhSSTRY{5|v6#1^9*Sz9UBh8c>uuT9(++Q7Rpx&5{9d{RciW={)nDgNbK<@z9O}~J zRFosVf#g5*440N{$Xr8+WZG*<;#>bWlU*HAqP^{4t?8V(XTosXJwKQ7_xaPbe$QrV z7Gro<*5H$#sOLTMcyi>v_xc}6@>r{<()6zM?#t_ouBO$Y|JK*avA(sm`bv6jDxwy> zk62xt!hBv>Jv!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YEMU%DLo%}ye7(dM-#ho=Huxl z(?0ci`3WfE6R+g+nod^-dNJpx&oOONp{Qm)r_>E4vD&1uWD4NKa3uP^s&d)-hE4<< zlCxp4Iu>(eVEPiTX%x;EuWg}$93fs8X}DtOJ&|Xq z^XGZ=>e{RbJ09PQwAoaQm;||pAdYLQAY?`wyX)0+P5Iq4ua&Dx>Zu)h3e=(7isctm zFXtD|Ez>oosVY8^U7*yTp$fX!IjbC>a=V(J@o`gLUO6Y~sRi`sV_A`APTuLK^+;>r zim<;Cb_`u~_gOWNb2!*5=SHm2vm-t2IkNPbZtD8-A2`6nek$}TK+VOYWFYek*_}y0 zDtfF;kp^6ORm9SKBJ(>cy1VnbDG$_F!xY(VF- zU;2sb&K+DaUMx6Vvo6@XZ^@&Jx<<@mQQ;W)zR-R`NR!pCJS=p zr>B8gTHO0zXaUkby)TxoO^Y&;`2H-s5DvNhU`pKA%lkYxqFt>Hgh#rc&*Ajxytm}o zW%lA`!_VhOqAKS-{185^ux?T8mX6&3gL0*8sxPl! zQ)HPPxUJ+Dm4DM>)8_XN#TWPY<<9XyUES}^&qLZfJycPil0u5UM>ADKT|!+YY;i;zadZ)@pVLQN=2oP zRkIk2{~E>oV(BO2Sry8s6(%nFSQ$Z4bDy!P+wp|NU9-=G<$EKL=#^<*HQjxOOMY=#caAmhS0}~cTk`HPROS_x>&sDb6Z)7w}<&k H{@eIJb5qJx literal 0 HcmV?d00001 diff --git a/wled00/data/settings_time.htm b/wled00/data/settings_time.htm new file mode 100644 index 0000000000000000000000000000000000000000..f2cd8c10cb2f0d378dba2478f5eb98df11ea421b GIT binary patch literal 9774 zcmeI2YfoE85Qg_FmHHn}s468=9AgN%5-KoBi4-mZk|?RFii?31W2kKslB$2b?fcAl zefHRf97B_QsSx&IcXsYG`|ck8`Fk$h2uoot)WcSI6V}7ikcGq04acDw=EL{lyD&H6 z??%`TdzzmUT|?B{y;a?C8Y&w3Bbx!l;D;gTx(leT7VbeG; z*9r$(J10pgB^I-~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we!lGkhpZ|6H}AH2t&ZRme~=nju2^ zPhISQPF0t?-%!tYdh@ipsJn8F!J@J(3Bp!vStyDJ1=U{2Uo^T;iPX)LW1V_fGaSwqJKQaMt}A z@P(>vxzfb#u7$3b*m;^=A{*=_2k>X88DYQd^J;M(E05U8w)C8uX&zl))z2A9KpWJ$M_DqT=ql!_#S0+2Yq{rtpOdbf^hGX*|+ob zYmK6>itOf@g9b2?dwjF8UN>iK{9Wy`91j&QSm3@O_u?AJbHir;HT)yxGo^@%b#F(JNZBTN$e^&J@nm`^N}O|jZYW} H@BjY=2oZ|1 literal 0 HcmV?d00001 diff --git a/wled00/data/settings_wifi.htm b/wled00/data/settings_wifi.htm new file mode 100644 index 0000000000000000000000000000000000000000..264436f08b90ae9216eef4b3051dd2fbe0291706 GIT binary patch literal 7292 zcmd6sdv9As5XJXjBk>(BK}e}o$9brwP#2WAr9mPgl1nRu5Q<~R4smQ_JAHuo>cIKU zcysq&+fh=~xQde6yR-8+b9QHT`|m&X@L6~oehiK9BK#bV!n2TtUYLf9&=22)Ps1mn zzTkT&9EY~%>yqn8`gpc#8b+b2kw3y^I18`CldvYu!!VFc$NpAj=bfZFn#saRVGe2J z-s*4d%Iag2>&eDAOf)-{);H2VkOxD3n#kf-*bWc$yEgN=BG0ChnJS8o#$M_3clymj z(=;$Q2wknM%Tg*y#H^mkx3Q!~nspp18b4KB1I@64sIu_f^t}x0;hv#|)L&PhD$-sP z4#)E2Qj!y`!1C|4OEKI~G~{F;=`};1Oiser=6_d~ry9MKryG{D3ytq;bZp;-T79l>9gV({U(dv- zn&pVm+8pL)hfM{Rqy3z-xC&pA}#|8P8#Wj&KY9&^EGAMBBaXsiaRRRef#{T zs9|AK=iZLxg3}lb&lG!+DT^(0YEOhrUugO6fCV{!TKYVc=JO<<)S0`&9b0i9Ph|B^ z<(i1$G5JjQW0}W~u9c`-4o9Yq`drkO=X=BUP+#+VvYY06+5YDwK9%;=w~?a2|5%xc z;aGdivjw9%1$nApTcbVs_i!%O+&i*0GDa4CTP+tKycZYmj#Z2B`$cGb=l4XIUg}h9 z*}3v-DeGxwGVQvKB=by1&0ejGb(t~FWA9D9cg<@TEN8DVOQ)H3ZfW1hei+LpotjI= z5jqIER;n6(FIt*nB4eD?k$a3&(Ws67FEg?ex(^kZL0)Dr6c@PbX7)Kk$5ADksh+W@FFC z>K%QjXB+6pdw5V73SaImob@r+@B|LL(d<}=yFS)OeTRkloL8B8m8O2aSC>ck#17yd z!Y#pV4WyIKlX{+ea?j3MI6;hcd6S=ADQ6p3+Ch<1{jGRG_urM)o^gY|kxXUMfRMas|ex^hMvx{dCdr^~&3sC+E;vZ+Yupg%>cXcvh?e3z+g@yePAy$i1#Ht)p`wc7SF1>)G^Nck0!%2`^U9 zCcIcZoA6>)Z1NiDmBr8QiE7L3&!}cN{0LZu7prF#UaX!~cyV{Ex=@8XRCT2ew)I1O zp~oy&$+Y)~wUO=v?zx7vLe`S*h8GcD5&aFZ+zAwG=D|$Y@=BlgBO9vX+?aV2ny<_+ z6bXG&u`}}So0nE@j#PNwRpXmyoZYo9!RLKPrM*k)F_N$B74}2b6f#k+6AeYoD=Tk7 z-qX03yf5(9R=z86A0Dad(KQ?@+WC&r-=FDBqmD%#U$O7y7THxN?ilV0Y2M?UJ4dnt zW>fjjT`cW(9o^X1-kfKwOF8BqUYD6@<0fn>W4tf_c`eI=`x~=9&xf?PY%2^(dwOmaQ!E_y2U?%UF?V*Tnyc0W(-jE%O)f z<$Vy?G=$);c#N-UEX#XIuPk|Ay)`>uVQ#srF7v>%K_`FvJr>^rxP!8b%e$+52Tkv& l#n{pr;-0_5ul`Q$w-KWBlk;L$0~m>~FMj9sGa>%p;(rz!J&OPU literal 0 HcmV?d00001 diff --git a/wled00/data/settingssaved.htm b/wled00/data/settingssaved.htm deleted file mode 100644 index 7b55f969..00000000 --- a/wled00/data/settingssaved.htm +++ /dev/null @@ -1,18 +0,0 @@ - - - - Saved Settings - - -
-

Settings saved.

-

If you made changes to WiFi configuration, please reboot.


- -
- - \ No newline at end of file diff --git a/wled00/data/welcome.htm b/wled00/data/welcome.htm new file mode 100644 index 00000000..c6ae60a6 --- /dev/null +++ b/wled00/data/welcome.htm @@ -0,0 +1,43 @@ + + + + WLED Setup + + + + + + + +

+ +

Welcome to WLED!

+

Thank you for installing my application!

+Take a quick look at the wiki!
+If you encounter a bug or have a question/feature suggestion, feel free to open a GitHub issue!

+Next steps:

+Connect the module to your local WiFi here!

+Just trying this out in AP mode? Here are the controls.
+ + \ No newline at end of file diff --git a/wled00/htmls00.h b/wled00/htmls00.h index 2d9c5354..eefe7d06 100644 --- a/wled00/htmls00.h +++ b/wled00/htmls00.h @@ -1,136 +1,22 @@ -/* - * favicon - */ -const char favicon[156] PROGMEM = { - 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x10, 0x10, 0x00, 0x00, 0x01, 0x00, - 0x18, 0x00, 0x86, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x89, 0x50, - 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, - 0x44, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, - 0x00, 0x00, 0x00, 0x1F, 0xF3, 0xFF, 0x61, 0x00, 0x00, 0x00, 0x4D, 0x49, - 0x44, 0x41, 0x54, 0x38, 0x8D, 0x63, 0xFC, 0xFF, 0xFF, 0x3F, 0x03, 0xB1, - 0x80, 0xD1, 0x9E, 0x01, 0x43, 0x31, 0x13, 0xD1, 0xBA, 0x71, 0x00, 0x8A, - 0x0D, 0x60, 0x21, 0xA4, 0x00, 0xD9, 0xD9, 0xFF, 0x0F, 0x32, 0x30, 0x52, - 0xDD, 0x05, 0xB4, 0xF1, 0x02, 0xB6, 0xD0, 0xA6, 0x99, 0x0B, 0x68, 0x1F, - 0x0B, 0xD8, 0x42, 0x9E, 0xAA, 0x2E, 0xA0, 0xD8, 0x00, 0x46, 0x06, 0x3B, - 0xCC, 0xCC, 0x40, 0xC8, 0xD9, 0x54, 0x75, 0x01, 0xE5, 0x5E, 0x20, 0x25, - 0x3B, 0x63, 0x03, 0x00, 0x3E, 0xB7, 0x11, 0x5A, 0x8D, 0x1C, 0x07, 0xB4, - 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82 -}; - /* * Index html */ -//head (js, css) +//head0 (js) const char PAGE_index0[] PROGMEM = R"=====( - - - -WLED 0.5dev - - - + )====="; -//body1 (svg defs) +//head1 (css) const char PAGE_index1[] PROGMEM = R"=====( - - Loading... - -//Linearicons.com/free - - - - - - - - - - - - - - - + )====="; -//body2 (html) +//body0 (svg defs) const char PAGE_index2[] PROGMEM = R"=====( -
- - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Effect Panel

- - - - -


-Set secondary color to - - - - - -or -
-
Custom Theater Chase
-using primary and - secondary color LEDs,
-doing steps per tick, -from start and end. -
-
-
-Favorite Presets

- - - - -


-Click checkmark to apply brightness, color and effects.
-Effect 0 is the configuration when the light is powered up. -
-
-

-
-
- - - + )====="; -/* - * SPIFFS editor html - */ -#ifdef USEFS -const char PAGE_edit[] PROGMEM = R"=====( -ESP Editor
+ +//body1 (html) +const char PAGE_index3[] PROGMEM = R"=====( + )====="; -#else -const char PAGE_edit[] PROGMEM = R"=====(SPIFFS disabled by firmware)====="; -#endif diff --git a/wled00/htmls01.h b/wled00/htmls01.h index fb01a8a2..6d213b5e 100644 --- a/wled00/htmls01.h +++ b/wled00/htmls01.h @@ -1,157 +1,17 @@ /* - * Settings html (part 1) + * Settings html */ const char PAGE_settings0[] PROGMEM = R"=====( - - - - -Settings - - - - -

WLED Settings

-
-
-
-

WiFi setup

-

Connect to existing network

-Network SSID (leave empty to not connect):

-Network password:

-Static IP (leave at 0.0.0.0 for DHCP):
- . - . - . -
-Static gateway:
- . - . - . -
-Static subnet mask:
- . - . - . -
-mDNS address (leave empty for no mDNS):
-http:// .local
-Try connecting before opening AP for: s
-Client IP: Not connected
-

Configure Access Point

-AP SSID (leave empty for no AP):

-Hide AP SSID:
-AP password (leave empty for open):

-AP channel:
-AP IP: Not active
-
-

Application setup

-

Web setup

-Server description:
-Use HSB sliders instead of RGB by default:
-

LED setup

-LED count (max. 255):
-The default boot color is saved in preset slot 0.
-Alternatively, apply preset at boot
-Default RGB color: - - -
-Default brightness: (0-255)
-Default white value (only RGBW, -1 to disable):
-Default effect ID:
-Default effect speed:
-Ignore and use current color, brightness and effects:
-Turn on after power up/reset:
-Use Gamma correction for brightness:
-Use Gamma correction for color:
-Brightness factor: %
-

Button setup

-On/Off button enabled:
-

Transitions

-Fade:
-Sweep: Invert direction:
-Transition Delay: ms
-

Timed light

-Target brightness: (0-255)
-Change after: min
-Fade:
-

Broadcast

-UDP Port:
-Receive notifications:
-Send notifications on direct change:
-Send notifications on button press:
-

Interfaces

-Emulate Alexa device:
-Alexa invocation name:
-Send Alexa notifications:
-

Time (experimental!)

-Requires reboot.
-Get time from NTP server:
-Current local time is unknown
-

Advanced

-Default overlay ID:
-WARLS offset:
-

Security

-OTA locked:
-Passphrase:
-To enable OTA, for security reasons you need to also enter the correct password!
-The password may/should be changed when OTA is enabled.
-Disable OTA when not in use, otherwise an attacker could reflash device software!

-Disable recovery AP:
-In case of a connection error there will be no wireless recovery possible!
-Completely disables all Access Point functions.
-Setting only changable if OTA is enabled!

-Factory reset:
-All EEPROM content (settings) will be erased.

-HTTP traffic is not encrypted. An attacker in the same network could intercept form data!
-

About

-WLED version 0.5dev
-(c) 2016-2018 Christian Schwinne
-Licensed under the MIT license

-Uses libraries:
-ESP8266 Arduino Core
-WS2812FX by kitesurfer1404 (Aircoookie fork)
-Timezone library by JChristensen
-arduino-esp8266-alexa-multiple-wemo-switch by kakopappa

-UI icons by Linearicons created by Perxis! (CC-BY-SA 4.0)

-Server message: XML response error! -


-
-
- - + )====="; /* * Settings set html */ -const char PAGE_settingssaved[] PROGMEM = R"=====( - - - - Saved Settings - - -
-

Settings saved.

-

If you made changes to WiFi configuration, please reboot.


- -
- +const char PAGE_msg[] PROGMEM = R"=====( + )====="; diff --git a/wled00/htmls02.h b/wled00/htmls02.h new file mode 100644 index 00000000..9b7b6c6f --- /dev/null +++ b/wled00/htmls02.h @@ -0,0 +1,33 @@ +/* + * Various + */ +/* + * SPIFFS editor html + */ +#ifdef USEFS +const char PAGE_edit[] PROGMEM = R"=====( +ESP
+)====="; +#else +const char PAGE_edit[] PROGMEM = R"=====(SPIFFS disabled by firmware)====="; +#endif +/* + * favicon + */ +const char favicon[156] PROGMEM = { + 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x10, 0x10, 0x00, 0x00, 0x01, 0x00, + 0x18, 0x00, 0x86, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x89, 0x50, + 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, + 0x44, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, + 0x00, 0x00, 0x00, 0x1F, 0xF3, 0xFF, 0x61, 0x00, 0x00, 0x00, 0x4D, 0x49, + 0x44, 0x41, 0x54, 0x38, 0x8D, 0x63, 0xFC, 0xFF, 0xFF, 0x3F, 0x03, 0xB1, + 0x80, 0xD1, 0x9E, 0x01, 0x43, 0x31, 0x13, 0xD1, 0xBA, 0x71, 0x00, 0x8A, + 0x0D, 0x60, 0x21, 0xA4, 0x00, 0xD9, 0xD9, 0xFF, 0x0F, 0x32, 0x30, 0x52, + 0xDD, 0x05, 0xB4, 0xF1, 0x02, 0xB6, 0xD0, 0xA6, 0x99, 0x0B, 0x68, 0x1F, + 0x0B, 0xD8, 0x42, 0x9E, 0xAA, 0x2E, 0xA0, 0xD8, 0x00, 0x46, 0x06, 0x3B, + 0xCC, 0xCC, 0x40, 0xC8, 0xD9, 0x54, 0x75, 0x01, 0xE5, 0x5E, 0x20, 0x25, + 0x3B, 0x63, 0x03, 0x00, 0x3E, 0xB7, 0x11, 0x5A, 0x8D, 0x1C, 0x07, 0xB4, + 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82 +}; diff --git a/wled00/wled00.ino b/wled00/wled00.ino index 9264328b..490b4b21 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -29,7 +29,7 @@ #include "WS2812FX.h" //version in format yymmddb (b = daily build) -#define VERSION 1801164 +#define VERSION 1801180 const String versionName = "WLED 0.5dev"; //AP and OTA default passwords (change them!) @@ -45,7 +45,7 @@ boolean useRGBW = false; //support for the CRONIXIE clock by Diamex (disable overlays!) //#define CRONIXIE -//spiffs FS only useful for debug +//spiffs FS only useful for debug (only ESP8266) //#define USEFS //to toggle usb serial debug (un)comment following line @@ -53,7 +53,6 @@ boolean useRGBW = false; //Hardware-settings (only changeble via code) #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 @@ -69,8 +68,6 @@ time_t local; #ifdef CRONIXIE #undef LEDCOUNT #define LEDCOUNT 60 -#undef MAXDIRECT -#define MAXDIRECT 48 uint8_t ledcount = 6; String apssid = "CRONIXIE-AP"; String alexaInvocationName = "Clock"; @@ -124,6 +121,7 @@ boolean nightlightFade = true; uint16_t udpPort = 21324; uint8_t effectDefault = 0; uint8_t effectSpeedDefault = 75; +uint8_t effectIntensityDefault = 128; //NTP stuff #ifndef CRONIXIE boolean ntpEnabled = false; @@ -177,8 +175,9 @@ boolean nightlightActive_old = false; int nightlightDelayMs; uint8_t effectCurrent = 0; uint8_t effectSpeed = 75; +uint8_t effectIntensity = 128; boolean udpConnected = false; -byte udpIn[MAXDIRECT*4+2]; +byte udpIn[1026]; //NTP stuff boolean ntpConnected = false; unsigned int ntpLocalPort = 2390; @@ -218,6 +217,7 @@ boolean arlsSign = true; uint8_t auxTime = 0; unsigned long auxStartTime; boolean auxActive, auxActiveBefore; +boolean initialBoot = false; boolean useGammaCorrectionBri = false; boolean useGammaCorrectionRGB = true; @@ -243,11 +243,12 @@ WiFiUDP ntpUdp; WS2812FX strip = WS2812FX(LEDCOUNT); //eeprom Version code, enables default settings instead of 0 init on update -#define EEPVER 3 +#define EEPVER 4 //0 -> old version, default //1 -> 0.4p 1711272 and up //2 -> 0.4p 1711302 and up //3 -> 0.4 1712121 and up +//4 -> 0.5dev 1801271 and up #ifdef DEBUG #define DEBUG_PRINT(x) Serial.print (x) diff --git a/wled00/wled01_eeprom.ino b/wled00/wled01_eeprom.ino index 26a673ff..37bce9fc 100644 --- a/wled00/wled01_eeprom.ino +++ b/wled00/wled01_eeprom.ino @@ -87,7 +87,7 @@ void saveSettingsToEEPROM() } EEPROM.write(324, effectDefault); EEPROM.write(325, effectSpeedDefault); - //326 reserved for effectIntensity + EEPROM.write(326, effectIntensityDefault); EEPROM.write(327, ntpEnabled); //328 reserved for timezone setting //329 reserved for dst setting @@ -246,10 +246,10 @@ void loadSettingsFromEEPROM(bool first) } //377 = lastEEPROMversion if (lastEEPROMversion > 1) { - col_sec_s[0] = EEPROM.read(378); - col_sec_s[1] = EEPROM.read(379); - col_sec_s[2] = EEPROM.read(380); - white_sec_s = EEPROM.read(381); + col_sec_s[0] = EEPROM.read(378); col_sec[0] = col_sec_s[0]; + col_sec_s[1] = EEPROM.read(379); col_sec[1] = col_sec_s[1]; + col_sec_s[2] = EEPROM.read(380); col_sec[2] = col_sec_s[2]; + white_sec_s = EEPROM.read(381); white_sec = white_sec_s; cc_index1 = EEPROM.read(382); cc_index2 = EEPROM.read(383); cc_numPrimary = EEPROM.read(384); @@ -259,6 +259,9 @@ void loadSettingsFromEEPROM(bool first) cc_step = EEPROM.read(388); strip.setCustomChase(cc_index1, cc_index2, cc_start, cc_numPrimary, cc_numSecondary, cc_step, cc_fromStart, cc_fromEnd); } + if (lastEEPROMversion > 3) { + effectIntensityDefault = EEPROM.read(326); effectIntensity = effectIntensityDefault; + } bootPreset = EEPROM.read(389); //favorite setting memory (25 slots/ each 20byte) @@ -271,12 +274,13 @@ void loadSettingsFromEEPROM(bool first) strip.setMode(effectCurrent); strip.setSpeed(effectSpeed); + strip.setIntensity(effectIntensity); overlayCurrent = overlayDefault; } //PRESET PROTOCOL 20 bytes //0: preset purpose byte 0:invalid 1:valid preset 1.0 -//1:a 2:r 3:g 4:b 5:w 6:er 7:eg 8:eb 9:ew 10:fx 11:sx | custom chase 12:numP 13:numS 14:(0:fs 1:both 2:fe) 15:step 16-19:Zeros +//1:a 2:r 3:g 4:b 5:w 6:er 7:eg 8:eb 9:ew 10:fx 11:sx | custom chase 12:numP 13:numS 14:(0:fs 1:both 2:fe) 15:step 16:ix 17-19:Zeros void applyPreset(uint8_t index, bool loadBri, bool loadCol, bool loadFX) { @@ -300,6 +304,7 @@ void applyPreset(uint8_t index, bool loadBri, bool loadCol, bool loadFX) { effectCurrent = EEPROM.read(i+10); effectSpeed = EEPROM.read(i+11); + effectIntensity = EEPROM.read(i+16); cc_numPrimary = EEPROM.read(i+12); cc_numSecondary = EEPROM.read(i+13); cc_fromEnd = EEPROM.read(i+14); @@ -308,6 +313,7 @@ void applyPreset(uint8_t index, bool loadBri, bool loadCol, bool loadFX) strip.setCustomChase(cc_index1, cc_index2, cc_start, cc_numPrimary, cc_numSecondary, cc_step, cc_fromStart, cc_fromEnd); strip.setMode(effectCurrent); strip.setSpeed(effectSpeed); + strip.setIntensity(effectIntensity); } } @@ -335,6 +341,7 @@ void savePreset(uint8_t index) if (!cc_fromEnd) m = 0; EEPROM.write(i+14, m); EEPROM.write(i+15, cc_step); + EEPROM.write(i+16, effectIntensity); EEPROM.commit(); } diff --git a/wled00/wled02_xml.ino b/wled00/wled02_xml.ino index 651e7f13..bdad0002 100644 --- a/wled00/wled02_xml.ino +++ b/wled00/wled02_xml.ino @@ -33,7 +33,9 @@ void XML_response() resp = resp + effectCurrent; resp = resp + ""; resp = resp + effectSpeed; - resp = resp + ""; + resp = resp + ""; + resp = resp + effectIntensity; + resp = resp + ""; if (useRGBW) { resp = resp + white; } else { @@ -49,9 +51,11 @@ void XML_response() server.send(200, "text/xml", resp); } -String getSettings() +String getSettings(uint8_t subPage) { - DEBUG_PRINTLN("settings resp"); + //0: menu 1: wifi 2: leds 3: ui 4: sync 5: time 6: sec + DEBUG_PRINT("settings resp"); + DEBUG_PRINTLN(subPage); String resp = ""; String ds = "d.Sf."; @@ -103,6 +107,10 @@ String getSettings() } else { resp += ds + "CLDFW" + v + "-1;"; } + resp += ds + "CSECR" + v + col_sec_s[0] +";"; + resp += ds + "CSECG" + v + col_sec_s[1] +";"; + resp += ds + "CSECB" + v + col_sec_s[2] +";"; + resp += ds + "CSECW" + v + white_s +";"; resp += ds + "BOOTN" + c + turnOnAtBoot +";"; resp += ds + "BOOTP" + v + bootPreset +";"; resp += ds + "FXDEF" + v + effectDefault +";"; diff --git a/wled00/wled03_set.ino b/wled00/wled03_set.ino index 69e2d5bd..707069e7 100644 --- a/wled00/wled03_set.ino +++ b/wled00/wled03_set.ino @@ -122,11 +122,12 @@ void handleSettingsSet() if (i >= 0 && i <= LEDCOUNT) ledcount = i; strip.setLedCount(ledcount); } - if (server.hasArg("CBEOR")) + if (server.hasArg("CBEOR")) //ignore settings and save current brightness, colors and fx as default { col_s[0] = col[0]; col_s[1] = col[1]; col_s[2] = col[2]; + if (useRGBW) white_s = white; bri_s = bri; effectDefault = effectCurrent; effectSpeedDefault = effectSpeed; @@ -146,6 +147,26 @@ void handleSettingsSet() int i = server.arg("CLDFB").toInt(); if (i >= 0 && i <= 255) col_s[2] = i; } + if (server.hasArg("CSECR")) + { + int i = server.arg("CSECR").toInt(); + if (i >= 0 && i <= 255) col_sec_s[0] = i; + } + if (server.hasArg("CSECG")) + { + int i = server.arg("CSECG").toInt(); + if (i >= 0 && i <= 255) col_sec_s[1] = i; + } + if (server.hasArg("CSECB")) + { + int i = server.arg("CSECB").toInt(); + if (i >= 0 && i <= 255) col_sec_s[2] = i; + } + if (server.hasArg("CSECW")) + { + int i = server.arg("CSECW").toInt(); + if (i >= 0 && i <= 255) white_sec_s = i; + } if (server.hasArg("CLDFW")) { int i = server.arg("CLDFW").toInt(); @@ -163,12 +184,6 @@ void handleSettingsSet() int i = server.arg("CLDFA").toInt(); if (i >= 0 && i <= 255) bri_s = i; } - turnOnAtBoot = server.hasArg("BOOTN"); - if (server.hasArg("BOOTP")) - { - int i = server.arg("BOOTP").toInt(); - if (i >= 0 && i <= 25) bootPreset = i; - } if (server.hasArg("FXDEF")) { int i = server.arg("FXDEF").toInt(); @@ -180,6 +195,12 @@ void handleSettingsSet() if (i >= 0 && i <= 255) effectSpeedDefault = i; } } + turnOnAtBoot = server.hasArg("BOOTN"); + if (server.hasArg("BOOTP")) + { + int i = server.arg("BOOTP").toInt(); + if (i >= 0 && i <= 25) bootPreset = i; + } useGammaCorrectionBri = server.hasArg("GCBRI"); useGammaCorrectionRGB = server.hasArg("GCRGB"); buttonEnabled = server.hasArg("BTNON"); diff --git a/wled00/wled05_init.ino b/wled00/wled05_init.ino index 373ec61b..620010ba 100644 --- a/wled00/wled05_init.ino +++ b/wled00/wled05_init.ino @@ -87,19 +87,18 @@ void wledInit() if(!handleFileRead("/favicon.ico")) server.send(200, "image/x-icon", favicon); }); server.on("/", HTTP_GET, [](){ - if(!handleFileRead("/index.htm")) { - if (!arlsTimeout) //do not serve while receiving realtime - { - server.setContentLength(strlen_P(PAGE_index0) + strlen_P(PAGE_index1) + strlen_P(PAGE_index2)); - server.send(200, "text/html", ""); - server.sendContent_P(PAGE_index0); - server.sendContent_P(PAGE_index1); - server.sendContent_P(PAGE_index2); - } else { - server.send(200, "text/plain", "The WLED UI is not available while receiving real-time data."); + if (!initialBoot){ + if(!handleFileRead("/index.htm")) { + serveIndex(); + } + }else{ + if(!handleFileRead("/welcome.htm")) { + serveWelcomePage(); } } }); + server.on("/sliders", HTTP_GET, serveIndex) + server.on("/welcome", HTTP_GET, serveWelcomePage) server.on("/reset", HTTP_GET, [](){ server.send(200, "text/plain", "Rebooting..."); reset(); @@ -134,13 +133,13 @@ void wledInit() #endif info += "name: " + versionName + "\r\n"; info += "version: " + (String)VERSION + "\r\n"; + info += "eepver: " + String(EEPVER) + "\r\n"; #ifdef RGBW info += "rgbw: true\r\n"; #else info += "rgbw: false\r\n"; #endif info += "max-leds: " + (String)LEDCOUNT + "\r\n"; - info += "max-direct: " + (String)MAXDIRECT + "\r\n"; #ifdef USEOVERLAYS info += "overlays: true\r\n"; #else @@ -231,9 +230,7 @@ void wledInit() // Initialize NeoPixel Strip strip.init(); strip.setLedCount(ledcount); - strip.setMode(effectCurrent); strip.setColor(0); - strip.setSpeed(effectSpeed); strip.setBrightness(255); strip.start(); @@ -279,3 +276,46 @@ void initCon() } } +void buildCssColorString() +{ + cssColorString=":root{--aCol:"; + cssColorString+=cssCol[0]; + cssColorString+=";--bCol:"; + cssColorString+=cssCol[1]; + cssColorString+=";--cCol:"; + cssColorString+=cssCol[2]; + cssColorString+=";--dCol:"; + cssColorString+=cssCol[3]; + cssColorString+=";--sCol:"; + cssColorString+=cssCol[4]; + cssColorString+=";}"; +} + +void serveIndex() +{ + if (!arlsTimeout) //do not serve while receiving realtime + { + server.setContentLength(strlen_P(PAGE_index0) + cssColorString.length() + strlen_P(PAGE_index1) + strlen_P(PAGE_index2) + strlen_P(PAGE_index3)); + server.send(200, "text/html", ""); + server.sendContent_P(PAGE_index0); + server.sendContent(cssColorString); + server.sendContent_P(PAGE_index1); + server.sendContent_P(PAGE_index2); + server.sendContent_P(PAGE_index3); + } else { + server.send(200, "text/plain", "The WLED UI is not available while receiving real-time data."); + } +} + +void serveWelcomePage() +{ + String resp = ""; + resp += PAGE_welcome0; + resp += cssColorString; + resp += PAGE_welcome1; + server.send(200, "text/html", resp); +} + + + + diff --git a/wled00/wled07_notify.ino b/wled00/wled07_notify.ino index adf6ff8d..94cda649 100644 --- a/wled00/wled07_notify.ino +++ b/wled00/wled07_notify.ino @@ -2,6 +2,8 @@ * UDP notifier */ +#define WLEDPACKETSIZE 24 + void notify(uint8_t callMode) { if (!udpConnected) return; @@ -13,7 +15,7 @@ void notify(uint8_t callMode) case 6: if (!notifyDirect) return; break; //fx change default: return; } - byte udpOut[16]; + byte udpOut[WLEDPACKETSIZE]; udpOut[0] = 0; //0: wled notifier protocol 1: WARLS protocol udpOut[1] = callMode; udpOut[2] = bri; @@ -25,17 +27,18 @@ void notify(uint8_t callMode) udpOut[8] = effectCurrent; udpOut[9] = effectSpeed; udpOut[10] = white; - udpOut[11] = 2; //compatibilityVersionByte: 0: old 1: supports white 2: supports secondary color + udpOut[11] = 3; //compatibilityVersionByte: 0: old 1: supports white 2: supports secondary color 3: supports FX intensity, 24 byte packet udpOut[12] = col_sec[0]; udpOut[13] = col_sec[1]; udpOut[14] = col_sec[2]; udpOut[15] = white_sec; + udpOut[16] = effectIntensity; IPAddress broadcastIp; broadcastIp = ~WiFi.subnetMask() | WiFi.gatewayIP(); notifierUdp.beginPacket(broadcastIp, udpPort); - notifierUdp.write(udpOut, 16); + notifierUdp.write(udpOut, WLEDPACKETSIZE); notifierUdp.endPacket(); } @@ -72,6 +75,11 @@ void handleNotifications() effectSpeed = udpIn[9]; strip.setSpeed(effectSpeed); } + if (udpIn[11] > 3 && udpIn[16] != effectIntensity) + { + effectSpeed = udpIn[16]; + strip.setIntensity(effectIntensity); + } nightlightActive = udpIn[6]; if (!nightlightActive) { diff --git a/wled00/wled15_hue.ino b/wled00/wled15_hue.ino new file mode 100644 index 00000000..388ce0c8 --- /dev/null +++ b/wled00/wled15_hue.ino @@ -0,0 +1,4 @@ +/* + * Sync to Philips hue lights + */ +void foo(){}