Skip to content

Commit

Permalink
Merge branch 'MoonModules:mdev' into W5500_Support
Browse files Browse the repository at this point in the history
  • Loading branch information
troyhacks authored Dec 19, 2024
2 parents c13f709 + d98ef84 commit 4eccf99
Show file tree
Hide file tree
Showing 24 changed files with 264 additions and 189 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ body:
attributes:
label: What version/release of MM WLED?
description: You can find this in by going to Config -> Security & Updates -> Scroll to Bottom. Copy and paste the entire line after "Server message"
placeholder: "e.g. build 2401290, WLEDMM_0.14.1-b32.40_esp32_4MB_M.bin"
placeholder: "e.g. build 2401290, WLEDMM_14.5.0-beta_esp32_4MB_M.bin"
validations:
required: true
- type: dropdown
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/wled-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:

get_default_envs:
name: Gather Environments
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Cache pip
Expand All @@ -31,7 +31,7 @@ jobs:

build:
name: Builds
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: get_default_envs
strategy:
fail-fast: false
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
path: build_output/release/*.bin
release:
name: Create Release
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: [get_default_envs, build]
if: startsWith(github.ref, 'refs/tags/')
steps:
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wled",
"version": "0.14.1-b32.41.dev",
"version": "14.5.0-beta",
"description": "Tools for WLED project",
"main": "tools/cdata.js",
"directories": {
Expand Down
315 changes: 170 additions & 145 deletions platformio.ini

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<img width="400" alt="image" src="https://user-images.githubusercontent.com/91013628/230378884-5a0f15ee-1aa2-4998-9df7-ade9f32a3d0f.png">

MoonModules/WLED is a fork from [Aircoookie/WLED](https://github.com/Aircoookie/WLED) which contains latest merge of v0.14 of WLED with [additional features](https://mm.kno.wled.ge/moonmodules/what-is-moonmodules/).
MoonModules/WLED is a fork of [Aircoookie/WLED](https://github.com/Aircoookie/WLED) which contains latest merge of v0.14 of WLED with [additional features](https://mm.kno.wled.ge/moonmodules/what-is-moonmodules/).

This fork is created by members of the [Atuline/WLED](https://github.com/atuline/WLED) team to make development against v0.14 possible while still preserving [Atuline/WLED v0.13.x](https://github.com/atuline/WLED/tree/dev) as a stable and supported version. The Atuline/WLED fork is also called WLED SR (Sound Reactive).

Expand Down
10 changes: 10 additions & 0 deletions tools/partitions-8MB_spiffs-tinyuf2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
# bootloader.bin,, 0x1000, 32K
# partition table,, 0x8000, 4K
nvs, data, nvs, 0x9000, 20K,
otadata, data, ota, 0xe000, 8K,
ota_0, app, ota_0, 0x10000, 2048K,
ota_1, app, ota_1, 0x210000, 2048K,
uf2, app, factory,0x410000, 256K,
spiffs, data, spiffs, 0x450000, 3776K,
23 changes: 19 additions & 4 deletions wled00/FX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,9 @@ static uint16_t mode_fireworks_core(bool useaudio) {
if (valid1) { if (SEGMENT.is2D()) SEGMENT.setPixelColorXY(SEGENV.aux0%width, SEGENV.aux0/width, sv1); else SEGMENT.setPixelColor(SEGENV.aux0, sv1); } // restore spark color after blur
if (valid2) { if (SEGMENT.is2D()) SEGMENT.setPixelColorXY(SEGENV.aux1%width, SEGENV.aux1/width, sv2); else SEGMENT.setPixelColor(SEGENV.aux1, sv2); } // restore old spark color after blur

#if defined(ARDUINO_ARCH_ESP32)
random16_add_entropy(esp_random() & 0xFFFF); // improve randomness (esp32)
#endif
if (addPixels) // WLEDMM
for (int i=0; i<max(1, width/20); i++) {
if (random8(myIntensity) == 0) { // WLEDMM
Expand Down Expand Up @@ -2615,6 +2618,13 @@ uint16_t ripple_base()
uint16_t maxRipples = min(1 + (SEGLEN >> 2), MAX_RIPPLES); // 56 max for 16 segment ESP8266
uint16_t dataSize = sizeof(ripple) * maxRipples;

const uint16_t cols = strip.isMatrix ? SEGMENT.virtualWidth() : 1;
const uint16_t rows = strip.isMatrix ? SEGMENT.virtualHeight() : SEGMENT.virtualLength();
const int16_t maxDim = max(2, (cols + rows) / 4); // WLEDMM
#if defined(ARDUINO_ARCH_ESP32)
random16_add_entropy(esp_random() & 0xFFFF); // improve randomness (esp32)
#endif

if (!SEGENV.allocateData(dataSize)) return mode_static(); //allocation failed
if (SEGENV.call == 0) {SEGENV.setUpLeds(); SEGMENT.fill(BLACK);} // WLEDMM use lossless getPixelColor()

Expand All @@ -2638,7 +2648,9 @@ uint16_t ripple_base()
uint16_t cx = rippleorigin >> 8;
uint16_t cy = rippleorigin & 0xFF;
uint8_t mag = scale8(sin8_t((propF>>2)), amp);
if (propI > 0) SEGMENT.drawCircle(cx, cy, propI, color_blend(SEGMENT.getPixelColorXY(cx + propI, cy), col, mag), true);
propI = min(propI, maxDim); // WLEDMM make sure that circles are visible
if ((propI > 0) && (unsigned(cx + propI) < cols) && (unsigned(cy) < rows)) // WLEDMM
SEGMENT.drawCircle(cx, cy, propI, color_blend(SEGMENT.getPixelColorXY(cx + propI, cy), col, mag), true);
} else
#endif
{
Expand Down Expand Up @@ -3687,6 +3699,9 @@ uint16_t mode_exploding_fireworks(void)

float gravity = -0.0004f - (SEGMENT.speed/800000.0f); // m/s/s
gravity *= rows;
#if defined(ARDUINO_ARCH_ESP32)
random16_add_entropy(esp_random() & 0xFFFF); // improves randonmess
#endif

if (SEGENV.aux0 < 2) { //FLARE
if (SEGENV.aux0 == 0) { //init flare
Expand All @@ -3708,7 +3723,7 @@ uint16_t mode_exploding_fireworks(void)
flare->pos += flare->vel;
flare->posX += flare->velX;
flare->pos = constrain(flare->pos, 0, rows-1);
flare->posX = constrain(flare->posX, 0, cols-strip.isMatrix);
flare->posX = constrain(flare->posX, 0, cols-int(strip.isMatrix));
flare->vel += gravity;
flare->col -= 2;
} else {
Expand Down Expand Up @@ -3738,10 +3753,10 @@ uint16_t mode_exploding_fireworks(void)
sparks[i].colIndex = random8();
sparks[i].vel *= flare->pos/rows; // proportional to height
sparks[i].velX *= strip.isMatrix ? flare->posX/cols : 0; // proportional to width
sparks[i].vel *= -gravity *50;
sparks[i].vel *= -gravity *50.0f;
}
//sparks[1].col = 345; // this will be our known spark
*dying_gravity = gravity/2;
*dying_gravity = gravity/2.0f;
SEGENV.aux0 = 3;
}

Expand Down
2 changes: 1 addition & 1 deletion wled00/FX.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ bool strip_uses_global_leds(void) __attribute__((pure)); // WLEDMM implemented
#define SEGCOLOR(x) strip.segColor(x) /* saves us a few kbytes of code */
#define SEGPALETTE Segment::getCurrentPalette()
#define SEGLEN strip._virtualSegmentLength /* saves us a few kbytes of code */
#define SPEED_FORMULA_L (5U + (50U*(255U - SEGMENT.speed))/SEGLEN)
#define SPEED_FORMULA_L (4U + (50U*(255U - SEGMENT.speed))/min(SEGLEN, uint16_t(512))) // WLEDMM limiting the formula to 512 virtual pixels

