Skip to content

Commit

Permalink
Release v0.8.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Aircoookie committed Oct 25, 2019
1 parent 0cd46f9 commit ba1117e
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 13 deletions.
2 changes: 1 addition & 1 deletion wled00/data/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head><meta charset="utf-8"><meta name="theme-color" content="#fff">
<link rel='shortcut icon' type='image/x-icon' href='/favicon.ico'/>
<title>WLED 0.8.5</title>
<title>WLED 0.8.6</title>
<script>
var d=document;
var w=window.getComputedStyle(d.querySelector("html"));
Expand Down
2 changes: 1 addition & 1 deletion wled00/data/index_mobile.htm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="theme-color" content="#333333">
<meta content="yes" name="apple-mobile-web-app-capable">
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAGACGAAAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAE1JREFUOI1j/P//PwOxgNGeAUMxE9G6cQCKDWAhpADZ2f8PMjBS3QW08QK20KaZC2gfC9hCnqouoNgARgY7zMxAyNlUdQHlXiAlO2MDAD63EVqNHAe0AAAAAElFTkSuQmCC"/>
<title>WLED 0.8.5</title>
<title>WLED 0.8.6</title>
<script>function feedback(){}</script>
<style>
*{transition-duration: 0.5s;}
Expand Down
Binary file modified wled00/data/settings_leds.htm
Binary file not shown.
Binary file modified wled00/data/settings_sec.htm
Binary file not shown.
Binary file modified wled00/data/settings_wifi.htm
Binary file not shown.
2 changes: 1 addition & 1 deletion wled00/html_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ el.innerHTML=x;el.selectedIndex=pl?p:f;}).catch(function(){el.innerHTML=e;})}fun
<div class="helpB"><button type="button" onclick="H()">?</button></div>
<button type="button" onclick="B()">Back</button><button type="submit">Save</button><hr>
<h2>LED setup</h2>
LED count: <input name="LC" type="number" min="1" max="1200" oninput=UI() required><br>
LED count: <input name="LC" type="number" min="1" max="1500" oninput=UI() required><br>
<i>Recommended power supply for brightest white:</i><br>
<b><span id="psu">?</span></b><br><br>
Maximum Current: <input name="MA" type="number" min="250" max="65000" required> mA<br>
Expand Down
8 changes: 6 additions & 2 deletions wled00/wled00.ino
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//#define WLED_ENABLE_FS_EDITOR //enable /edit page for editing SPIFFS content. Will also be disabled with OTA lock

//to toggle usb serial debug (un)comment the following line
#define WLED_DEBUG
//#define WLED_DEBUG


//library inclusions
Expand Down Expand Up @@ -100,7 +100,7 @@


//version code in format yymmddb (b = daily build)
#define VERSION 1910253
#define VERSION 1910255
char versionString[] = "0.8.6";


Expand Down Expand Up @@ -263,6 +263,7 @@ bool apActive = false;
bool forceReconnect = false;
uint32_t lastReconnectAttempt = 0;
bool interfacesInited = false;
bool wasConnected = false;

//color
byte col[]{255, 159, 0, 0}; //target RGB(W) color
Expand Down Expand Up @@ -411,6 +412,9 @@ IPAddress ntpServerIP;
unsigned int ntpLocalPort = 2390;
#define NTP_PACKET_SIZE 48

#define MAX_LEDS 1500
#define MAX_LEDS_DMA 500

//string temp buffer (now stored in stack locally)
#define OMAX 2048
char* obuf;
Expand Down
2 changes: 1 addition & 1 deletion wled00/wled01_eeprom.ino
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ void loadSettingsFromEEPROM(bool first)
if (apChannel > 13 || apChannel < 1) apChannel = 1;
apHide = EEPROM.read(228);
if (apHide > 1) apHide = 1;
ledCount = EEPROM.read(229) + ((EEPROM.read(398) << 8) & 0xFF00); if (ledCount > 1200 || ledCount == 0) ledCount = 30;
ledCount = EEPROM.read(229) + ((EEPROM.read(398) << 8) & 0xFF00); if (ledCount > MAX_LEDS || ledCount == 0) ledCount = 30;

