Skip to content

Commit 169788c

Browse files
committed
Modify for GLEDOPTO
1 parent 4374f01 commit 169788c

7 files changed

Lines changed: 190 additions & 4 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ __pycache__/
1515
/managed_components
1616

1717
esp01-update.sh
18-
platformio_override.ini
18+
# platformio_override.ini
1919
platformio_release.ini
2020
replace_fs.py
2121
wled-update.sh

platformio_override.ini

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
[platformio]
2+
default_envs =
3+
GL-C-211WL
4+
GL-C-615WL ; = GL-C-015WL-M
5+
GL-C-616WL
6+
GL-C-618WL
7+
GL-C-620WL
8+
9+
[gledopto_flags]
10+
build_flags =
11+
-D WLED_BRAND="\"GLEDOPTO\""
12+
-D SERVERNAME='"WLED-Gledopto"'
13+
-D DEFAULT_AP_SSID="\"WLED-AP\""
14+
15+
; microphone configuration
16+
[mic_pdm]
17+
build_flags =
18+
-D UM_AUDIOREACTIVE_ENABLE
19+
-D SR_DMTYPE=5
20+
-D I2S_SDPIN=32
21+
-D I2S_WSPIN=15
22+
-D I2S_CKPIN=-1
23+
-D MCLK_PIN=-1
24+
-D SR_AGC=2
25+
-D SR_SQUELCH=4
26+
27+
[env:GL-C-211WL]
28+
extends = env:esp32dev
29+
build_flags =
30+
${env:esp32dev.build_flags}
31+
${gledopto_flags.build_flags}
32+
; button configuration
33+
-D BTNPIN=0,-1,-1,-1
34+
-D BTNTYPE=2
35+
; led configuration
36+
-D DATA_PINS=19,18,17,16,4
37+
-D LED_TYPES=45
38+
-D WLED_PRODUCT_NAME="\"GL-C-211WL\""
39+
40+
[env:GL-C-615WL]
41+
extends = env:esp32dev
42+
build_flags =
43+
${env:esp32dev.build_flags}
44+
${gledopto_flags.build_flags}
45+
${mic_pdm.build_flags}
46+
; button configuration
47+
-D RLYPIN=18
48+
-D RLYMDE=true
49+
-D BTNPIN=17,-1,-1,-1
50+
-D BTNTYPE=2
51+
; led configuration
52+
-D DATA_PINS=16,2
53+
-D PIXEL_COUNTS=30,30
54+
-D LED_TYPES=22,22
55+
-D WLED_PRODUCT_NAME="\"GL-C-615WL\""
56+
57+
[env:GL-C-616WL]
58+
extends = env:esp32_eth
59+
build_flags =
60+
${env:esp32_eth.build_flags}
61+
${gledopto_flags.build_flags}
62+
${mic_pdm.build_flags}
63+
; button configuration
64+
-D RLYPIN=18
65+
-D RLYMDE=true
66+
-D BTNPIN=17,-1,-1,-1
67+
-D BTNTYPE=2
68+
; led configuration
69+
-D DATA_PINS=16,2
70+
-D PIXEL_COUNTS=30,30
71+
-D LED_TYPES=22,22
72+
-D WLED_ETH_DEFAULT=13
73+
-D WLED_PRODUCT_NAME="\"GL-C-616WL\""
74+
75+
[env:GL-C-618WL]
76+
extends = env:esp32_eth
77+
build_flags =
78+
${env:esp32_eth.build_flags}
79+
${gledopto_flags.build_flags}
80+
${mic_pdm.build_flags}
81+
; button configuration
82+
-D RLYPIN=18
83+
-D RLYMDE=true
84+
-D BTNPIN=17,-1,-1,-1
85+
-D BTNTYPE=2
86+
; led configuration
87+
-D DATA_PINS=16,12,4,2
88+
-D PIXEL_COUNTS=30,30,30,30
89+
-D LED_TYPES=22,22,22,22
90+
; Ethernet configuration
91+
-D WLED_ETH_DEFAULT=13 ; gledopto ethernet
92+
-D WLED_PRODUCT_NAME="\"GL-C-618WL\""
93+
94+
[env:GL-C-620WL]
95+
extends = env:esp32_eth
96+
build_flags =
97+
${env:esp32_eth.build_flags}
98+
${gledopto_flags.build_flags}
99+
${mic_pdm.build_flags}
100+
; button configuration
101+
-D RLYPIN=18
102+
-D RLYMDE=true
103+
-D BTNPIN=17,-1,-1,-1
104+
-D BTNTYPE=2
105+
; led configuration
106+
-D DATA_PINS=2,4,16
107+
-D PIXEL_COUNTS=1,30
108+
-D LED_TYPES=42,22
109+
; Ethernet configuration
110+
-D WLED_ETH_DEFAULT=13 ; gledopto ethernet
111+
-D WLED_BOOT_PRESET=1
112+
-D WLED_PRODUCT_NAME="\"GL-C-620WL\""

wled00/const.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ constexpr size_t WLED_MAX_USERMOD_PALETTES = WLED_USERMOD_PALETTE_ID_BASE -
4444