// some common colors
#define RED (uint32_t)0xFF0000
Expand Down
2 changes: 1 addition & 1 deletion wled00/FX_fcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ void Segment::resetIfRequired() {
next_time = 0; step = 0; call = 0; aux0 = 0; aux1 = 0;
reset = false; // setOption(SEG_OPTION_RESET, false);
startFrame(); // WLEDMM update cached propoerties
if (isActive() && !freeze) fill(BLACK); // WLEDMM start clean
if (isActive() && !freeze) { fill(BLACK); needsBlank = false; } // WLEDMM start clean
DEBUG_PRINTLN("Segment reset");
} else if (needsBlank) {
startFrame(); // WLEDMM update cached propoerties
Expand Down
8 changes: 8 additions & 0 deletions wled00/bus_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,11 @@ int BusManager::add(BusConfig &bc) {
void BusManager::removeAll() {
DEBUG_PRINTLN(F("Removing all."));
//prevents crashes due to deleting busses while in use.
#if !defined(ARDUINO_ARCH_ESP32)
while (!canAllShow()) yield();
#else
while (!canAllShow()) delay(2); // WLEDMM on esp32, yield() doesn't work as you think it would
#endif
for (uint8_t i = 0; i < numBusses; i++) delete busses[i];
numBusses = 0;
// WLEDMM clear cached Bus info
Expand All @@ -1277,6 +1281,10 @@ void BusManager::removeAll() {

void __attribute__((hot)) BusManager::show() {
for (unsigned i = 0; i < numBusses; i++) {
#if 1 && defined(ARDUINO_ARCH_ESP32)
unsigned long t0 = millis();
while ((busses[i]->canShow() == false) && (millis() - t0 < 80)) delay(1); // WLEDMM experimental: wait until bus driver is ready (max 80ms) - costs us 1-2 fps but reduces flickering
#endif
busses[i]->show();
}
}
Expand Down
6 changes: 6 additions & 0 deletions wled00/data/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,12 @@ button {
color: #f00;
}

#heartMM {
transition: color 0.9s;
font-size: 16px;
color: #0f0;
}

img {
max-width: 100%;
max-height: 100%;
Expand Down
2 changes: 1 addition & 1 deletion wled00/data/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@
</div>
<br>
<span class="h">WLED made with <span id="heart">&#10084;&#xFE0E;</span> by Aircoookie and the <a href="https://wled.discourse.group/" target="_blank">WLED community</a></span><br>
<span class="h">WLED MM made with <span id="heart">&#10084;&#xFE0E;</span> by Softhack007 & Ewowi and the <a href="https://discord.gg/8P7wGuqT/" target="_blank">WLED 2D & Audio Dev</a> community</span>
<span class="h">WLED MM made with <span id="heartMM">&#10084;&#xFE0E;</span> by Softhack007 &amp; Ewowi and the <a href="https://discord.gg/8P7wGuqT/" target="_blank">WLED 2D &amp; Audio Dev</a> community</span>
</div>

<div id="nodes" class="modal">
Expand Down
17 changes: 10 additions & 7 deletions wled00/data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -684,18 +684,20 @@ function populateInfo(i)
urows += inforow(k,val);
}
}
var vcn = "Kuuhaku";
if (i.ver.startsWith("0.14.")) vcn = "Hoshi";
var vcn = "Small Step"; // WLED-MM 14.5.0, release Dec 2024
// if (i.ver.startsWith("0.14.")) vcn = "Hoshi";
// if (i.ver.includes("-bl")) vcn = "Supāku";
if (i.cn) vcn = i.cn;

//WLEDMM: add total heap and total PSRAM, and build number, add bin name
if (i.ver.includes("0.14.0")) vcn = "Lupo"; // check for MM versioning scheme
if (i.ver.includes("0.14.0-b15")) vcn = "Sitting Ducks"; // late easter egg
if (i.ver.includes("0.14.0-b2")) vcn = "This is the way"; // recently watched The Mandalorian? I have spoken ;-)
if (i.ver.includes("0.14.0-b15.22")) vcn = "Lupo";
if (i.ver.includes("0.14.1-b3")) vcn = "Fried Chicken"; // final line of "One Vision" by Queen
//if (i.ver.includes("0.14.0")) vcn = "Lupo"; // check for MM versioning scheme
//if (i.ver.includes("0.14.0-b15")) vcn = "Sitting Ducks"; // late easter egg
//if (i.ver.includes("0.14.0-b2")) vcn = "This is the way"; // recently watched The Mandalorian? I have spoken ;-)
//if (i.ver.includes("0.14.0-b15.22")) vcn = "Lupo";
//if (i.ver.includes("0.14.1-b")) vcn = "Fried Chicken"; // final line of "One Vision" by Queen
if (i.ver.includes("0.14.3-b")) vcn = "Fried Chicken";
if (i.ver.includes("14.5.")) vcn = "Small Step";

cn += `v${i.ver} &nbsp;<i>"${vcn}"</i><p>(WLEDMM ${i.rel}.bin)</p><p><em>build ${i.vid}</em></p><table>
${urows}
${urows===""?'':'<tr><td colspan=2><hr style="height:1px;border-width:0;color:SeaGreen;background-color:Seagreen"></td></tr>'}
Expand Down Expand Up @@ -3213,6 +3215,7 @@ setInterval(()=>{
if (hc==144) hc+=36;
if (hc==108) hc+=18;
gId('heart').style.color = `hsl(${hc}, 100%, 50%)`;
gId('heartMM').style.color = `hsl(${hc}, 100%, 50%)`;
}, 910);

function openGH() { window.open("https://github.com/Aircoookie/WLED/wiki"); }
Expand Down
6 changes: 3 additions & 3 deletions wled00/data/settings.htm
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@
</head>
<body onload="S()">
<button type=submit id="b" onclick="window.location='/'">Back</button>
<button type="submit" onclick="window.location='./settings/wifi'">WiFi Setup</button>
<button type="submit" onclick="window.location='./settings/wifi'">Wi-Fi Setup</button>
<button type="submit" onclick="window.location='./settings/leds'">LED Preferences</button>
<button id="2dbtn" style="display:none;" type="submit" onclick="window.location='./settings/2D'">2D Configuration</button>
<div id="configMenu">Loading...</div>
<button type="submit" onclick="window.location='./settings/um'">Usermods (pins)</button> <!--WLEDMM: Move below UMs-->
<button type="submit" onclick="window.location='./settings/ui'">User Interface</button>
<button id="dmxbtn" style="display:none;" type="submit" onclick="window.location='./settings/dmx'">DMX Output</button>
<button type="submit" onclick="window.location='./settings/sync'">Sync Interfaces</button>
<button type="submit" onclick="window.location='./settings/time'">Time & Macros</button>
<button type="submit" onclick="window.location='./settings/sec'">Security & Updates</button>
<button type="submit" onclick="window.location='./settings/time'">Time &amp; Macros</button>
<button type="submit" onclick="window.location='./settings/sec'">Security &amp; Updates</button>
<button type="submit" onclick="window.location='./edit'">File System ☾</button> <!--WLEDMM-->
</body>
</html>
2 changes: 1 addition & 1 deletion wled00/data/settings_leds.htm
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ <h3>Defaults</h3>
Use Gamma value: <input name="GV" type="number" class="m" placeholder="2.8" min="1" max="3" step="0.1" required><br><br>
Brightness factor: <input name="BF" type="number" class="m" min="1" max="255" required> %
<h3>Transitions</h3>
Crossfade: <input type="checkbox" name="TF"><br>
Cross-fade: <input type="checkbox" name="TF"><br>
Transition Time: <input name="TD" type="number" class="xl" min="0" max="65500"> ms<br>
Enable Palette transitions: <input type="checkbox" name="PF"><br>
<i>Random Cycle</i> Palette Time: <input name="TP" type="number" class="m" min="1" max="255"> s<br>
Expand Down
2 changes: 1 addition & 1 deletion wled00/data/settings_sec.htm
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ <h2>Security & Update setup</h2>
The password should be changed when OTA is enabled.<br>
<b>Disable OTA when not in use, otherwise an attacker can reflash device software!</b><br>
<i>Settings on this page are only changable if OTA lock is disabled!</i><br>
Deny access to WiFi settings if locked: <input type="checkbox" name="OW"><br><br>
Deny access to Wi-Fi settings if locked: <input type="checkbox" name="OW"><br><br>
Factory reset: <input type="checkbox" name="RS"><br>
All settings and presets will be erased.<br><br>
<div style="color: #fa0;">&#9888; Unencrypted transmission. An attacker on the same network can intercept form data!</div>
Expand Down
14 changes: 7 additions & 7 deletions wled00/data/settings_wifi.htm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
<title>WiFi Settings</title>
<title>Wi-Fi Settings</title>
<script>
var d = document;
var loc = false, locip;
Expand Down Expand Up @@ -139,9 +139,9 @@
<form id="form_s" name="Sf" method="post">
<div class="toprow">
<div class="helpB"><button type="button" onclick="H()">?</button></div>
<button type="button" onclick="B()">Back</button><button type="submit">Save & Connect</button><hr>
<button type="button" onclick="B()">Back</button><button type="submit">Save &amp; Connect</button><hr>
</div>
<h2>WiFi setup</h2>
<h2>Wi-Fi setup</h2>
<h3>Connect to existing network</h3>
<button type="button" id="scan" onclick="N()">Scan</button><br>
Network name (SSID, empty to not connect):<br>
Expand Down Expand Up @@ -169,7 +169,7 @@ <h3>Configure Access Point</h3>
AP SSID (leave empty for no AP):<br> <input type="text" name="AS" maxlength="32"><br>
Hide AP name: <input type="checkbox" name="AH"><br>
AP password (leave empty for open):<br> <input type="password" name="AP" maxlength="63" pattern="(.{8,63})|()" title="Empty or min. 8 characters"><br>
Access Point WiFi channel: <input name="AC" type="number" class="xs" min="1" max="13" required><br>
Access Point Wi-Fi channel: <input name="AC" type="number" class="xs" min="1" max="13" required><br>
AP opens:
<select name="AB">
<option value="0">No connection after boot</option>
Expand All @@ -179,9 +179,9 @@ <h3>Configure Access Point</h3>
AP IP: <span class="sip"> Not active </span><br>
<h3>Experimental</h3>
Force 802.11g mode (ESP8266 only): <input type="checkbox" name="FG"><br>
Disable WiFi sleep: <input type="checkbox" name="WS"><br>
Disable Wi-Fi sleep: <input type="checkbox" name="WS"><br>
<i>Can help with connectivity issues.<br>
Do not enable if WiFi is working correctly, increases power consumption.</i>
Do not enable if Wi-Fi is working correctly, increases power consumption.</i>

<div id="remd">
<h3>Wireless Remote</h3>
Expand Down Expand Up @@ -212,7 +212,7 @@ <h3>Ethernet Type</h3>
</select><br><br>
</div>
<hr>
<button type="button" onclick="B()">Back</button><button type="submit">Save & Connect</button>
<button type="button" onclick="B()">Back</button><button type="submit">Save &amp; Connect</button>
</form>
</body>
</html>
6 changes: 6 additions & 0 deletions wled00/data/simple.css
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,12 @@ button:hover {
color: #f00;
}

#heartMM {
transition: color 0.9s;
font-size: 16px;
color: #0f0;
}

img {
max-width: 100%;
max-height: 100%;
Expand Down
1 change: 1 addition & 0 deletions wled00/data/simple.htm
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@
<button class="btn" id="resetbtn" onclick="cnfReset()">Reboot WLED</button>
</div>
<span class="h">Made with <span id="heart">&#10084;&#xFE0E;</span> by Aircoookie and the <a href="https://wled.discourse.group/" target="_blank">WLED community</a></span>
<span class="h">WLED MM made with <span id="heartMM">&#10084;&#xFE0E;</span> by Softhack007 &amp; Ewowi and the <a href="https://discord.gg/8P7wGuqT/" target="_blank">WLED 2D &amp; Audio Dev</a> community</span>
</div>

<div id="nodes" class="modal">
Expand Down
7 changes: 4 additions & 3 deletions wled00/data/simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,10 +509,11 @@ function populateInfo(i)
if (i.ver.startsWith("0.14.")) vcn = "Hoshi";
if (i.ver.includes("-bl")) vcn = "Supāku";
if (i.cn) vcn = i.cn;
if (i.ver.includes("14.5.")) vcn = "Small Step";

//WLEDMM: add total heap and total PSRAM, and build number
if (i.ver.includes("14.1-")) vcn = "Sitting Ducks"; // easter egg
if (i.ver.includes("14.0-mdev")) vcn = "Lupo";
//if (i.ver.includes("14.1-")) vcn = "Sitting Ducks"; // easter egg
//if (i.ver.includes("14.0-mdev")) vcn = "Lupo";
cn += `v${i.ver} &nbsp;<i>"${vcn}"</i><p><em>build ${i.vid}</em></p><table>
${urows}
${inforow("Build",i.vid)}
Expand Down Expand Up @@ -1281,7 +1282,7 @@ function setBalance(b)

var hc = 0;
setInterval(()=>{if (!isInfo) return; hc+=18; if (hc>300) hc=0; if (hc>200)hc=306; if (hc==144) hc+=36; if (hc==108) hc+=18;
gId('heart').style.color = `hsl(${hc}, 100%, 50%)`;}, 910);
gId('heart').style.color = `hsl(${hc}, 100%, 50%)`; gId('heartMM').style.color = `hsl(${hc}, 100%, 50%)`;}, 910);

function openGH() { window.open("https://github.com/Aircoookie/WLED/wiki"); }

Expand Down
4 changes: 2 additions & 2 deletions wled00/data/welcome.htm
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
<h1>Welcome to WLED-MM !</h1><!--WLEDMM-->
<h3>Thank you for installing our application!</h3>
<b>Next steps:</b><br><br>
Connect WLED-MM to your local WiFi here!<br>
<button onclick="window.location.href='/settings/wifi'">WiFi settings</button><br>
Connect WLED-MM to your local Wi-Fi here!<br>
<button onclick="window.location.href='/settings/wifi'">Wi-Fi settings</button><br>
<i>Just trying this out in AP mode?</i><br>
<button onclick="window.location.href='/sliders'">To the controls!</button><br>
</div>
Expand Down
Loading

0 comments on commit 4eccf99

Please sign in to comment.