Skip to content

Commit 3a426e2

Browse files
authored
Merge branch 'main' into blending-styles
2 parents a65f97a + 4951be6 commit 3a426e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1155
-352
lines changed

boards/lolin_s3_mini.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"build": {
3+
"arduino": {
4+
"ldscript": "esp32s3_out.ld",
5+
"memory_type": "qio_qspi"
6+
},
7+
"core": "esp32",
8+
"extra_flags": [
9+
"-DBOARD_HAS_PSRAM",
10+
"-DARDUINO_LOLIN_S3_MINI",
11+
"-DARDUINO_USB_MODE=1"
12+
],
13+
"f_cpu": "240000000L",
14+
"f_flash": "80000000L",
15+
"flash_mode": "qio",
16+
"hwids": [
17+
[
18+
"0x303A",
19+
"0x8167"
20+
]
21+
],
22+
"mcu": "esp32s3",
23+
"variant": "lolin_s3_mini"
24+
},
25+
"connectivity": [
26+
"bluetooth",
27+
"wifi"
28+
],
29+
"debug": {
30+
"openocd_target": "esp32s3.cfg"
31+
},
32+
"frameworks": [
33+
"arduino",
34+
"espidf"
35+
],
36+
"name": "WEMOS LOLIN S3 Mini",
37+
"upload": {
38+
"flash_size": "4MB",
39+
"maximum_ram_size": 327680,
40+
"maximum_size": 4194304,
41+
"require_upload_port": true,
42+
"speed": 460800
43+
},
44+
"url": "https://www.wemos.cc/en/latest/s3/index.html",
45+
"vendor": "WEMOS"
46+
}
47+

platformio.ini

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# ------------------------------------------------------------------------------
1111

1212
# CI/release binaries
13-
default_envs = nodemcuv2, esp8266_2m, esp01_1m_full, nodemcuv2_160, esp8266_2m_160, esp01_1m_full_160, nodemcuv2_compat, esp8266_2m_compat, esp01_1m_full_compat, esp32dev, esp32_eth, lolin_s2_mini, esp32c3dev, esp32s3dev_16MB_opi, esp32s3dev_8MB_opi, esp32s3_4M_qspi, esp32_wrover
13+
default_envs = nodemcuv2, esp8266_2m, esp01_1m_full, nodemcuv2_160, esp8266_2m_160, esp01_1m_full_160, nodemcuv2_compat, esp8266_2m_compat, esp01_1m_full_compat, esp32dev, esp32dev_V4, esp32_eth, lolin_s2_mini, esp32c3dev, esp32s3dev_16MB_opi, esp32s3dev_8MB_opi, esp32s3_4M_qspi, esp32_wrover
1414

1515
src_dir = ./wled00
1616
data_dir = ./wled00/data
@@ -273,23 +273,25 @@ board_build.partitions = ${esp32.default_partitions} ;; default partioning for
273273
;;
274274
;; please note that you can NOT update existing ESP32 installs with a "V4" build. Also updating by OTA will not work properly.
275275
;; You need to completely erase your device (esptool erase_flash) first, then install the "V4" build from VSCode+platformio.
276-
platform = espressif32@ ~6.3.2
277-
platform_packages = platformio/framework-arduinoespressif32 @ 3.20009.0 ;; select arduino-esp32 v2.0.9 (arduino-esp32 2.0.10 thru 2.0.14 are buggy so avoid them)
276+
277+
;; select arduino-esp32 v2.0.9 (arduino-esp32 2.0.10 thru 2.0.14 are buggy so avoid them)
278+
platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.06.02/platform-espressif32.zip ;; Tasmota Arduino Core 2.0.9 with IPv6 support, based on IDF 4.4.4
278279
build_unflags = ${common.build_unflags}
279280
build_flags = -g
280281
-Wshadow=compatible-local ;; emit warning in case a local variable "shadows" another local one
281282
-DARDUINO_ARCH_ESP32 -DESP32
282283
-D CONFIG_ASYNC_TCP_USE_WDT=0
283284
-DARDUINO_USB_CDC_ON_BOOT=0 ;; this flag is mandatory for "classic ESP32" when building with arduino-esp32 >=2.0.3
285+
-D WLED_ENABLE_DMX_INPUT
284286
lib_deps =
285287
https://github.com/pbolduc/AsyncTCP.git @ 1.2.0
288+
https://github.com/someweisguy/esp_dmx.git#47db25d
286289
${env.lib_deps}
287290
board_build.partitions = ${esp32.default_partitions} ;; default partioning for 4MB Flash - can be overridden in build envs
288291

