Skip to content

Commit

Permalink
Add Ethernet type: Olimex ESP32 Gateway
Browse files Browse the repository at this point in the history
index.js:
- add leds instead of matrix to extendedNodes array
- split V and P ledcount
  • Loading branch information
ewowi committed Oct 7, 2023
1 parent 15cea2b commit fea47b5
Show file tree
Hide file tree
Showing 11 changed files with 4,025 additions and 3,958 deletions.
3 changes: 2 additions & 1 deletion wled00/const.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@
#define BTN_TYPE_ANALOG_INVERTED 8

//Ethernet board types
#define WLED_NUM_ETH_TYPES 11
#define WLED_NUM_ETH_TYPES 12 //WLEDMM +1 for Olimex ESP32-Gateway

#define WLED_ETH_NONE 0
#define WLED_ETH_WT32_ETH01 1
Expand All @@ -286,6 +286,7 @@
#define WLED_ETH_QUINLED_OCTA 8
#define WLED_ETH_ABCWLEDV43ETH 9
#define WLED_ETH_SERG74 10
#define WLED_ETH_OLIMEX_GTW 11

//Hue error codes
#define HUE_ERROR_INACTIVE 0
Expand Down
61 changes: 30 additions & 31 deletions wled00/data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1081,8 +1081,9 @@ function SuperSync(nnodes) {
let node = extendedNodes[i];
if (node.info.ip != lastinfo.ip) { //do not add to self
if (gId(`eql${i}`).innerText != "yes") {
console.log(node.info.ip, gId(`ip${i}`).innerText, gId(`pnlX${i}`).innerText, extendedNodes[i].matrix);
callNode(node.info.ip, "cfg", {"hw":{"led":{"matrix":extendedNodes[i].matrix}}}); //self
console.log(node.info.ip, gId(`ip${i}`).innerText, gId(`pnlX${i}`).innerText, extendedNodes[i].led.matrix);
let len = extendedNodes[i].led.matrix.panels[0].h * extendedNodes[i].led.matrix.panels[0].w;
callNode(node.info.ip, "cfg", {"hw":{"led":{"matrix":extendedNodes[i].led.matrix}, "ins":[{"start": 0,"len": len}]}}); //self
callNode(node.info.ip, "state", {"rb":true}); //reboot
}
}
Expand Down Expand Up @@ -1139,14 +1140,16 @@ function populateNodes(i,n)
gId(`eql${nodeNr}`).innerText = "nrOfP > 2";
else if (gId(`mrx${nodeNr}`).innerText != lastinfo.leds.matrix.w + "x" + lastinfo.leds.matrix.h)
gId(`eql${nodeNr}`).innerText = "mrx not " + lastinfo.leds.matrix.w + "x" + lastinfo.leds.matrix.h;
// else if (gId(`lpc${nodeNr}`).innerText != extendedNodes[nodeNr].info.leds.cloudsP)
// gId(`eql${nodeNr}`).innerText = "Leds P# not ...";
else
gId(`eql${nodeNr}`).innerText = "yes";
}

