Skip to content

Commit 0e00986

Browse files
committed
Modify for GLEDOPTO
1 parent 29b389d commit 0e00986

7 files changed

Lines changed: 247 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: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
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+
GL-C-017WL
9+
GL-C-619WL
10+
GL-C-611WL
11+
12+
[gledopto_flags]
13+
build_flags =
14+
-D WLED_BRAND="\"GLEDOPTO\""
15+
-D SERVERNAME='"WLED-Gledopto"'
16+
-D WLED_AP_SSID="\"WLED-AP\""
17+
18+
; microphone configuration
19+
[mic_pdm]
20+
build_flags =
21+
-D UM_AUDIOREACTIVE_ENABLE
22+
-D SR_DMTYPE=5
23+
-D I2S_SDPIN=32
24+
-D I2S_WSPIN=15
25+
-D I2S_CKPIN=-1
26+
-D MCLK_PIN=-1
27+
-D SR_AGC=2
28+
-D SR_SQUELCH=4
29+
30+
[env:GL-C-211WL]
31+
extends = env:esp32dev
32+
build_flags =
33+
-D WLED_RELEASE_NAME="\"GL-C-211W\""
34+
${env:esp32dev.build_flags}
35+
${gledopto_flags.build_flags}
36+
; button configuration
37+
-D BTNPIN=0,-1,-1,-1
38+
-D BTNTYPE=2
39+
; led configuration
40+
-D DATA_PINS=19,18,17,16,4
41+
-D LED_TYPES=45
42+
-D WLED_PRODUCT_NAME="\"GL-C-211WL\""
43+
44+
[env:GL-C-615WL]
45+
extends = env:esp32dev
46+
build_flags =
47+
-D WLED_RELEASE_NAME="\"GL-C-615WL\""
48+
${env:esp32dev.build_flags}
49+
${gledopto_flags.build_flags}
50+
${mic_pdm.build_flags}
51+
; button configuration
52+
-D RLYPIN=18
53+
-D RLYMDE=true
54+
-D BTNPIN=17,-1,-1,-1
55+
-D BTNTYPE=2
56+
; led configuration
57+
-D DATA_PINS=16,2
58+
-D PIXEL_COUNTS=30,30
59+
-D LED_TYPES=22,22
60+
-D WLED_PRODUCT_NAME="\"GL-C-615WL\""
61+
62+
[env:GL-C-616WL]
63+
extends = env:esp32_eth
64+
build_flags =
65+
-D WLED_RELEASE_NAME="\"GL-C-616WL\""
66+
${env:esp32_eth.build_flags}
67+
${gledopto_flags.build_flags}
68+
${mic_pdm.build_flags}
69+
; button configuration
70+
-D RLYPIN=18
71+
-D RLYMDE=true
72+
-D BTNPIN=17,-1,-1,-1
73+
-D BTNTYPE=2
74+
; led configuration
75+
-D DATA_PINS=16,2
76+
-D PIXEL_COUNTS=30,30
77+
-D LED_TYPES=22,22
78+
-D WLED_ETH_DEFAULT=13
79+
-D WLED_PRODUCT_NAME="\"GL-C-616WL\""
80+
81+
[env:GL-C-618WL]
82+
extends = env:esp32_eth
83+
build_flags =
84+
-D WLED_RELEASE_NAME="\"GL-C-618WL\""
85+
${env:esp32_eth.build_flags}
86+
${gledopto_flags.build_flags}
87+
${mic_pdm.build_flags}
88+
; button configuration
89+
-D RLYPIN=18
90+
-D RLYMDE=true
91+
-D BTNPIN=17,-1,-1,-1
92+
-D BTNTYPE=2
93+
; led configuration
94+
-D DATA_PINS=16,12,4,2
95+
-D PIXEL_COUNTS=30,30,30,30
96+
-D LED_TYPES=22,22,22,22
97+
; Ethernet configuration
98+
-D WLED_ETH_DEFAULT=13 ; gledopto ethernet
99+
-D WLED_PRODUCT_NAME="\"GL-C-618WL\""
100+
101+
[env:GL-C-620WL]
102+
extends = env:esp32_eth
103+
build_flags =
104+
-D WLED_RELEASE_NAME="\"GL-C-620WL\""
105+
${env:esp32_eth.build_flags}
106+
${gledopto_flags.build_flags}
107+
${mic_pdm.build_flags}
108+
; button configuration
109+
-D RLYPIN=18
110+
-D RLYMDE=true
111+
-D BTNPIN=17,-1,-1,-1
112+
-D BTNTYPE=2
113+
; led configuration
114+
-D DATA_PINS=2,4,16
115+
-D PIXEL_COUNTS=1,30
116+
-D LED_TYPES=42,22
117+
; Ethernet configuration
118+
-D WLED_ETH_DEFAULT=13 ; gledopto ethernet
119+
-D WLED_BOOT_PRESET=1
120+
-D WLED_PRODUCT_NAME="\"GL-C-620WL\""
121+
122+
[env:GL-C-017WL]
123+
extends = env:esp32dev
124+
build_flags =
125+
-D WLED_RELEASE_NAME="\"GL-C-017WL\""
126+
${env:esp32dev.build_flags}
127+
${gledopto_flags.build_flags}
128+
${mic_pdm.build_flags}
129+
-D RLYPIN=18
130+
-D RLYMDE=true
131+
-D BTNPIN=17,-1,-1,-1
132+
-D BTNTYPE=2
133+
; led configuration
134+
-D DATA_PINS=16,12,4,2
135+
-D LED_TYPES=22,22,22,22
136+
-D WLED_PRODUCT_NAME="\"GL-C-017WL\""
137+
; -D WLED_DEBUG
138+
139+
[env:GL-C-619WL]
140+
extends = env:esp32_eth
141+
build_flags =
142+
-D WLED_RELEASE_NAME="\"GL-C-619WL\""
143+
${env:esp32_eth.build_flags}
144+
${gledopto_flags.build_flags}
145+
${mic_pdm.build_flags}
146+
; button configuration
147+
-D RLYPIN=18
148+
-D RLYMDE=true
149+
-D BTNPIN=17,-1,-1,-1
150+
-D BTNTYPE=2
151+
; led configuration
152+
-D DATA_PINS=16,14,13,12,4,2
153+
-D PIXEL_COUNTS=30,30,30,30,30,30
154+
-D LED_TYPES=22,22,22,22,22,22
155+
-D WLED_ETH_DEFAULT=13
156+
-D WLED_PRODUCT_NAME="\"GL-C-619WL\""
157+
158+
[env:GL-C-611WL]
159+
extends = env:esp32_eth
160+
build_flags =
161+
-D WLED_RELEASE_NAME="\"GL-C-611WL\""
162+
${env:esp32_eth.build_flags}
163+
${gledopto_flags.build_flags}
164+
${mic_pdm.build_flags}
165+
-D BTNPIN=17,-1,-1,-1
166+
-D BTNTYPE=2
167+
-D DATA_PINS=18,16,12,4,2
168+
-D LED_TYPES=45
169+
-D WLED_ETH_DEFAULT=13
170+
-D WLED_PRODUCT_NAME="\"GL-C-611W\""

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()">Update WLED</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
@@ -299,6 +299,9 @@ <h3>ESP-NOW Wireless</h3>
299299
Enable ESP-NOW: <input type="checkbox" name="RE" onchange="tE()"><br>
300300
<i>Listen for events over ESP-NOW<br>
301301
Keep disabled if not using a remote or ESP-NOW sync, increases power consumption.<br></i>
302+
<div class="warn">
303+
&#9888; This program supports GL-RC-002WL remote control!
304+
</div>
302305
<div id="rlc">
303306
Last device seen: <span class="rlid" id="ld">None</span>
304307
<button type="button" class="sml" id="+" onclick="aR('RM'+rC,gId('ld').textContent)">+</button><br>

wled00/data/update.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ <h2>WLED Software Update</h2>
137137
Release: <span class="sip release-name">Loading...</span><br>
138138
<span id="Norelease-download">Latest release: Checking...<br></span>
139139
<span id="release-download" class="hide">
140-
Latest version: <a class="release-repo" href="https://github.com/wled/WLED/releases/latest" target="_blank" rel="noopener noreferrer"
140+
Latest version: <a class="release-repo" href="https://github.com/GLEDOPTO/WLED/releases" target="_blank" rel="noopener noreferrer"
141141
style="vertical-align: text-bottom; display: inline-flex;">
142142
<img class="release-badge" alt="View latest"></a><br>
143143
<button type="button" id="autoUpdBtn" onclick="autoUpdate()">Auto update</button>

wled00/presets.cpp

Lines changed: 67 additions & 1 deletion
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,6 +180,7 @@ void initPresetsFile()
115180
serializeJson(doc, f);
116181
f.close();
117182
}
183+
#endif
118184

119185
bool applyPresetFromPlaylist(byte index)
120186
{

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)