289292
[esp32s2]
290293
;; generic definitions for all ESP32-S2 boards
291294
platform = ${esp32_idf_V4.platform}
292-
platform_packages = ${esp32_idf_V4.platform_packages}
293295
build_unflags = ${common.build_unflags}
294296
build_flags = -g
295297
-DARDUINO_ARCH_ESP32
@@ -309,7 +311,6 @@ board_build.partitions = ${esp32.default_partitions} ;; default partioning for
309311
[esp32c3]
310312
;; generic definitions for all ESP32-C3 boards
311313
platform = ${esp32_idf_V4.platform}
312-
platform_packages = ${esp32_idf_V4.platform_packages}
313314
build_unflags = ${common.build_unflags}
314315
build_flags = -g
315316
-DARDUINO_ARCH_ESP32
@@ -324,11 +325,11 @@ lib_deps =
324325
https://github.com/pbolduc/AsyncTCP.git @ 1.2.0
325326
${env.lib_deps}
326327
board_build.partitions = ${esp32.default_partitions} ;; default partioning for 4MB Flash - can be overridden in build envs
328+
board_build.flash_mode = qio
327329

328330
[esp32s3]
329331
;; generic definitions for all ESP32-S3 boards
330332
platform = ${esp32_idf_V4.platform}
331-
platform_packages = ${esp32_idf_V4.platform_packages}
332333
build_unflags = ${common.build_unflags}
333334
build_flags = -g
334335
-DESP32
@@ -432,10 +433,21 @@ lib_deps = ${esp32.lib_deps}
432433
monitor_filters = esp32_exception_decoder
433434
board_build.partitions = ${esp32.default_partitions}
434435

436+
[env:esp32dev_V4]
437+
board = esp32dev
438+
platform = ${esp32_idf_V4.platform}
439+
build_unflags = ${common.build_unflags}
440+
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_V4\" #-D WLED_DISABLE_BROWNOUT_DET
441+
${esp32.AR_build_flags}
442+
lib_deps = ${esp32_idf_V4.lib_deps}
443+
${esp32.AR_lib_deps}
444+
monitor_filters = esp32_exception_decoder
445+
board_build.partitions = ${esp32.default_partitions}
446+
board_build.flash_mode = dio
447+
435448
[env:esp32dev_8M]
436449
board = esp32dev
437450
platform = ${esp32_idf_V4.platform}
438-
platform_packages = ${esp32_idf_V4.platform_packages}
439451
build_unflags = ${common.build_unflags}
440452
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_8M\" #-D WLED_DISABLE_BROWNOUT_DET
441453
${esp32.AR_build_flags}
@@ -451,7 +463,6 @@ board_upload.maximum_size = 8388608
451463
[env:esp32dev_16M]
452464
board = esp32dev
453465
platform = ${esp32_idf_V4.platform}
454-
platform_packages = ${esp32_idf_V4.platform_packages}
455466
build_unflags = ${common.build_unflags}
456467
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_16M\" #-D WLED_DISABLE_BROWNOUT_DET
457468
${esp32.AR_build_flags}
@@ -494,7 +505,6 @@ board_build.partitions = ${esp32.default_partitions}
494505
[env:esp32_wrover]
495506
extends = esp32_idf_V4
496507
platform = ${esp32_idf_V4.platform}
497-
platform_packages = ${esp32_idf_V4.platform_packages}
498508
board = ttgo-t7-v14-mini32
499509
board_build.f_flash = 80000000L
500510
board_build.flash_mode = qio
@@ -510,7 +520,6 @@ lib_deps = ${esp32_idf_V4.lib_deps}
510520
[env:esp32c3dev]
511521
extends = esp32c3
512522
platform = ${esp32c3.platform}
513-
platform_packages = ${esp32c3.platform_packages}
514523
framework = arduino
515524
board = esp32-c3-devkitm-1
516525
board_build.partitions = ${esp32.default_partitions}
@@ -528,7 +537,6 @@ lib_deps = ${esp32c3.lib_deps}
528537
board = esp32-s3-devkitc-1 ;; generic dev board; the next line adds PSRAM support
529538
board_build.arduino.memory_type = qio_opi ;; use with PSRAM: 8MB or 16MB
530539
platform = ${esp32s3.platform}
531-
platform_packages = ${esp32s3.platform_packages}
532540
upload_speed = 921600
533541
build_unflags = ${common.build_unflags}
534542
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_16MB_opi\"
@@ -551,7 +559,6 @@ monitor_filters = esp32_exception_decoder
551559
board = esp32-s3-devkitc-1 ;; generic dev board; the next line adds PSRAM support
552560
board_build.arduino.memory_type = qio_opi ;; use with PSRAM: 8MB or 16MB
553561
platform = ${esp32s3.platform}
554-
platform_packages = ${esp32s3.platform_packages}
555562
upload_speed = 921600
556563
build_unflags = ${common.build_unflags}
557564
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_8MB_opi\"
@@ -571,7 +578,6 @@ monitor_filters = esp32_exception_decoder
571578
;; For ESP32-S3 WROOM-2, a.k.a. ESP32-S3 DevKitC-1 v1.1
572579
;; with >= 16MB FLASH and >= 8MB PSRAM (memory_type: opi_opi)
573580
platform = ${esp32s3.platform}
574-
platform_packages = ${esp32s3.platform_packages}
575581
board = esp32s3camlcd ;; this is the only standard board with "opi_opi"
576582
board_build.arduino.memory_type = opi_opi
577583
upload_speed = 921600
@@ -598,7 +604,6 @@ monitor_filters = esp32_exception_decoder
598604
;; ESP32-S3, with 4MB FLASH and <= 4MB PSRAM (memory_type: qio_qspi)
599605
board = lolin_s3_mini ;; -S3 mini, 4MB flash 2MB PSRAM
600606
platform = ${esp32s3.platform}
601-
platform_packages = ${esp32s3.platform_packages}
602607
upload_speed = 921600
603608
build_unflags = ${common.build_unflags}
604609
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_4M_qspi\"
@@ -616,7 +621,6 @@ monitor_filters = esp32_exception_decoder
616621