4545
//Defaults
4646
#define DEFAULT_CLIENT_SSID "Your_Network"
47+
#ifndef DEFAULT_AP_SSID
4748
#define DEFAULT_AP_SSID WLED_BRAND "-AP"
49+
#endif
4850
#define DEFAULT_AP_PASS "wled1234"
4951
#define DEFAULT_OTA_PASS "wledota"
5052
#define DEFAULT_MDNS_NAME "x"

wled00/data/settings_sec.htm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ <h2>Security & Update Setup</h2>
6363
<div class="sec" id="OTA">
6464
<h3>Software Update</h3>
6565
<button type="button" onclick="U()">Manual OTA Update</button><br>
66+
<div class="warn">&#9888; The controller uses Gledopto customized firmware, and has default configurations for microphone, relay and other functions, plug and play. Please be sure to configure each function correctly if changing the firmware.</div>
6667
<div id="aOTA">Enable ArduinoOTA: <input type="checkbox" name="AO"></div>
6768
Only allow update from same network/WiFi: <input type="checkbox" name="SU"><br>
6869
<i class="warn">&#9888; If you are using multiple VLANs (i.e. IoT or guest network) either set PIN or disable this option.<br>

wled00/data/settings_wifi.htm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,9 @@ <h3>ESP-NOW Wireless</h3>
303303
Enable ESP-NOW: <input type="checkbox" name="RE" onchange="tE()"><br>
304304
<i>Listen for events over ESP-NOW<br>
305305
Keep disabled if not using a remote or ESP-NOW sync, increases power consumption.<br></i>
306+
<div class="warn">
307+
&#9888; This program supports GL-RC-002WL remote control!
308+
</div>
306309
<div id="rlc">
307310
Last device seen: <span class="rlid" id="ld">None</span>
308311
<button type="button" class="sml" id="+" onclick="aR('RM'+rC,gId('ld').textContent)">+</button><br>

wled00/presets.cpp

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,72 @@ bool getPresetName(byte index, String& name)
9898
releaseJSONBufferLock();
9999
return presetExists;
100100
}
101-
101+
#ifdef WLED_BOOT_PRESET
102+
void initPresetsFile()
103+
{
104+
char fileName[33];
105+
strncpy_P(fileName, getPresetsFileName(), 32);
106+
fileName[32] = 0;
107+
108+
if (WLED_FS.exists(fileName))
109+
{
110+
File f = WLED_FS.open(fileName, "r");
111+
if (f && f.size() > 100)
112+
{
113+
f.close();
114+
return;
115+
}
116+
if (f)
117+
f.close();
118+
}
119+
const char presetJson[] =
120+
"{"
121+
"\"0\":{},"
122+
"\"1\":{"
123+
"\"on\":true,"
124+
"\"bri\":128,"
125+
"\"transition\":7,"
126+
"\"mainseg\":0,"
127+
"\"n\":\"Default State\","
128+
"\"seg\":["
129+
"{"
130+
"\"id\":0,"
131+
"\"start\":0,"
132+
"\"stop\":1,"
133+
"\"on\":true,"
134+
"\"bri\":128,"
135+
"\"cct\":117,"
136+
"\"col\":[[255,255,255,255],[0,0,0,0],[0,0,0,0]],"
137+
"\"fx\":0,"
138+
"\"sx\":128,"
139+
"\"ix\":128,"
140+
"\"pal\":0"
141+
"},"
142+
"{"
143+
"\"id\":1,"
144+
"\"start\":1,"
145+
"\"stop\":31,"
146+
"\"on\":true,"
147+
"\"bri\":128,"
148+
"\"col\":[[255,165,0],[0,0,0,0],[0,0,0,0]],"
149+
"\"fx\":0,"
150+
"\"sx\":128,"
151+
"\"ix\":128,"
152+
"\"pal\":0"
153+
"}"
154+
"]"
155+
"}"
156+
"}";
157+
File f = WLED_FS.open(fileName, "w");
158+
if (!f)
159+
{
160+
errorFlag = ERR_FS_GENERAL;
161+
return;
162+
}
163+
f.print(presetJson);
164+
f.close();
165+
}
166+
#else
102167
void initPresetsFile()
103168
{
104169
char fileName[33]; strncpy_P(fileName, getPresetsFileName(), 32); fileName[32] = 0; //use PROGMEM safe copy as FS.open() does not
@@ -115,7 +180,7 @@ void initPresetsFile()
115180
serializeJson(doc, f);
116181
f.close();
117182
}
118-
183+
#endif
119184
bool applyPresetFromPlaylist(byte index)
120185
{
121186
DEBUG_PRINTF_P(PSTR("Request to apply preset: %d\n"), index);

wled00/wled.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,11 @@ WLED_GLOBAL uint8_t txPower _INIT(WIFI_POWER_19_5dBm);
394394

395395
// LED CONFIG
396396
WLED_GLOBAL bool turnOnAtBoot _INIT(true); // turn on LEDs at power-up
397+
#ifdef WLED_BOOT_PRESET
398+
WLED_GLOBAL byte bootPreset _INIT(WLED_BOOT_PRESET); // save preset to load after power-up
399+
#else
397400
WLED_GLOBAL byte bootPreset _INIT(0); // save preset to load after power-up
398-
401+
#endif
399402
//if true, a segment per bus will be created on boot and LED settings save
400403
//if false, only one segment spanning the total LEDs is created,
401404
//but not on LED settings save if there is more than one segment currently

0 commit comments

Comments
 (0)