function fetchInfoAndCfg(ip, nodeNr, parms, callback) {
//add td placeholders
urows += `<tr>`;
for (let nm of ["ins", "pwr", "type", "vid", "ip", "rel", "ver", "lc", "fx", "mrx", "pnl0", "pnlC", "pnlX", "eql"])
for (let nm of ["ins", "pwr", "type", "vid", "ip", "rel", "ver", "lpc", "lvc", "fx", "mrx", "pnl0", "pnlC", "pnlX", "eql"])
urows += `<td id="${nm}${nodeNr}"></td>`;
urows += `</tr>`;

Expand All @@ -1169,7 +1172,8 @@ function populateNodes(i,n)
gId(`ip${nodeNr}`).innerText = info.ip;
gId(`rel${nodeNr}`).innerText = info.rel;
gId(`ver${nodeNr}`).innerText = info.ver;
gId(`lc${nodeNr}`).innerText = info.leds.count + " (" + info.leds.countP + ")";
gId(`lvc${nodeNr}`).innerText = info.leds.count;
gId(`lpc${nodeNr}`).innerText = info.leds.countP;
gId(`fx${nodeNr}`).innerText = effects[state.seg[0].fx];
if (info.leds.matrix)
gId(`mrx${nodeNr}`).innerText = info.leds.matrix.w + "x" + info.leds.matrix.h;
Expand All @@ -1188,42 +1192,37 @@ function populateNodes(i,n)
let url = `<button class="btn" ${color} title="${ip}" onclick="location.assign('http://${ip}');">${cfg.id.name}</button>`;
gId(`ins${nodeNr}`).innerHTML = url;

let matrix = cfg.hw.led.matrix;
let led = cfg.hw.led;
// let matrix = cfg.hw.led.matrix;
// var str = JSON.stringify(matrix, null, 2); // jsonpretty
if (matrix) {
if (led.matrix) {
// console.log(matrix);
gId(`pnl0${nodeNr}`).innerText = showPanel(matrix.panels[0]); //show the first panel
gId(`pnlC${nodeNr}`).innerText = matrix.panels.length; //show nr of panels
gId(`pnl0${nodeNr}`).innerText = showPanel(led.matrix.panels[0]); //show the first panel
gId(`pnlC${nodeNr}`).innerText = led.matrix.panels.length; //show nr of panels

if (ip == lastinfo.ip) { //self
for (let i=0; i<nnodes; i++) {
if (matrix.panels[i]) {
gId(`pnlX${i}`).innerText = showPanel(matrix.panels[i]); //assign the desired panel
extendedNodes[i].matrix = structuredClone(matrix); //structuredClone: by value, not by reference
extendedNodes[i].matrix.ba = true; //advanced
if (led.matrix.panels[i]) {
gId(`pnlX${i}`).innerText = showPanel(led.matrix.panels[i]); //assign the desired panel
extendedNodes[i].led = structuredClone(led); //structuredClone: by value, not by reference
extendedNodes[i].led.matrix.ba = true; //advanced
//if the panel is b
let widthOK = extendedNodes[nodeNr].info.leds.matrix.w == matrix.panels[i].x + matrix.panels[i].w;
let heightOK = extendedNodes[nodeNr].info.leds.matrix.h == matrix.panels[i].y + matrix.panels[i].h;
let widthOK = extendedNodes[nodeNr].info.leds.matrix.w == led.matrix.panels[i].x + led.matrix.panels[i].w;
let heightOK = extendedNodes[nodeNr].info.leds.matrix.h == led.matrix.panels[i].y + led.matrix.panels[i].h;
if (widthOK && heightOK) {
extendedNodes[i].matrix.mpc = 1;
extendedNodes[i].matrix.mph = 1;
extendedNodes[i].matrix.mpv = 1;
extendedNodes[i].matrix.panels = [matrix.panels[i]];
extendedNodes[i].led.matrix.mpc = 1;
extendedNodes[i].led.matrix.mph = 1;
extendedNodes[i].led.matrix.mpv = 1;
extendedNodes[i].led.matrix.panels = [led.matrix.panels[i]];
} else {
let dummyPanel = {
"b": false,
"r": false,
"v": false,
"s": false,
let dummyPanel = {"b": false,"r": false,"v": false,"s": false,
"x": extendedNodes[nodeNr].info.leds.matrix.w - 1,
"y": extendedNodes[nodeNr].info.leds.matrix.h - 1,
"h": 1,
"w": 1
};
extendedNodes[i].matrix.mpc = 2;
extendedNodes[i].matrix.mph = 1;
extendedNodes[i].matrix.mpv = 2;
extendedNodes[i].matrix.panels = [matrix.panels[i], dummyPanel];
"h": 1, "w": 1};
extendedNodes[i].led.matrix.mpc = 2;
extendedNodes[i].led.matrix.mph = 1;
extendedNodes[i].led.matrix.mpv = 2;
extendedNodes[i].led.matrix.panels = [led.matrix.panels[i], dummyPanel];
}
}
else
Expand Down Expand Up @@ -1252,7 +1251,7 @@ function populateNodes(i,n)

//set table header
urows += `<tr>`;
for (let nm of ["Instance", "Power", "Type", "Build", "IP", "Release", "Version", "Leds", "Effect", "Matrix", "Panel0", "NrOfP", "PanelX", "Equal"])
for (let nm of ["Instance", "Power", "Type", "Build", "IP", "Release", "Version", "#P Leds", "#V Leds", "Effect", "Matrix", "Panel0", "NrOfP", "PanelX", "Equal"])
urows += `<th>${nm}</th>`;
urows += `</tr>`;

Expand Down
1 change: 1 addition & 0 deletions wled00/data/settings_wifi.htm
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ <h3>Ethernet Type</h3>
<option value="2">ESP32-POE</option>
<option value="6">ESP32Deux</option>
<option value="7">KIT-VE</option>
<option value="11">Olimex-ESP32-Gateway</option> <!-- WLEDMM -->
<option value="8">QuinLED-Dig-Octa & T-ETH-POE</option>
<option value="4">QuinLED-ESP32</option>
<option value="10">Serg74-ETH32</option>
Expand Down
2 changes: 1 addition & 1 deletion wled00/html_cpal.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// Autogenerated from wled00/data/cpal/cpal.htm, do not edit!!
const uint16_t PAGE_cpal_L = 4721;
const uint8_t PAGE_cpal[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0xbd, 0x3b, 0x7f, 0x73, 0xdb, 0xb6,
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xbd, 0x3b, 0x7f, 0x73, 0xdb, 0xb6,
0x92, 0xff, 0xe7, 0x53, 0x20, 0x4c, 0x5f, 0x42, 0xd6, 0x14, 0x45, 0xd2, 0xb6, 0x64, 0x4b, 0xa2,
0x3b, 0xa9, 0x93, 0x77, 0xce, 0x8d, 0xdd, 0x64, 0x5e, 0x7c, 0x6e, 0x7b, 0x3e, 0xbf, 0x31, 0x4d,
0x42, 0x12, 0x1b, 0x8a, 0xe0, 0x03, 0x21, 0xd9, 0xae, 0xac, 0xef, 0x7e, 0xbb, 0x00, 0x48, 0x91,
Expand Down
Loading

0 comments on commit fea47b5

Please sign in to comment.