notifyButton = EEPROM.read(230);
notifyTwice = EEPROM.read(231);
Expand Down
4 changes: 2 additions & 2 deletions wled00/wled03_set.ino
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
if (subPage == 2)
{
int t = request->arg("LC").toInt();
if (t > 0 && t <= 1200) ledCount = t;
if (t > 0 && t <= MAX_LEDS) ledCount = t;
#ifndef ARDUINO_ARCH_ESP32
#if LEDPIN == 3
if (ledCount > 300) ledCount = 300; //DMA method uses too much ram
if (ledCount > MAX_LEDS_DMA) ledCount = MAX_LEDS_DMA; //DMA method uses too much ram
#endif
#endif
strip.ablMilliampsMax = request->arg("MA").toInt();
Expand Down
8 changes: 5 additions & 3 deletions wled00/wled05_init.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ void wledInit()
{
EEPROM.begin(EEPSIZE);
ledCount = EEPROM.read(229) + ((EEPROM.read(398) << 8) & 0xFF00);
if (ledCount > 1200 || ledCount == 0) ledCount = 30;
if (ledCount > MAX_LEDS || ledCount == 0) ledCount = 30;
#ifndef ARDUINO_ARCH_ESP32
#if LEDPIN == 3
if (ledCount > 300) ledCount = 300; //DMA method uses too much ram
if (ledCount > MAX_LEDS_DMA) ledCount = MAX_LEDS_DMA; //DMA method uses too much ram
#endif
#endif
Serial.begin(115200);
Expand Down Expand Up @@ -233,6 +233,7 @@ void initInterfaces() {
reconnectHue();
initMqtt();
interfacesInited = true;
wasConnected = true;
}

byte stacO = 0;
Expand Down Expand Up @@ -262,6 +263,7 @@ void handleConnection() {
initConnection();
interfacesInited = false;
forceReconnect = false;
wasConnected = false;
return;
}
if (!WLED_CONNECTED) {
Expand All @@ -271,7 +273,7 @@ void handleConnection() {
initConnection();
}
if (millis() - lastReconnectAttempt > 300000 && WLED_WIFI_CONFIGURED) initConnection();
if (!apActive && millis() - lastReconnectAttempt > 12000) initAP();
if (!apActive && millis() - lastReconnectAttempt > 12000 && (!wasConnected || apBehavior == 1)) initAP();
} else if (!interfacesInited) { //newly connected
DEBUG_PRINTLN("");
DEBUG_PRINT("Connected! IP address: ");
Expand Down
3 changes: 3 additions & 0 deletions wled00/wled07_notify.ino
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ void handleNotifications()
//wled notifier, block if realtime packets active
if (udpIn[0] == 0 && !realtimeActive && receiveNotifications)
{
//ignore notification if received within a second after sending a notification ourselves
if (millis() - notificationSentTime < 1000) return;

bool someSel = (receiveNotificationBrightness || receiveNotificationColor || receiveNotificationEffects);
//apply colors from notification
if (receiveNotificationColor || !someSel)
Expand Down
8 changes: 6 additions & 2 deletions wled00/wled17_mqtt.ino
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ void publishMqtt()

const char HA_static_JSON[] PROGMEM = R"=====(,"bri_val_tpl":"{{value}}","rgb_cmd_tpl":"{{'#%02x%02x%02x' | format(red, green, blue)}}","rgb_val_tpl":"{{value[1:3]|int(base=16)}},{{value[3:5]|int(base=16)}},{{value[5:7]|int(base=16)}}","qos":0,"opt":true,"pl_on":"ON","pl_off":"OFF","fx_val_tpl":"{{value}}","fx_list":[)=====";

char buffer[2400]; //TODO: this is a TERRIBLE waste of precious memory, local var leads to exception though. Maybe dynamic allocation, but it is unclear when to free
char* buffer;

void sendHADiscoveryMQTT()
{

#if ARDUINO_ARCH_ESP32 || LEDPIN != 3
#if ARDUINO_ARCH_ESP32 || LWIP_VERSION_MAJOR > 1
/*
YYYY is device topic
Expand Down Expand Up @@ -139,6 +139,8 @@ Send out HA MQTT Discovery message on MQTT connect (~2.4kB):
*/
doSendHADiscovery = false;
if (mqtt == nullptr || !mqtt->connected()) return;
buffer = new char[2400];
if (!buffer) {delete[] buffer; return;}

char bufc[36], bufcol[38], bufg[36], bufapi[38];

Expand Down Expand Up @@ -214,6 +216,8 @@ Send out HA MQTT Discovery message on MQTT connect (~2.4kB):
strcat(pubt, "/config");
bool success = mqtt->publish(pubt, 0, true, buffer);
DEBUG_PRINTLN(success);
yield();
delete[] buffer;
#endif
}

Expand Down

0 comments on commit ba1117e

Please sign in to comment.