Skip to content

Commit

Permalink
Merge branch 'master' into travis_all_features
Browse files Browse the repository at this point in the history
  • Loading branch information
Aircoookie authored May 11, 2020
2 parents 69a2ac8 + ef1f835 commit 3b96eef
Show file tree
Hide file tree
Showing 28 changed files with 2,526 additions and 2,238 deletions.
45 changes: 44 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,49 @@
## WLED changelog

### Development versions after 0.9.1 release
### Development versions after 0.10.0 release

#### Build 2005100

- Update to Espalexa v2.4.6 (+1.6kB free heap memory)
- Added `m5atom` PlatformIO environment

#### Build 2005090

- Default to ESP8266 Arduino core v2.7.1 in PlatformIO
- Fixed Preset Slot 16 always indicating as empty (#891)
- Disabled Alexa emulation by default (causes bootloop for some users)
- Added BWLT11 and SHOJO_PCB defines to NpbWrapper
- Merged pull request #898 adding Solid Glitter effect

### WLED version 0.10.0

#### Build 2005030

- DMX Single RGW and Single DRGB modes now support an additional white channel
- Improved palettes derived from set colors and changed their names

### Development versions between 0.9.1 and 0.10.0 release

#### Build 2005020

- Added ACST and ACST/ACDT timezones

#### Build 2005010

- Added module info page to web UI
- Added realtime override functionality to web UI
- Added individial segment power and brightness to web UI
- Added feature to one-click select single segment only by tapping segment name
- Removed palette jumping to default if color is changed

#### Build 2004300

- Added realtime override option and `lor` JSON property
- Added `lm` (live mode) and `lip` (live IP) properties to info in JSON API
- Added reset commands to APIs
- Added `json/si`, returning state and info, but no FX or Palette lists
- Added rollover detection to millis(). Can track uptimes longer than 49 days
- Attempted to fix Wifi issues with Unifi brand APs

#### Build 2004230

Expand Down
39 changes: 31 additions & 8 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ extra_configs =
# ------------------------------------------------------------------------------

# Release binaries follow
default_envs = nodemcuv2, esp01, esp01_1m_ota, esp01_1m_full, esp32dev, custom_WS2801, custom_APA102, custom_LEDPIN_16, custom_LEDPIN_4, custom32_LEDPIN_16
; default_envs = nodemcuv2, esp01, esp01_1m_ota, esp01_1m_full, esp32dev, custom_WS2801, custom_APA102, custom_LEDPIN_16, custom_LEDPIN_4, custom32_LEDPIN_16

# Single binaries (uncomment your board)
; default_envs = nodemcuv2
Expand All @@ -34,6 +34,8 @@ default_envs = nodemcuv2, esp01, esp01_1m_ota, esp01_1m_full, esp32dev, custom_W
; default_envs = esp8285_4CH_H801
; default_envs = esp8285_5CH_H801
; default_envs = d1_mini_5CH_Shojo_PCB
; default_envs = wemos_shield_esp32
; default_envs = m5atom

[common]
# ------------------------------------------------------------------------------
Expand All @@ -50,6 +52,7 @@ default_envs = nodemcuv2, esp01, esp01_1m_ota, esp01_1m_full, esp32dev, custom_W
# arduino core 2.6.1 = platformIO 2.3.0
# arduino core 2.6.2 = platformIO 2.3.1
# arduino core 2.6.3 = platformIO 2.3.2
# arduino core 2.7.0 = platformIO 2.5.0
# ------------------------------------------------------------------------------
arduino_core_2_3_0 = [email protected]
arduino_core_2_4_0 = [email protected]
Expand All @@ -61,13 +64,14 @@ arduino_core_2_5_2 = [email protected]
arduino_core_2_6_1 = [email protected]
arduino_core_2_6_2 = [email protected]
arduino_core_2_6_3 = [email protected]
arduino_core_2_7_1 = [email protected]

# Development platforms
arduino_core_develop = https://github.com/platformio/platform-espressif8266#develop
arduino_core_git = https://github.com/platformio/platform-espressif8266#feature/stage

platform = ${common.arduino_core_2_4_2}
platform_latest = ${common.arduino_core_2_6_3}
# Platform to use for ESP8266
platform_latest = ${common.arduino_core_2_7_1}

# ------------------------------------------------------------------------------
# FLAGS: DEBUG
Expand Down Expand Up @@ -161,8 +165,7 @@ lib_deps =
#For use SSD1306 OLED display uncomment following
#U8g2@~2.27.2
#For Dallas sensor uncomment following 2 lines
DallasTemperature@~3.8.0
OneWire@~2.3.5
#OneWire@~2.3.5
#For BME280 sensor uncomment following
#BME280@~3.0.0
lib_ignore =
Expand All @@ -183,13 +186,13 @@ board = esp01
platform = ${common.platform_latest}
board_build.ldscript = ${common.ldscript_512k}
build_flags = ${common.build_flags_esp8266} -D WLED_DISABLE_OTA -D WLED_DISABLE_ALEXA -D WLED_DISABLE_BLYNK
-D WLED_DISABLE_HUESYNC -D WLED_DISABLE_INFRARED
-D WLED_DISABLE_CRONIXIE -D WLED_DISABLE_HUESYNC -D WLED_DISABLE_INFRARED

[env:esp01_1m_ota]
board = esp01_1m
platform = ${common.platform_latest}
board_build.ldscript = ${common.ldscript_1m0m}
build_flags = ${common.build_flags_esp8266} -D WLED_DISABLE_ALEXA -D WLED_DISABLE_BLYNK -D WLED_DISABLE_HUESYNC -D WLED_DISABLE_INFRARED
build_flags = ${common.build_flags_esp8266} -D WLED_DISABLE_ALEXA -D WLED_DISABLE_BLYNK -D WLED_DISABLE_CRONIXIE -D WLED_DISABLE_HUESYNC -D WLED_DISABLE_INFRARED

[env:esp01_1m_full]
board = esp01_1m
Expand All @@ -206,6 +209,7 @@ build_flags = ${common.build_flags_esp8266}
[env:d1_mini]
board = d1_mini
platform = ${common.platform_latest}
upload_speed = 921500
board_build.ldscript = ${common.ldscript_4m1m}
build_flags = ${common.build_flags_esp8266}

Expand Down Expand Up @@ -251,7 +255,7 @@ build_flags = ${common.build_flags_esp8266} -D WLED_DISABLE_HUESYNC -D WLED_USE_
board = d1_mini
platform = ${common.platform_latest}
board_build.ldscript = ${common.ldscript_4m1m}
build_flags = ${common.build_flags_esp8266} -D WLED_USE_ANALOG_LEDS -D SHOJO_PCB -D WLED_ENABLE_5CH_LEDS
build_flags = ${common.build_flags_esp8266} -D WLED_USE_ANALOG_LEDS -D WLED_USE_SHOJO_PCB -D WLED_ENABLE_5CH_LEDS

# ------------------------------------------------------------------------------
# DEVELOPMENT BOARDS
Expand Down Expand Up @@ -309,6 +313,25 @@ lib_ignore =
ESPAsyncTCP
ESPAsyncUDP

[env:wemos_shield_esp32]
board = esp32dev
platform = [email protected]
upload_port = /dev/cu.SLAB_USBtoUART
monitor_port = /dev/cu.SLAB_USBtoUART
upload_speed = 460800
build_flags = ${common.build_flags_esp32} -D LEDPIN=16 -D RLYPIN=19 -D BTNPIN=17
lib_ignore =
ESPAsyncTCP
ESPAsyncUDP

[env:m5atom]
board = esp32dev
build_flags = ${common.build_flags_esp32} -D LEDPIN=27 -D BTNPIN=39
lib_ignore =
ESPAsyncTCP
ESPAsyncUDP
platform = [email protected]

# ------------------------------------------------------------------------------
# travis test board configurations
# ------------------------------------------------------------------------------
Expand Down
70 changes: 48 additions & 22 deletions usermods/Wemos_D1_mini+Wemos32_mini_shield/usermod.cpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,49 @@
#include "wled.h"
#include <Arduino.h>
#include <U8x8lib.h> // from https://github.com/olikraus/u8g2/
#include <DallasTemperature.h> //Dallastemperature sensor
#ifdef ARDUINO_ARCH_ESP32 //ESP32 boards
#include <OneWire.h> // Dallas temperature sensor

//Dallas sensor quick reading. Credit to - Author: Peter Scargill, August 17th, 2013
int16_t Dallas(int x, byte start)
{
OneWire DallasSensor(x);
byte i;
byte data[2];
int16_t result;
do
{
DallasSensor.reset();
DallasSensor.write(0xCC);
DallasSensor.write(0xBE);
for ( i = 0; i < 2; i++) data[i] = DallasSensor.read();
result=(data[1]<<8)|data[0];
result>>=4; if (data[1]&128) result|=61440;
if (data[0]&8) ++result;
DallasSensor.reset();
DallasSensor.write(0xCC);
DallasSensor.write(0x44,1);
if (start) delay(1000);
} while (start--);
return result;
}
#ifdef ARDUINO_ARCH_ESP32
uint8_t SCL_PIN = 22;
uint8_t SDA_PIN = 21;
OneWire oneWire(23);
#else //ESP8266 boards
uint8_t SDA_PIN = 21;
uint8_t DALLAS_PIN =23;
#else
uint8_t SCL_PIN = 5;
uint8_t SDA_PIN = 4;
uint8_t DALLAS_PIN =13;
// uint8_t RST_PIN = 16; // Uncoment for Heltec WiFi-Kit-8
OneWire oneWire(13);
#endif

//The SCL and SDA pins are defined here.
//ESP8266 Wemos D1 mini board use SCL=5 SDA=4 while ESP32 Wemos32 mini board use SCL=22 SDA=21
#define U8X8_PIN_SCL SCL_PIN
#define U8X8_PIN_SDA SDA_PIN
//#define U8X8_PIN_RESET RST_PIN // Uncoment for Heltec WiFi-Kit-8
// Dallas sensor
DallasTemperature sensor(&oneWire);

// Dallas sensor reading timer
long temptimer = millis();
long lastMeasure = 0;
#define Celsius // Show temperature mesaurement in Celcius otherwise is in Fahrenheit
Expand All @@ -36,7 +61,9 @@ U8X8_SSD1306_128X32_UNIVISION_HW_I2C u8x8(U8X8_PIN_NONE, U8X8_PIN_SCL, U8X8_PIN_
//U8X8_SSD1306_128X32_UNIVISION_HW_I2C u8x8(U8X8_PIN_RESET, U8X8_PIN_SCL, U8X8_PIN_SDA); // Constructor for Heltec WiFi-Kit-8
// gets called once at boot. Do all initialization that doesn't depend on network here
void userSetup() {
sensor.begin(); //Start Dallas temperature sensor
//Serial.begin(115200);

Dallas (DALLAS_PIN,1);
u8x8.begin();
u8x8.setPowerSave(0);
u8x8.setFlipMode(1);
Expand Down Expand Up @@ -77,18 +104,17 @@ void userLoop() {
//Check if MQTT Connected, otherwise it will crash the 8266
if (mqtt != nullptr)
{
sensor.requestTemperatures();
// Serial.println(Dallas(DALLAS_PIN,0));
//Gets prefered temperature scale based on selection in definitions section
#ifdef Celsius
float board_temperature = sensor.getTempCByIndex(0);
#else
float board_temperature = sensor.getTempFByIndex(0);
#endif
#ifdef Celsius
int16_t board_temperature = Dallas(DALLAS_PIN,0);
#else
int16_t board_temperature = (Dallas(DALLAS_PIN,0)* 1.8 + 32);
#endif
//Create character string populated with user defined device topic from the UI, and the read temperature. Then publish to MQTT server.
char subuf[38];
strcpy(subuf, mqttDeviceTopic);
strcat(subuf, "/temperature");
mqtt->publish(subuf, 0, true, String(board_temperature).c_str());
String t = String(mqttDeviceTopic);
t += "/temperature";
mqtt->publish(t.c_str(), 0, true, String(board_temperature).c_str());
}
}

Expand Down Expand Up @@ -130,10 +156,10 @@ void userLoop() {
lastRedraw = millis();

// Update last known values.
#if defined(ESP8266)
knownSsid = apActive ? WiFi.softAPSSID() : WiFi.SSID();
#else
#ifdef ARDUINO_ARCH_ESP32
knownSsid = WiFi.SSID();
#else
knownSsid = apActive ? WiFi.softAPSSID() : WiFi.SSID();
#endif
knownIp = apActive ? IPAddress(4, 3, 2, 1) : WiFi.localIP();
knownBrightness = bri;
Expand Down
12 changes: 12 additions & 0 deletions wled00/FX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3322,3 +3322,15 @@ CRGB WS2812FX::pacifica_one_layer(uint16_t i, CRGBPalette16& p, uint16_t cistart
uint8_t sindex8 = scale16(sindex16, 240);
return ColorFromPalette(p, sindex8, bri, LINEARBLEND);
}

//Solid colour background with glitter
uint16_t WS2812FX::mode_solid_glitter()
{
fill(SEGCOLOR(0));

if (SEGMENT.intensity > random8())
{
setPixelColor(random16(SEGLEN), ULTRAWHITE);
}
return FRAMETIME;
}
16 changes: 9 additions & 7 deletions wled00/FX.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
#define IS_REVERSE ((SEGMENT.options & REVERSE ) == REVERSE )
#define IS_SELECTED ((SEGMENT.options & SELECTED ) == SELECTED )

#define MODE_COUNT 103
#define MODE_COUNT 104

#define FX_MODE_STATIC 0
#define FX_MODE_BLINK 1
Expand Down Expand Up @@ -203,6 +203,7 @@
#define FX_MODE_HEARTBEAT 100
#define FX_MODE_PACIFICA 101
#define FX_MODE_CANDLE_MULTI 102
#define FX_MODE_SOLID_GLITTER 103

class WS2812FX {
typedef uint16_t (WS2812FX::*mode_ptr)(void);
Expand All @@ -219,7 +220,7 @@ class WS2812FX {
uint8_t intensity;
uint8_t palette;
uint8_t mode;
uint8_t options; //bit pattern: msb first: transitional tbd tbd tbd tbd paused reverse selected
uint8_t options; //bit pattern: msb first: transitional needspixelstate tbd tbd (paused) on reverse selected
uint8_t grouping, spacing;
uint8_t opacity;
uint32_t colors[NUM_COLORS];
Expand Down Expand Up @@ -394,6 +395,7 @@ class WS2812FX {
_mode[FX_MODE_HEARTBEAT] = &WS2812FX::mode_heartbeat;
_mode[FX_MODE_PACIFICA] = &WS2812FX::mode_pacifica;
_mode[FX_MODE_CANDLE_MULTI] = &WS2812FX::mode_candle_multi;
_mode[FX_MODE_SOLID_GLITTER] = &WS2812FX::mode_solid_glitter;

_brightness = DEFAULT_BRIGHTNESS;
currentPalette = CRGBPalette16(CRGB::Black);
Expand Down Expand Up @@ -562,7 +564,7 @@ class WS2812FX {
mode_twinklecat(void),
mode_halloween_eyes(void),
mode_static_pattern(void),
mode_tri_static_pattern(void),
mode_tri_static_pattern(void),
mode_spots(void),
mode_spots_fade(void),
mode_glitter(void),
Expand All @@ -580,8 +582,8 @@ class WS2812FX {
mode_ripple_rainbow(void),
mode_heartbeat(void),
mode_pacifica(void),
mode_candle_multi(void);

mode_candle_multi(void),
mode_solid_glitter(void);

private:
NeoPixelWrapper *bus;
Expand Down Expand Up @@ -667,12 +669,12 @@ const char JSON_mode_names[] PROGMEM = R"=====([
"Noise 1","Noise 2","Noise 3","Noise 4","Colortwinkles","Lake","Meteor","Meteor Smooth","Railway","Ripple",
"Twinklefox","Twinklecat","Halloween Eyes","Solid Pattern","Solid Pattern Tri","Spots","Spots Fade","Glitter","Candle","Fireworks Starburst",
"Fireworks 1D","Bouncing Balls","Sinelon","Sinelon Dual","Sinelon Rainbow","Popcorn","Drip","Plasma","Percent","Ripple Rainbow",
"Heartbeat","Pacifica","Candle Multi"
"Heartbeat","Pacifica","Candle Multi", "Solid Glitter"
])=====";


const char JSON_palette_names[] PROGMEM = R"=====([
"Default","Random Cycle","Primary Color","Based on Primary","Set Colors","Based on Set","Party","Cloud","Lava","Ocean",
"Default","* Random Cycle","* Color 1","* Colors 1&2","* Color Gradient","* Colors Only","Party","Cloud","Lava","Ocean",
"Forest","Rainbow","Rainbow Bands","Sunset","Rivendell","Breeze","Red & Blue","Yellowout","Analogous","Splash",
"Pastel","Sunset 2","Beech","Vintage","Departure","Landscape","Beach","Sherbet","Hult","Hult 64",
"Drywet","Jul","Grintage","Rewhi","Tertiary","Fire","Icefire","Cyane","Light Pink","Autumn",
Expand Down
Loading

0 comments on commit 3b96eef

Please sign in to comment.