617622
[env:lolin_s2_mini]
618623
platform = ${esp32s2.platform}
619-
platform_packages = ${esp32s2.platform_packages}
620624
board = lolin_s2_mini
621625
board_build.partitions = ${esp32.default_partitions}
622626
board_build.flash_mode = qio

platformio_override.sample.ini

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,3 +529,14 @@ monitor_filters = esp32_exception_decoder
529529
lib_deps =
530530
${esp32.lib_deps}
531531
TFT_eSPI @ 2.5.33 ;; this is the last version that compiles with the WLED default framework - newer versions require platform = espressif32 @ ^6.3.2
532+
533+
# ------------------------------------------------------------------------------
534+
# Usermod examples
535+
# ------------------------------------------------------------------------------
536+
537+
# 433MHz RF remote example for esp32dev
538+
[env:esp32dev_usermod_RF433]
539+
extends = env:esp32dev
540+
build_flags = ${env:esp32dev.build_flags} -D USERMOD_RF433
541+
lib_deps = ${env:esp32dev.lib_deps}
542+
sui77/rc-switch @ 2.6.4

tools/AutoCubeMap.xlsx

78.1 KB
Binary file not shown.

usermods/seven_segment_display_reloaded/readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Very loosely based on the existing usermod "seven segment display".
99

1010
Add the compile-time option `-D USERMOD_SSDR` to your `platformio.ini` (or `platformio_override.ini`) or use `#define USERMOD_SSDR` in `my_config.h`.
1111

12-
For the auto brightness option, the usermod SN_Photoresistor has to be installed as well. See SN_Photoresistor/readme.md for instructions.
12+
For the auto brightness option, the usermod SN_Photoresistor or BH1750_V2 has to be installed as well. See SN_Photoresistor/readme.md or BH1750_V2/readme.md for instructions.
1313

1414
## Settings
1515
All settings can be controlled via the usermod settings page.
@@ -28,10 +28,10 @@ Enables the blinking colon(s) if they are defined
2828
Shows the leading zero of the hour if it exists (i.e. shows `07` instead of `7`)
2929

3030
### enable-auto-brightness
31-
Enables the auto brightness feature. Can be used only when the usermod SN_Photoresistor is installed.
31+
Enables the auto brightness feature. Can be used only when the usermods SN_Photoresistor or BH1750_V2 are installed.
3232

3333
### auto-brightness-min / auto-brightness-max
34-
The lux value calculated from usermod SN_Photoresistor will be mapped to the values defined here.
34+
The lux value calculated from usermod SN_Photoresistor or BH1750_V2 will be mapped to the values defined here.
3535
The mapping, 0 - 1000 lux, will be mapped to auto-brightness-min and auto-brightness-max
3636

3737
WLED current protection will override the calculated value if it is too high.

usermods/seven_segment_display_reloaded/usermod_seven_segment_reloaded.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ class UsermodSSDR : public Usermod {
9797
#else
9898
void* ptr = nullptr;
9999
#endif
100+
#ifdef USERMOD_BH1750
101+
Usermod_BH1750* bh1750 = nullptr;
102+
#else
103+
void* bh1750 = nullptr;
104+
#endif
100105

101106
void _overlaySevenSegmentDraw() {
102107
int displayMaskLen = static_cast<int>(umSSDRDisplayMask.length());
@@ -387,6 +392,9 @@ class UsermodSSDR : public Usermod {
387392
#ifdef USERMOD_SN_PHOTORESISTOR
388393
ptr = (Usermod_SN_Photoresistor*) UsermodManager::lookup(USERMOD_ID_SN_PHOTORESISTOR);
389394
#endif
395+
#ifdef USERMOD_BH1750
396+
bh1750 = (Usermod_BH1750*) UsermodManager::lookup(USERMOD_ID_BH1750);
397+
#endif
390398
DEBUG_PRINTLN(F("Setup done"));
391399
}
392400

@@ -410,6 +418,20 @@ class UsermodSSDR : public Usermod {
410418
umSSDRLastRefresh = millis();
411419
}
412420
#endif
421+
#ifdef USERMOD_BH1750
422+
if(bri != 0 && umSSDREnableLDR && (millis() - umSSDRLastRefresh > umSSDRResfreshTime)) {
423+
if (bh1750 != nullptr) {
424+
float lux = bh1750->getIlluminance();
425+
uint16_t brightness = map(lux, 0, 1000, umSSDRBrightnessMin, umSSDRBrightnessMax);
426+
if (bri != brightness) {
427+
DEBUG_PRINTF("Adjusting brightness based on lux value: %.2f lx, new brightness: %d\n", lux, brightness);
428+
bri = brightness;
429+
stateUpdated(1);
430+
}
431+
}
432+
umSSDRLastRefresh = millis();
433+
}
434+
#endif
413435
}
414436

415437
void handleOverlayDraw() {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# RF433 remote usermod
2+
3+
Usermod for controlling WLED using a generic 433 / 315MHz remote and simple 3-pin receiver
4+
See <https://github.com/sui77/rc-switch/> for compatibility details
5+
6+
## Build
7+
8+
- Create a `platformio_override.ini` file at the root of the wled source directory if not already present
9+
- Copy the `433MHz RF remote example for esp32dev` section from `platformio_override.sample.ini` into it
10+
- Duplicate/adjust for other boards
11+
12+
## Usage
13+
14+
- Connect receiver to a free pin
15+
- Set pin in Config->Usermods
16+
- Info pane will show the last received button code
17+
- Upload the remote433.json sample file in this folder to the ESP with the file editor at [http://\[wled-ip\]/edit](http://ip/edit)
18+
- Edit as necessary, the key is the button number retrieved from the info pane, and the "cmd" can be either an [HTTP API](https://kno.wled.ge/interfaces/http-api/) or a [JSON API](https://kno.wled.ge/interfaces/json-api/) command.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"13985576": {
3+
"cmnt": "Toggle Power using HTTP API",
4+
"cmd": "T=2"
5+
},
6+
"3670817": {
7+
"cmnt": "Force Power ON using HTTP API",
8+
"cmd": "T=1"
9+
},
10+
"13985572": {
11+
"cmnt": "Set brightness to 200 using JSON API",
12+
"cmd": {"bri":200}
13+
},
14+
"3670818": {
15+
"cmnt": "Run Preset 1 using JSON API",
16+
"cmd": {"ps":1}
17+
},
18+
"13985570": {
19+
"cmnt": "Increase brightness by 40 using HTTP API",
20+
"cmd": "A=~40"
21+
},
22+
"13985569": {
23+
"cmnt": "Decrease brightness by 40 using HTTP API",
24+
"cmd": "A=~-40"
25+
},
26+
"7608836": {
27+
"cmnt": "Start 1min timer using JSON API",
28+
"cmd": {"nl":{"on":true,"dur":1,"mode":0}}
29+
},
30+
"7608840": {
31+
"cmnt": "Select random effect on all segments using JSON API",
32+
"cmd": {"seg":{"fx":"r"}}
33+
}
34+
}

0 commit comments

Comments
 (0)