From 526570b1d70221197ddfeb92379cff2518d67140 Mon Sep 17 00:00:00 2001 From: Ewoud Date: Thu, 31 Oct 2024 11:24:49 +0100 Subject: [PATCH] tickerTape value bugfix + miscellaneous miscellaneous - set ip examples to 192.168.1 - set bool to bool3State (WIP) SysModUI: - remove check for varFun to callVarOnChange (bugfix checkbox vars eg tickerTape) SysModWeb - update curl examples --- misc/misc.txt | 8 +-- misc/testOutput.txt | 8 +-- src/App/LedEffects.h | 148 +++++++++++++++++++------------------- src/App/LedModFixture.h | 6 +- src/App/LedProjections.h | 70 +++++++++--------- src/Sys/SysModUI.h | 8 +-- src/Sys/SysModWeb.cpp | 10 +-- src/Sys/SysModWeb.h | 14 ++-- src/User/UserModMPU6050.h | 2 +- 9 files changed, 137 insertions(+), 137 deletions(-) diff --git a/misc/misc.txt b/misc/misc.txt index 9a3da17..7fed597 100644 --- a/misc/misc.txt +++ b/misc/misc.txt @@ -83,16 +83,16 @@ Update instances for i in 107 239 143 111 154 177 208 129 157 do echo upgrade 192.168.168.$i - curl -s -F "update=@/Users/ewoudwijma/Downloads/StarLight_24060113_lolin_s2_mini.bin" 192.168.8.$i/update & + curl -s -F "update=@/Users/ewoudwijma/Downloads/StarLight_24060113_lolin_s2_mini.bin" 192.168.1.$i/update & done - curl -X POST "http://192.168.8.$i/json" -d '{"reboot":true}' -H "Content-Type: application/json" + curl -X POST "http://192.168.1.$i/json" -d '{"reboot":true}' -H "Content-Type: application/json" for i in 152 132 do echo upgrade 192.168.168.$i - curl -s -F "update=@/Users/ewoudwijma/Downloads/StarLight_24060113_esp32dev.bin" 192.168.8.$i/update & + curl -s -F "update=@/Users/ewoudwijma/Downloads/StarLight_24060113_esp32dev.bin" 192.168.1.$i/update & done - curl -X POST "http://192.168.8.$i/json" -d '{"reboot":true}' -H "Content-Type: application/json" + curl -X POST "http://192.168.1.$i/json" -d '{"reboot":true}' -H "Content-Type: application/json" FileCreateDate for png files diff --git a/misc/testOutput.txt b/misc/testOutput.txt index fa3fff3..7c991e2 100644 --- a/misc/testOutput.txt +++ b/misc/testOutput.txt @@ -126,7 +126,7 @@ sendDataWs client full or not connected client: 2 ...126 q:0 l:16 s:1 (#:1) αWS_EVT_DATA json {"pin":{"label":"Pin"},"owner":{"label":"Owner"},"details":{"label":"Details"},"pins":{"label":"Pins","comment":"List of pins","value":[[16,"Leds","0-1023"]]},"board":{"label":"Board layout","comment":"WIP"}} αWS_EVT_DATA info 284 / 3072 (9%) (5 0 4) αWS event data client: 2 ...126 q:0 l:16 s:1 (#:1) -αWS_EVT_DATA json {"output":{"label":"Output","comment":"System log to Serial or Net print (WIP)","options":["No","Serial","UI","192.168.8.126"]},"log":{"comment":"Show the printed log"}} +αWS_EVT_DATA json {"output":{"label":"Output","comment":"System log to Serial or Net print (WIP)","options":["No","Serial","UI","192.168.1.126"]},"log":{"comment":"Show the printed log"}} αWS_EVT_DATA info 174 / 3072 (5%) (2 0 3) sendDataWs client full or not connected client: 2 ...126 q:0 l:16 s:1 (#:1) αWS event data client: 2 ...126 q:0 l:16 s:1 (#:1) @@ -140,10 +140,10 @@ instances updateNode 132 αWS_EVT_DATA json {"password":{"label":"Password"},"connect":{"comment":"Force reconnect (loose current connection)"},"nwstatus":{"label":"Status"},"rssi":{"label":"Wifi signal"}} αWS_EVT_DATA info 128 / 3072 (4%) (4 0 2) αWS event data client: 2 ...126 q:0 l:20 s:1 (#:1) -αWS_EVT_DATA json {"instance":{"label":"Instance","comment":"Instance to send data","options":[[0,"no sync"],[132,"192.168.8.132 StarBaseRS"]]}} +αWS_EVT_DATA json {"instance":{"label":"Instance","comment":"Instance to send data","options":[[0,"no sync"],[132,"192.168.1.132 StarBaseRS"]]}} αWS_EVT_DATA info 184 / 3072 (5%) (1 0 4) αWS event data client: 2 ...126 q:0 l:20 s:1 (#:1) -αWS_EVT_DATA json {"artInst":{"label":"Instance","comment":"Instance to send data","options":[[0,"no sync"],[132,"192.168.8.132 StarBaseRS"]]}} +αWS_EVT_DATA json {"artInst":{"label":"Instance","comment":"Instance to send data","options":[[0,"no sync"],[132,"192.168.1.132 StarBaseRS"]]}} αWS_EVT_DATA info 184 / 3072 (5%) (1 0 4) αWS event data client: 2 ...126 q:0 l:20 s:1 (#:1) αWS_EVT_DATA json {"universe":{"label":"DMX Universe"},"channel":{"label":"DMX Channel","comment":"First channel"},"channel":{"label":"Channel"},"variable":{"label":"Variable"},"max":{"label":"Max"},"value":{"label":"Value"},"watches":{"label":"Vars to watch","comment":"List of instances","value":[[1,"brightness",255,0],[2,"fx",20,0],[3,"palette",8,0]]}} @@ -165,7 +165,7 @@ etValue var ip[0] value null not array, creating αWS_EVT_DATA info 464 / 3072 (15%) (9 0 3) setValue var full[0] value null not array, creating αWS event data client: 2 ...126 q:0 l:27 s:1 (#:1) -αWS_EVT_DATA json {"insfx":{"label":"Effect","comment":"Effect to show","options":["Solid 1D","Rainbow 1D","Rainbow with glitter 1D","Sinelon 1D","Running 1D","Confetti 1D","Beats per minute 1D","Juggle 1D","Ripples 3D","SphereMove 3D","Frizzles 2D","Lines 2D","DistortionWaves 2D","Octopus 2D","Lissajous 2D","Bouncing Balls 1D","RingRandomFlow 1D","GEQ 2D","AudioRings 1D","FreqMatrix 1D"]},"inspal":{"label":"Palette","comment":"Colors","options":["CloudColors","LavaColors","OceanColors","ForestColors","RainbowColors","RainbowStripeColors","PartyColors","HeatColors"]},"insdch":{"label":"DMX Channel","comment":"First channel"},"inssma":{"label":"Sync Master","comment":"Instance to sync from","options":[[0,"no sync"],[132,"192.168.8.132 StarBaseRS"]]},"instances":{"label":"Instances","comment":"List of instances","value":[["StarBaseRS","http://192.168.8.132","192.168.8.132","StarBase",24012818,8151,1,141,0,19,-1,1,0]]},"sma":{"label":"Sync Master","comment":"Instance to sync from","options":[[0,"no sync"],[132,"192.168.8.132 StarBaseRS"]]}} +αWS_EVT_DATA json {"insfx":{"label":"Effect","comment":"Effect to show","options":["Solid 1D","Rainbow 1D","Rainbow with glitter 1D","Sinelon 1D","Running 1D","Confetti 1D","Beats per minute 1D","Juggle 1D","Ripples 3D","SphereMove 3D","Frizzles 2D","Lines 2D","DistortionWaves 2D","Octopus 2D","Lissajous 2D","Bouncing Balls 1D","RingRandomFlow 1D","GEQ 2D","AudioRings 1D","FreqMatrix 1D"]},"inspal":{"label":"Palette","comment":"Colors","options":["CloudColors","LavaColors","OceanColors","ForestColors","RainbowColors","RainbowStripeColors","PartyColors","HeatColors"]},"insdch":{"label":"DMX Channel","comment":"First channel"},"inssma":{"label":"Sync Master","comment":"Instance to sync from","options":[[0,"no sync"],[132,"192.168.1.132 StarBaseRS"]]},"instances":{"label":"Instances","comment":"List of instances","value":[["StarBaseRS","http://192.168.1.132","192.168.1.132","StarBase",24012818,8151,1,141,0,19,-1,1,0]]},"sma":{"label":"Sync Master","comment":"Instance to sync from","options":[[0,"no sync"],[132,"192.168.1.132 StarBaseRS"]]}} αWS_EVT_DATA info 1301 / 3072 (42%) (6 0 4) setValue var status[0] value null not array, creating αWS event data client: 2 ...126 q:0 l:28 s:1 (#:1) diff --git a/src/App/LedEffects.h b/src/App/LedEffects.h index b9c40a4..7ecdab0 100644 --- a/src/App/LedEffects.h +++ b/src/App/LedEffects.h @@ -85,11 +85,11 @@ class RainbowWithGlitterEffect: public Effect { void setup(LedsLayer &leds, JsonObject parentVar) { //no palette control is created - ui->initCheckBox(parentVar, "glitter", leds.effectData.write(false)); + ui->initCheckBox(parentVar, "glitter", leds.effectData.write(false)); } void loop(LedsLayer &leds) { - uint8_t glitter = leds.effectData.read(); + bool3State glitter = leds.effectData.read(); // built-in FastLED rainbow, plus some random sparkly glitter // FastLED's built-in rainbow generator @@ -497,7 +497,7 @@ class DripEffect: public Effect { ui->initSlider(parentVar, "gravity", leds.effectData.write(128), 1, 255); ui->initSlider(parentVar, "drips", leds.effectData.write(4), 1, 6); ui->initSlider(parentVar, "swell", leds.effectData.write(4), 1, 6); - ui->initCheckBox(parentVar, "invert", leds.effectData.write(false)); + ui->initCheckBox(parentVar, "invert", leds.effectData.write(false)); } void loop(LedsLayer &leds) { @@ -505,7 +505,7 @@ class DripEffect: public Effect { uint8_t grav = leds.effectData.read(); uint8_t drips = leds.effectData.read(); uint8_t swell = leds.effectData.read(); - bool invert = leds.effectData.read(); + bool3State invert = leds.effectData.read(); //binding of loop persistent values (pointers) Spark* drops = leds.effectData.readWrite(maxNumDrops); @@ -590,7 +590,7 @@ class HeartBeatEffect: public Effect { uint8_t intensity = leds.effectData.read(); //binding of loop persistent values (pointers) tbd: aux0,1,step etc can be renamed to meaningful names - bool *isSecond = leds.effectData.readWrite(); + bool3State *isSecond = leds.effectData.readWrite(); uint16_t *bri_lower = leds.effectData.readWrite(); unsigned long *step = leds.effectData.readWrite(); @@ -691,7 +691,7 @@ class PopCornEffect: public Effect { ui->initSlider(parentVar, "speed", leds.effectData.write(128)); ui->initSlider(parentVar, "corns", leds.effectData.write(maxNumPopcorn/2), 1, maxNumPopcorn); #ifdef STARLIGHT_USERMOD_AUDIOSYNC - ui->initCheckBox(parentVar, "useaudio", leds.effectData.write(false)); + ui->initCheckBox(parentVar, "useaudio", leds.effectData.write(false)); #endif } @@ -700,7 +700,7 @@ class PopCornEffect: public Effect { uint8_t speed = leds.effectData.read(); uint8_t numPopcorn = leds.effectData.read(); #ifdef STARLIGHT_USERMOD_AUDIOSYNC - uint8_t useaudio = leds.effectData.read(); + bool3State useaudio = leds.effectData.read(); #endif //binding of loop persistent values (pointers) @@ -803,13 +803,13 @@ class AudioRingsEffect: public RingEffect { void setup(LedsLayer &leds, JsonObject parentVar) { Effect::setup(leds, parentVar); - ui->initCheckBox(parentVar, "inWards", leds.effectData.write(true)); + ui->initCheckBox(parentVar, "inWards", leds.effectData.write(true)); ui->initSlider(parentVar, "rings", leds.effectData.write(7), 1, 50); } void loop(LedsLayer &leds) { //Binding of controls. Keep before binding of vars and keep in same order as in setup() - bool inWards = leds.effectData.read(); + bool3State inWards = leds.effectData.read(); uint8_t nrOfRings = leds.effectData.read(); for (int i = 0; i < nrOfRings; i++) { @@ -853,14 +853,14 @@ class DJLightEffect: public Effect { void setup(LedsLayer &leds, JsonObject parentVar) { leds.fill_solid(CRGB::Black); ui->initSlider(parentVar, "speed", leds.effectData.write(255)); - ui->initCheckBox(parentVar, "candyFactory", leds.effectData.write(true)); + ui->initCheckBox(parentVar, "candyFactory", leds.effectData.write(true)); ui->initSlider(parentVar, "fade", leds.effectData.write(4), 0, 10); } void loop(LedsLayer &leds) { //Binding of controls. Keep before binding of vars and keep in same order as in setup() uint8_t speed = leds.effectData.read(); - bool candyFactory = leds.effectData.read(); + bool3State candyFactory = leds.effectData.read(); uint8_t fade = leds.effectData.read(); //binding of loop persistent values (pointers) tbd: aux0,1,step etc can be renamed to meaningful names @@ -933,13 +933,13 @@ class LinesEffect: public Effect { void setup(LedsLayer &leds, JsonObject parentVar) { ui->initSlider(parentVar, "BPM", leds.effectData.write(60)); - ui->initCheckBox(parentVar, "vertical", leds.effectData.write(true)); + ui->initCheckBox(parentVar, "vertical", leds.effectData.write(true)); } void loop(LedsLayer &leds) { //Binding of controls. Keep before binding of vars and keep in same order as in setup() uint8_t bpm = leds.effectData.read(); - bool vertical = leds.effectData.read(); + bool3State vertical = leds.effectData.read(); leds.fadeToBlackBy(100); @@ -1115,7 +1115,7 @@ class OctopusEffect: public Effect { void setup(LedsLayer &leds, JsonObject parentVar) { Effect::setup(leds, parentVar); //palette - bool *setup = leds.effectData.write(true); + bool3State *setup = leds.effectData.write(true); ui->initSlider(parentVar, "speed", leds.effectData.write(128), 1, 255); ui->initSlider(parentVar, "offsetX", leds.effectData.write(128), 0, 255, false, [setup] (JsonObject var, uint8_t rowNr, uint8_t funType) { switch (funType) { case onChange: {*setup = true; return true;} @@ -1130,7 +1130,7 @@ class OctopusEffect: public Effect { void loop(LedsLayer &leds) { //Binding of controls. Keep before binding of vars and keep in same order as in setup() - bool *setup = leds.effectData.readWrite(); + bool3State *setup = leds.effectData.readWrite(); uint8_t speed = leds.effectData.read(); uint8_t offsetX = leds.effectData.read(); uint8_t offsetY = leds.effectData.read(); @@ -1202,7 +1202,7 @@ class LissajousEffect: public Effect { ui->initSlider(parentVar, "xFrequency", leds.effectData.write(64)); ui->initSlider(parentVar, "fadeRate", leds.effectData.write(128)); ui->initSlider(parentVar, "speed", leds.effectData.write(128)); - ui->initCheckBox(parentVar, "smooth", leds.effectData.write(false)); + ui->initCheckBox(parentVar, "smooth", leds.effectData.write(false)); //true: not working at the moment } void loop(LedsLayer &leds) { @@ -1210,7 +1210,7 @@ class LissajousEffect: public Effect { uint8_t xFrequency = leds.effectData.read(); uint8_t fadeRate = leds.effectData.read(); uint8_t speed = leds.effectData.read(); - bool smooth = leds.effectData.read(); + bool3State smooth = leds.effectData.read(); leds.fadeToBlackBy(fadeRate); @@ -1421,8 +1421,8 @@ class GameOfLifeEffect: public Effect { void setup(LedsLayer &leds, JsonObject parentVar) { Effect::setup(leds, parentVar); - bool *setup = leds.effectData.write(true); - bool *ruleChanged = leds.effectData.write(true); + bool3State *setup = leds.effectData.write(true); + bool3State *ruleChanged = leds.effectData.write(true); ui->initCoord3D(parentVar, "backgroundColor", leds.effectData.write({0,0,0}), 0, 255); ui->initSelect (parentVar, "ruleset", leds.effectData.write(1), false, [ruleChanged](JsonObject var, uint8_t rowNr, uint8_t funType) { switch (funType) { case onUI: { @@ -1446,26 +1446,26 @@ class GameOfLifeEffect: public Effect { ui->initSlider (parentVar, "GameSpeed (FPS)", leds.effectData.write(20), 0, 100); ui->initSlider (parentVar, "startingLifeDensity", leds.effectData.write(32), 10, 90); ui->initSlider (parentVar, "mutationChance", leds.effectData.write(2), 0, 100); - ui->initCheckBox(parentVar, "wrap", leds.effectData.write(true)); - ui->initCheckBox(parentVar, "disablePause", leds.effectData.write(false)); - ui->initCheckBox(parentVar, "colorByAge", leds.effectData.write(false)); - ui->initCheckBox(parentVar, "infinite", leds.effectData.write(false)); + ui->initCheckBox(parentVar, "wrap", leds.effectData.write(true)); + ui->initCheckBox(parentVar, "disablePause", leds.effectData.write(false)); + ui->initCheckBox(parentVar, "colorByAge", leds.effectData.write(false)); + ui->initCheckBox(parentVar, "infinite", leds.effectData.write(false)); ui->initSlider (parentVar, "blur", leds.effectData.write(128), 0, 255); } void loop(LedsLayer &leds) { // UI Variables - bool *setup = leds.effectData.readWrite(); - bool *ruleChanged = leds.effectData.readWrite(); + bool3State *setup = leds.effectData.readWrite(); + bool3State *ruleChanged = leds.effectData.readWrite(); Coord3D bgC = leds.effectData.read(); byte ruleset = leds.effectData.read(); uint8_t speed = leds.effectData.read(); byte lifeChance = leds.effectData.read(); uint8_t mutation = leds.effectData.read(); - bool wrap = leds.effectData.read(); - bool disablePause = leds.effectData.read(); - bool colorByAge = leds.effectData.read(); - bool infinite = leds.effectData.read(); + bool3State wrap = leds.effectData.read(); + bool3State disablePause = leds.effectData.read(); + bool3State colorByAge = leds.effectData.read(); + bool3State infinite = leds.effectData.read(); uint8_t blur = leds.effectData.read(); // Effect Variables @@ -1476,10 +1476,10 @@ class GameOfLifeEffect: public Effect { uint16_t *oscillatorCRC = leds.effectData.readWrite(); uint16_t *spaceshipCRC = leds.effectData.readWrite(); uint16_t *cubeGliderCRC = leds.effectData.readWrite(); - bool *soloGlider = leds.effectData.readWrite(); + bool3State *soloGlider = leds.effectData.readWrite(); uint16_t *generation = leds.effectData.readWrite(); - bool *birthNumbers = leds.effectData.readWrite(9); - bool *surviveNumbers = leds.effectData.readWrite(9); + bool3State *birthNumbers = leds.effectData.readWrite(9); + bool3State *surviveNumbers = leds.effectData.readWrite(9); CRGB *prevPalette = leds.effectData.readWrite(); byte *cells = leds.effectData.readWrite(dataSize); byte *futureCells = leds.effectData.readWrite(dataSize); @@ -1878,13 +1878,13 @@ class RubiksCubeEffect: public Effect { void setup(LedsLayer &leds, JsonObject parentVar) { Effect::setup(leds, parentVar); - bool *setup = leds.effectData.write(true); + bool3State *setup = leds.effectData.write(true); ui->initSlider (parentVar, "turnsPerSecond", leds.effectData.write(1), 0, 20); ui->initSlider (parentVar, "cubeSize", leds.effectData.write(2), 1, 8, false, [setup] (JsonObject var, uint8_t rowNr, uint8_t funType) { switch (funType) { case onChange: {*setup = true; return true;} default: return false; }}); - ui->initCheckBox(parentVar, "randomTurning", leds.effectData.write(false), false, [setup] (JsonObject var, uint8_t rowNr, uint8_t funType) { switch (funType) { + ui->initCheckBox(parentVar, "randomTurning", leds.effectData.write(false), false, [setup] (JsonObject var, uint8_t rowNr, uint8_t funType) { switch (funType) { case onChange: {if (!mdl->getValue("effect", "Random Turning")) *setup = true; return true;} default: return false; }}); @@ -1892,10 +1892,10 @@ class RubiksCubeEffect: public Effect { void loop(LedsLayer &leds) { // UI control variables - bool *setup = leds.effectData.readWrite(); + bool3State *setup = leds.effectData.readWrite(); uint8_t turnsPerSecond = leds.effectData.read(); uint8_t cubeSize = leds.effectData.read(); - bool randomTurning = leds.effectData.read(); + bool3State randomTurning = leds.effectData.read(); // Effect variables unsigned long *step = leds.effectData.readWrite(); @@ -2059,38 +2059,38 @@ class ParticleTestEffect: public Effect { void setup(LedsLayer &leds, JsonObject parentVar) { Effect::setup(leds, parentVar); - bool *setup = leds.effectData.write(true); + bool3State *setup = leds.effectData.write(true); ui->initSlider (parentVar, "speed", leds.effectData.write(15), 0, 30); ui->initSlider (parentVar, "number of Particles", leds.effectData.write(10), 1, 255, false, [setup] (JsonObject var, uint8_t rowNr, uint8_t funType) { switch (funType) { case onChange: {*setup = true; return true;} default: return false; }}); - ui->initCheckBox(parentVar, "barriers", leds.effectData.write(0) , false, [setup] (JsonObject var, uint8_t rowNr, uint8_t funType) { switch (funType) { + ui->initCheckBox(parentVar, "barriers", leds.effectData.write(0) , false, [setup] (JsonObject var, uint8_t rowNr, uint8_t funType) { switch (funType) { case onChange: {*setup = true; return true;} default: return false; }}); #ifdef STARBASE_USERMOD_MPU6050 - ui->initCheckBox(parentVar, "gyro", leds.effectData.write(0)); + ui->initCheckBox(parentVar, "gyro", leds.effectData.write(0)); #endif - ui->initCheckBox(parentVar, "randomGravity", leds.effectData.write(1)); + ui->initCheckBox(parentVar, "randomGravity", leds.effectData.write(1)); ui->initSlider (parentVar, "gravityChangeInterval", leds.effectData.write(5), 1, 10); - // ui->initCheckBox(parentVar, "Debug Print", leds.effectData.write(0)); + // ui->initCheckBox(parentVar, "Debug Print", leds.effectData.write(0)); } void loop(LedsLayer &leds) { // UI Variables - bool *setup = leds.effectData.readWrite(); + bool3State *setup = leds.effectData.readWrite(); uint8_t speed = leds.effectData.read(); uint8_t numParticles = leds.effectData.read(); - bool barriers = leds.effectData.read(); + bool3State barriers = leds.effectData.read(); #ifdef STARBASE_USERMOD_MPU6050 - bool gyro = leds.effectData.read(); + bool3State gyro = leds.effectData.read(); #else bool gyro = false; #endif - bool randomGravity = leds.effectData.read(); + bool3State randomGravity = leds.effectData.read(); uint8_t gravityChangeInterval = leds.effectData.read(); - // bool debugPrint = leds.effectData.read(); + // bool3State debugPrint = leds.effectData.read(); bool debugPrint = false; // Effect Variables @@ -2203,20 +2203,20 @@ class StarFieldEffect: public Effect { // Inspired by Daniel Shiffman's Coding void setup(LedsLayer &leds, JsonObject parentVar) { Effect::setup(leds, parentVar); - bool *setup = leds.effectData.write(true); + bool3State *setup = leds.effectData.write(true); ui->initSlider(parentVar, "speed", leds.effectData.write(20), 0, 30); // 0 - 30 updates per second ui->initSlider(parentVar, "number of Stars", leds.effectData.write(16), 1, 255); ui->initSlider(parentVar, "blur", leds.effectData.write(128), 0, 255); - ui->initCheckBox(parentVar, "usePalette", leds.effectData.write(false)); + ui->initCheckBox(parentVar, "usePalette", leds.effectData.write(false)); } void loop(LedsLayer &leds) { // UI Variables - bool *setup = leds.effectData.readWrite(); + bool3State *setup = leds.effectData.readWrite(); uint8_t speed = leds.effectData.read(); uint8_t numStars = leds.effectData.read(); uint8_t blur = map(leds.effectData.read(), 0, 255, 255, 0); - bool usePalette = leds.effectData.read(); + bool3State usePalette = leds.effectData.read(); // Effect Variables unsigned long *step = leds.effectData.readWrite(); @@ -2330,18 +2330,18 @@ class WaverlyEffect: public Effect { Effect::setup(leds, parentVar); ui->initSlider(parentVar, "fadeRate", leds.effectData.write(128)); ui->initSlider(parentVar, "amplification", leds.effectData.write(30)); - ui->initCheckBox(parentVar, "noClouds", leds.effectData.write(false)); - // ui->initCheckBox(parentVar, "soundPressure", leds.effectData.write(false)); - // ui->initCheckBox(parentVar, "AGCDebug", leds.effectData.write(false)); + ui->initCheckBox(parentVar, "noClouds", leds.effectData.write(false)); + // ui->initCheckBox(parentVar, "soundPressure", leds.effectData.write(false)); + // ui->initCheckBox(parentVar, "AGCDebug", leds.effectData.write(false)); } void loop(LedsLayer &leds) { //Binding of controls. Keep before binding of vars and keep in same order as in setup() uint8_t fadeRate = leds.effectData.read(); uint8_t amplification = leds.effectData.read(); - bool noClouds = leds.effectData.read(); - // bool soundPressure = leds.effectData.read(); - // bool agcDebug = leds.effectData.read(); + bool3State noClouds = leds.effectData.read(); + // bool3State soundPressure = leds.effectData.read(); + // bool3State agcDebug = leds.effectData.read(); leds.fadeToBlackBy(fadeRate); //netmindz: cannot find these in audio sync @@ -2376,8 +2376,8 @@ class GEQEffect: public Effect { Effect::setup(leds, parentVar); ui->initSlider(parentVar, "fadeOut", leds.effectData.write(255)); ui->initSlider(parentVar, "ripple", leds.effectData.write(128)); - ui->initCheckBox(parentVar, "colorBars", leds.effectData.write(false)); - ui->initCheckBox(parentVar, "smoothBars", leds.effectData.write(true)); + ui->initCheckBox(parentVar, "colorBars", leds.effectData.write(false)); + ui->initCheckBox(parentVar, "smoothBars", leds.effectData.write(true)); // Nice an effect can register it's own DMX channel, but not a fan of repeating the range and type of the param @@ -2398,8 +2398,8 @@ class GEQEffect: public Effect { //Binding of controls. Keep before binding of vars and keep in same order as in setup() uint8_t fadeOut = leds.effectData.read(); uint8_t ripple = leds.effectData.read(); - bool colorBars = leds.effectData.read(); - bool smoothBars = leds.effectData.read(); + bool3State colorBars = leds.effectData.read(); + bool3State smoothBars = leds.effectData.read(); //binding of loop persistent values (pointers) tbd: aux0,1,step etc can be renamed to meaningful names uint16_t *previousBarHeight = leds.effectData.readWrite(leds.size.x); //array @@ -2494,8 +2494,8 @@ class LaserGEQEffect: public Effect { ui->initSlider(parentVar, "horizon", leds.effectData.write(0), 0, leds.size.x-1); //leds.size.x-1 is not always set here ui->initSlider(parentVar, "depth", leds.effectData.write(176)); ui->initSlider(parentVar, "numBands", leds.effectData.write(16), 2, 16); // constrain NUM_BANDS between 2(for split) and cols (for small width segments) - ui->initCheckBox(parentVar, "borders", leds.effectData.write(true)); - ui->initCheckBox(parentVar, "softHack", leds.effectData.write(true)); + ui->initCheckBox(parentVar, "borders", leds.effectData.write(true)); + ui->initCheckBox(parentVar, "softHack", leds.effectData.write(true)); // "GEQ 3D ☾@Speed,Front Fill,Horizon,Depth,Num Bands,Borders,Soft,;!,,Peaks;!;2f;sx=255,ix=228,c1=255,c2=255,c3=15,pal=11"; } @@ -2506,8 +2506,8 @@ class LaserGEQEffect: public Effect { uint8_t horizon = leds.effectData.read(); uint8_t depth = leds.effectData.read(); uint8_t numBands = leds.effectData.read(); - bool borders = leds.effectData.read(); - bool softHack = leds.effectData.read(); + bool3State borders = leds.effectData.read(); + bool3State softHack = leds.effectData.read(); uint16_t *projector = leds.effectData.readWrite(); int8_t *projector_dir = leds.effectData.readWrite(); @@ -2641,9 +2641,9 @@ class PaintbrushEffect: public Effect { ui->initSlider(parentVar, "# of lines", leds.effectData.write(255), 2, 255); ui->initSlider(parentVar, "fadeRate", leds.effectData.write(40), 0, 128); ui->initSlider(parentVar, "minLength", leds.effectData.write(0)); - ui->initCheckBox(parentVar, "colorChaos", leds.effectData.write(false)); - ui->initCheckBox(parentVar, "antiAliasing", leds.effectData.write(true)); - ui->initCheckBox(parentVar, "phaseChaos", leds.effectData.write(false)); + ui->initCheckBox(parentVar, "colorChaos", leds.effectData.write(false)); + ui->initCheckBox(parentVar, "antiAliasing", leds.effectData.write(true)); + ui->initCheckBox(parentVar, "phaseChaos", leds.effectData.write(false)); // "Paintbrush ☾@Oscillator Offset,# of lines,Fade Rate,,Min Length,Color Chaos,Anti-aliasing,Phase Chaos;!,,Peaks;!;2f;sx=160,ix=255,c1=80,c2=255,c3=0,pal=72,o1=0,o2=1,o3=0"; } @@ -2654,9 +2654,9 @@ class PaintbrushEffect: public Effect { uint8_t numLines = leds.effectData.read(); uint8_t fadeRate = leds.effectData.read(); uint8_t minLength = leds.effectData.read(); - bool color_chaos = leds.effectData.read(); - bool soft = leds.effectData.read(); - bool phase_chaos = leds.effectData.read(); + bool3State color_chaos = leds.effectData.read(); + bool3State soft = leds.effectData.read(); + bool3State phase_chaos = leds.effectData.read(); //binding of loop persistent values (pointers) tbd: aux0,1,step etc can be renamed to meaningful names uint16_t *aux0Hue = leds.effectData.readWrite(); @@ -2897,13 +2897,13 @@ class MarioTestEffect: public Effect { const char * tags() {return "💫";} void setup(LedsLayer &leds, JsonObject parentVar) { - ui->initCheckBox(parentVar, "background", leds.effectData.write(false)); + ui->initCheckBox(parentVar, "background", leds.effectData.write(false)); ui->initSlider(parentVar, "offsetX", leds.effectData.write(leds.size.x/2 - 8), 0, leds.size.x - 16); ui->initSlider(parentVar, "offsetY", leds.effectData.write(leds.size.y/2 - 8), 0, leds.size.y - 16); } void loop(LedsLayer &leds) { - bool background = leds.effectData.read(); + bool3State background = leds.effectData.read(); uint8_t offsetX = leds.effectData.read(); uint8_t offsetY = leds.effectData.read(); @@ -3065,13 +3065,13 @@ class BasicTemplate: public Effect { // add effects.push_back(new Name); to LedM void setup(LedsLayer &leds, JsonObject parentVar) { Effect::setup(leds, parentVar); - bool *setup = leds.effectData.write(true); + bool3State *setup = leds.effectData.write(true); ui->initSlider(parentVar, "speed", leds.effectData.write(1), 0, 30); // 0 - 30 updates per second } void loop(LedsLayer &leds) { // UI Variables - bool *setup = leds.effectData.readWrite(); + bool3State *setup = leds.effectData.readWrite(); uint8_t speed = leds.effectData.read(); // Updates per second // Effect Variables diff --git a/src/App/LedModFixture.h b/src/App/LedModFixture.h index 620b1cc..b15a6e8 100644 --- a/src/App/LedModFixture.h +++ b/src/App/LedModFixture.h @@ -42,7 +42,7 @@ // why if this if not working here? (removed for now to have the buffer right) // #if (I2S_MAPPING_MODE & (I2S_MAPPING_MODE_OPTION_MAPPING_IN_MEMORY | I2S_MAPPING_MODE_OPTION_MAPPING_SOFTWARE)) > 0 - #define __NB_DMA_BUFFER 4 //underscore ! default 2 (2 causes flickering in case of mapping). + #define __NB_DMA_BUFFER 10 //underscore ! default 2 (2 causes flickering in case of mapping). //Sometimes interrupts can distrub the pixel buffer calculations hence making some artifacts. A solution against that is to caculate several buffers in advance. BY defualt we have 2 dma buffers. this can be increase to cope with unwanted interupts. // #endif @@ -122,9 +122,9 @@ class LedModFixture: public SysModule { uint16_t fps = 60; uint16_t realFps = 60; - bool showTicker = true; + bool3State showTicker = true; char tickerTape[20] = ""; - bool driverShow = true; + bool3State driverShow = true; //temporary here uint16_t indexP = 0; diff --git a/src/App/LedProjections.h b/src/App/LedProjections.h index 4015a07..c8f1cd8 100644 --- a/src/App/LedProjections.h +++ b/src/App/LedProjections.h @@ -133,7 +133,7 @@ class PinwheelProjection: public Projection { void setup(LedsLayer &leds, JsonObject parentVar) { uint8_t *petals = leds.projectionData.write(60); // Initalize petal first for addPixel uint8_t *swirlVal = leds.projectionData.write(30); - bool *reverse = leds.projectionData.write(false); + bool3State *reverse = leds.projectionData.write(false); uint8_t *symmetry = leds.projectionData.write(1); uint8_t *zTwist = leds.projectionData.write(0); @@ -196,7 +196,7 @@ class PinwheelProjection: public Projection { // UI Variables const int petals = leds.projectionData.read(); const int swirlVal = leds.projectionData.read() - 30; // SwirlVal range -30 to 30 - const bool reverse = leds.projectionData.read(); + const bool3State reverse = leds.projectionData.read(); const int symmetry = FACTORS[leds.projectionData.read()-1]; const int zTwist = leds.projectionData.read(); @@ -236,7 +236,7 @@ class MultiplyProjection: public Projection { void setup(LedsLayer &leds, JsonObject parentVar) { Coord3D *proMulti = leds.projectionData.write({2,2,1}); - bool *mirror = leds.projectionData.write(false); + bool3State *mirror = leds.projectionData.write(false); ui->initCoord3D(parentVar, "proMulti", proMulti, 0, 10, false, [&leds](JsonObject var, uint8_t rowNr, uint8_t funType) { switch (funType) { //varFun case onChange: leds.triggerMapping(); @@ -253,7 +253,7 @@ class MultiplyProjection: public Projection { void addPixelsPre(LedsLayer &leds) { Coord3D proMulti = leds.projectionData.read(); - bool mirror = leds.projectionData.read(); + bool3State mirror = leds.projectionData.read(); Coord3D *originalSize = leds.projectionData.readWrite(); proMulti = proMulti.maximum(Coord3D{1, 1, 1}); // {1, 1, 1} is the minimum value @@ -271,7 +271,7 @@ class MultiplyProjection: public Projection { void addPixel(LedsLayer &leds, Coord3D &pixel, uint16_t &indexV) { // UI Variables Coord3D proMulti = leds.projectionData.read(); - bool mirror = leds.projectionData.read(); + bool3State mirror = leds.projectionData.read(); Coord3D originalSize = leds.projectionData.read(); if (mirror) { @@ -473,9 +473,9 @@ class ReverseProjection: public Projection { public: void setup(LedsLayer &leds, JsonObject parentVar) { - bool *reverseX = leds.projectionData.write(false); - bool *reverseY = leds.projectionData.write(false); - bool *reverseZ = leds.projectionData.write(false); + bool3State *reverseX = leds.projectionData.write(false); + bool3State *reverseY = leds.projectionData.write(false); + bool3State *reverseZ = leds.projectionData.write(false); ui->initCheckBox(parentVar, "reverseX", reverseX, false, [&leds](JsonObject var, uint8_t rowNr, uint8_t funType) { switch (funType) { //varFun case onChange: @@ -502,9 +502,9 @@ class ReverseProjection: public Projection { } void addPixel(LedsLayer &leds, Coord3D &pixel, uint16_t &indexV) { - bool reverseX = leds.projectionData.read(); - bool reverseY = leds.projectionData.read(); - bool reverseZ = leds.projectionData.read(); + bool3State reverseX = leds.projectionData.read(); + bool3State reverseY = leds.projectionData.read(); + bool3State reverseZ = leds.projectionData.read(); if (reverseX) pixel.x = leds.size.x - pixel.x - 1; if (reverseY) pixel.y = leds.size.y - pixel.y - 1; @@ -523,9 +523,9 @@ class MirrorProjection: public Projection { public: void setup(LedsLayer &leds, JsonObject parentVar) { - bool *mirrorX = leds.projectionData.write(false); - bool *mirrorY = leds.projectionData.write(false); - bool *mirrorZ = leds.projectionData.write(false); + bool3State *mirrorX = leds.projectionData.write(false); + bool3State *mirrorY = leds.projectionData.write(false); + bool3State *mirrorZ = leds.projectionData.write(false); ui->initCheckBox(parentVar, "mirrorX", mirrorX, false, [&leds](JsonObject var, uint8_t rowNr, uint8_t funType) { switch (funType) { //varFun case onChange: leds.triggerMapping(); @@ -552,9 +552,9 @@ class MirrorProjection: public Projection { void addPixelsPre(LedsLayer &leds) { // UI Variables - bool mirrorX = leds.projectionData.read(); - bool mirrorY = leds.projectionData.read(); - bool mirrorZ = leds.projectionData.read(); + bool3State mirrorX = leds.projectionData.read(); + bool3State mirrorY = leds.projectionData.read(); + bool3State mirrorZ = leds.projectionData.read(); Coord3D *originalSize = leds.projectionData.readWrite(); if (mirrorX) leds.size.x = (leds.size.x + 1) / 2; @@ -568,9 +568,9 @@ class MirrorProjection: public Projection { void addPixel(LedsLayer &leds, Coord3D &pixel, uint16_t &indexV) { // UI Variables - bool mirrorX = leds.projectionData.read(); - bool mirrorY = leds.projectionData.read(); - bool mirrorZ = leds.projectionData.read(); + bool3State mirrorX = leds.projectionData.read(); + bool3State mirrorY = leds.projectionData.read(); + bool3State mirrorZ = leds.projectionData.read(); Coord3D originalSize = leds.projectionData.read(); if (mirrorX && pixel.x >= originalSize.x) pixel.x = originalSize.x * 2 - 1 - pixel.x; @@ -673,9 +673,9 @@ class TransposeProjection: public Projection { public: void setup(LedsLayer &leds, JsonObject parentVar) { - bool *transposeXY = leds.projectionData.write(false); - bool *transposeXZ = leds.projectionData.write(false); - bool *transposeYZ = leds.projectionData.write(false); + bool3State *transposeXY = leds.projectionData.write(false); + bool3State *transposeXZ = leds.projectionData.write(false); + bool3State *transposeYZ = leds.projectionData.write(false); ui->initCheckBox(parentVar, "transpose XY", transposeXY, false, [&leds](JsonObject var, uint8_t rowNr, uint8_t funType) { switch (funType) { //varFun case onChange: @@ -701,9 +701,9 @@ class TransposeProjection: public Projection { void addPixel(LedsLayer &leds, Coord3D &pixel, uint16_t &indexV) { // UI Variables - bool transposeXY = leds.projectionData.read(); - bool transposeXZ = leds.projectionData.read(); - bool transposeYZ = leds.projectionData.read(); + bool3State transposeXY = leds.projectionData.read(); + bool3State transposeXZ = leds.projectionData.read(); + bool3State transposeYZ = leds.projectionData.read(); if (transposeXY) { int temp = pixel.x; pixel.x = pixel.y; pixel.y = temp; } if (transposeXZ) { int temp = pixel.x; pixel.x = pixel.z; pixel.z = temp; } @@ -752,9 +752,9 @@ class ScrollingProjection: public Projection { } void XYZ(LedsLayer &leds, Coord3D &pixel) { - bool mirrorX = leds.projectionData.read(); // Not used - bool mirrorY = leds.projectionData.read(); // Not used - bool mirrorZ = leds.projectionData.read(); // Not used + bool3State mirrorX = leds.projectionData.read(); // Not used + bool3State mirrorY = leds.projectionData.read(); // Not used + bool3State mirrorZ = leds.projectionData.read(); // Not used uint8_t xSpeed = leds.projectionData.read(); uint8_t ySpeed = leds.projectionData.read(); @@ -773,7 +773,7 @@ class AccelerationProjection: public Projection { public: void setup(LedsLayer &leds, JsonObject parentVar) { - bool *wrap = leds.projectionData.write(false); + bool3State *wrap = leds.projectionData.write(false); uint8_t *sensitivity = leds.projectionData.write(0); uint8_t *deadzone = leds.projectionData.write(10); @@ -788,7 +788,7 @@ class AccelerationProjection: public Projection { } void XYZ(LedsLayer &leds, Coord3D &pixel) { - bool wrap = leds.projectionData.read(); + bool3State wrap = leds.projectionData.read(); float sensitivity = float(leds.projectionData.read()) / 20.0 + 1; // 0 - 100 slider -> 1.0 - 6.0 multiplier uint16_t deadzone = map(leds.projectionData.read(), 0, 255, 0 , 1000); // 0 - 1000 @@ -818,8 +818,8 @@ class CheckerboardProjection: public Projection { void setup(LedsLayer &leds, JsonObject parentVar) { Coord3D *size = leds.projectionData.write({3,3,3}); - bool *invert = leds.projectionData.write(false); - bool *group = leds.projectionData.write(false); + bool3State *invert = leds.projectionData.write(false); + bool3State *group = leds.projectionData.write(false); ui->initCoord3D(parentVar, "squareSize", size, 0, 100, false, [&leds](JsonObject var, uint8_t rowNr, uint8_t funType) { switch (funType) { //varFun case onChange: leds.triggerMapping(); @@ -842,8 +842,8 @@ class CheckerboardProjection: public Projection { void addPixel(LedsLayer &leds, Coord3D &pixel, uint16_t &indexV) { Coord3D size = leds.projectionData.read(); - bool invert = leds.projectionData.read(); - bool group = leds.projectionData.read(); + bool3State invert = leds.projectionData.read(); + bool3State group = leds.projectionData.read(); // ppf ("pixel: %d,%d,%d -> ", pixel.x, pixel.y, pixel.z); size = size.maximum(Coord3D{1, 1, 1}); // {1, 1, 1} is the minimum value diff --git a/src/Sys/SysModUI.h b/src/Sys/SysModUI.h index 8ed610d..4893216 100644 --- a/src/Sys/SysModUI.h +++ b/src/Sys/SysModUI.h @@ -138,8 +138,8 @@ class SysModUI: public SysModule { return initVarAndValue(parent, id, "checkbox", value, 0, 0, readOnly, varFun); } //init a checkbox using referenced value - JsonObject initCheckBox(JsonObject parent, const char * id, bool * value = nullptr, bool readOnly = false, VarFun varFun = nullptr) { - return initVarAndValue(parent, id, "checkbox", value, 0, 0, readOnly, varFun); + JsonObject initCheckBox(JsonObject parent, const char * id, bool3State *value = nullptr, bool readOnly = false, VarFun varFun = nullptr) { + return initVarAndValue(parent, id, "checkbox", value, 0, 0, readOnly, varFun); } //a button never gets a value @@ -289,7 +289,7 @@ class SysModUI: public SysModule { } else { //do onChange on existing value //no call of onChange for buttons otherwise all buttons will be fired which is highly undesirable - if (var["type"] != "button" && !var["fun"].isNull() ) { //!isPointer because 0 is also a value then && (!isPointer || value) + if (var["type"] != "button") { // && !var["fun"].isNull(): also if no varFun to update pointers !isPointer because 0 is also a value then && (!isPointer || value) bool onChangeExists = false; if (var["value"].is()) { //refill the vector @@ -298,7 +298,7 @@ class SysModUI: public SysModule { } } else { - onChangeExists = mdl->callVarOnChange(var, mdl->setValueRowNr, true); //init, also set var["p"] + onChangeExists = mdl->callVarOnChange(var, mdl->setValueRowNr, true); //init, also set var["p"] } if (onChangeExists) diff --git a/src/Sys/SysModWeb.cpp b/src/Sys/SysModWeb.cpp index 256b508..a51f45e 100644 --- a/src/Sys/SysModWeb.cpp +++ b/src/Sys/SysModWeb.cpp @@ -214,8 +214,8 @@ void SysModWeb::connectedChanged() { //else remove handlers... } -//WebSocket connection to 'ws://192.168.8.152/ws' failed: The operation couldn’t be completed. Protocol error -//WS error 192.168.8.126 9 (2) +//WebSocket connection to 'ws://192.168.1.152/ws' failed: The operation couldn’t be completed. Protocol error +//WS error 192.168.1.126 9 (2) //WS event data 0.0.0.0 (1) 0 0 0=0? 34 0 //WS pong 0.0.0.0 9 (1) //wsEvent deserializeJson failed with code EmptyInput @@ -476,7 +476,7 @@ void SysModWeb::serveNewUI(WebRequest *request) { void SysModWeb::serveUpload(WebRequest *request, const String& fileName, size_t index, byte *data, size_t len, bool final) { - // curl -F 'data=@fixture1.json' 192.168.8.213/upload + // curl -F 'data=@fixture1.json' 192.168.1.213/upload ppf("serveUpload r:%s f:%s i:%d l:%d f:%d\n", request->url().c_str(), fileName.c_str(), index, len, final); mdl->setValue("Files", "upload", index/10000); @@ -530,7 +530,7 @@ void SysModWeb::serveUpload(WebRequest *request, const String& fileName, size_t void SysModWeb::serveUpdate(WebRequest *request, const String& fileName, size_t index, byte *data, size_t len, bool final) { - // curl -F 'data=@fixture1.json' 192.168.8.213/upload + // curl -F 'data=@fixture1.json' 192.168.1.213/upload // ppf("serveUpdate r:%s f:%s i:%d l:%d f:%d\n", request->url().c_str(), fileName.c_str(), index, len, final); mdl->setValue("System", "update", index/10000); @@ -711,7 +711,7 @@ void SysModWeb::serializeState(JsonVariant root) { } void SysModWeb::serializeInfo(JsonVariant root) { - const char * jsonInfo = "{\"ver\":\"0.14.1-b30.36\",\"rel\":\"abc_wled_controller_v43_M\",\"vid\":2402252,\"leds\":{\"count\":1024,\"countP\":1024,\"pwr\":1124,\"fps\":32,\"maxpwr\":9500,\"maxseg\":32,\"matrix\":{\"w\":32,\"h\":32},\"seglc\":[1],\"lc\":1,\"rgbw\":false,\"wv\":0,\"cct\":0},\"str\":false,\"name\":\"WLED-Wladi\",\"udpport\":21324,\"live\":false,\"liveseg\":-1,\"lm\":\"\",\"lip\":\"\",\"ws\":2,\"fxcount\":195,\"palcount\":75,\"cpalcount\":0,\"maps\":[{\"id\":0}],\"outputs\":[1024],\"wifi\":{\"bssid\":\"\",\"rssi\":0,\"signal\":100,\"channel\":1},\"fs\":{\"u\":20,\"t\":983,\"pmt\":0},\"ndc\":16,\"arch\":\"esp32\",\"core\":\"v3.3.6-16-gcc5440f6a2\",\"lwip\":0,\"totalheap\":294784,\"getflash\":4194304,\"freeheap\":115988,\"freestack\":6668,\"minfreeheap\":99404,\"e32core0code\":12,\"e32core0text\":\"SW restart\",\"e32core1code\":12,\"e32core1text\":\"SW restart\",\"e32code\":4,\"e32text\":\"SW error (panic or exception)\",\"e32model\":\"ESP32-D0WDQ5 rev.3\",\"e32cores\":2,\"e32speed\":240,\"e32flash\":4,\"e32flashspeed\":80,\"e32flashmode\":2,\"e32flashtext\":\" (DIO)\",\"uptime\":167796,\"opt\":79,\"brand\":\"WLED\",\"product\":\"MoonModules\",\"mac\":\"08b61f6fa800\",\"ip\":\"192.168.8.171\"}"; + const char * jsonInfo = "{\"ver\":\"0.14.1-b30.36\",\"rel\":\"abc_wled_controller_v43_M\",\"vid\":2402252,\"leds\":{\"count\":1024,\"countP\":1024,\"pwr\":1124,\"fps\":32,\"maxpwr\":9500,\"maxseg\":32,\"matrix\":{\"w\":32,\"h\":32},\"seglc\":[1],\"lc\":1,\"rgbw\":false,\"wv\":0,\"cct\":0},\"str\":false,\"name\":\"WLED-Wladi\",\"udpport\":21324,\"live\":false,\"liveseg\":-1,\"lm\":\"\",\"lip\":\"\",\"ws\":2,\"fxcount\":195,\"palcount\":75,\"cpalcount\":0,\"maps\":[{\"id\":0}],\"outputs\":[1024],\"wifi\":{\"bssid\":\"\",\"rssi\":0,\"signal\":100,\"channel\":1},\"fs\":{\"u\":20,\"t\":983,\"pmt\":0},\"ndc\":16,\"arch\":\"esp32\",\"core\":\"v3.3.6-16-gcc5440f6a2\",\"lwip\":0,\"totalheap\":294784,\"getflash\":4194304,\"freeheap\":115988,\"freestack\":6668,\"minfreeheap\":99404,\"e32core0code\":12,\"e32core0text\":\"SW restart\",\"e32core1code\":12,\"e32core1text\":\"SW restart\",\"e32code\":4,\"e32text\":\"SW error (panic or exception)\",\"e32model\":\"ESP32-D0WDQ5 rev.3\",\"e32cores\":2,\"e32speed\":240,\"e32flash\":4,\"e32flashspeed\":80,\"e32flashmode\":2,\"e32flashtext\":\" (DIO)\",\"uptime\":167796,\"opt\":79,\"brand\":\"WLED\",\"product\":\"MoonModules\"}"; JsonDocument docInfo; deserializeJson(root, jsonInfo); diff --git a/src/Sys/SysModWeb.h b/src/Sys/SysModWeb.h index 895659e..769aeb6 100644 --- a/src/Sys/SysModWeb.h +++ b/src/Sys/SysModWeb.h @@ -87,18 +87,18 @@ class SysModWeb:public SysModule { void serveJson(WebRequest *request); - // curl -F 'data=@fixture1.json' 192.168.8.213/upload + // curl -F 'data=@fixture1.json' 192.168.1.213/upload void serveUpload(WebRequest *request, const String& fileName, size_t index, byte *data, size_t len, bool final); - // curl -s -F "update=@/Users/ewoudwijma/Developer/GitHub/ewowi/StarBase/.pio/build/esp32dev/firmware.bin" 192.168.8.102/update /dev/null & + // curl -s -F "update=@/Users/ewoudwijma/Developer/GitHub/ewowi/StarBase/.pio/build/esp32dev/firmware.bin" 192.168.1.102/update /dev/null & void serveUpdate(WebRequest *request, const String& fileName, size_t index, byte *data, size_t len, bool final); void serveFiles(WebRequest *request); //processJsonUrl handles requests send in javascript using fetch and from a browser or curl - //try this !!!: curl -X POST "http://192.168.121.196/json" -d '{"pin2":false}' -H "Content-Type: application/json" - //curl -X POST "http://4.3.2.1/json" -d '{"pin2":false}' -H "Content-Type: application/json" - //curl -X POST "http://4.3.2.1/json" -d '{"brightness":20, "v":true}' -H "Content-Type: application/json" - //curl -X POST "http://192.168.8.125/json" -d '{"effect":2}' -H "Content-Type: application/json" - //curl -X POST "http://192.168.8.152/json" -d '{"nrOfLeds":2000}' -H "Content-Type: application/json" + //try this !!!: + //curl -X POST "http://4.3.2.1/json" -d '{"Pins.pin19":false}' -H "Content-Type: application/json" + //curl -X POST "http://4.3.2.1/json" -d '{"Fixture.brightness":20, "v":true}' -H "Content-Type: application/json" + //curl -X POST "http://192.168.1.125/json" -d '{"leyers.effect":2}' -H "Content-Type: application/json" + //curl -X POST "http://192.168.1.152/json" -d '{"nrOfLeds":2000}' -H "Content-Type: application/json" //handle "v" and processJson (on /json) void jsonHandler(WebRequest *request, JsonVariant json); diff --git a/src/User/UserModMPU6050.h b/src/User/UserModMPU6050.h index 3f79769..40fa7b0 100644 --- a/src/User/UserModMPU6050.h +++ b/src/User/UserModMPU6050.h @@ -22,7 +22,7 @@ class UserModMPU6050: public SysModule { public: - bool motionTrackingReady = false; // set true if DMP init was successful + bool3State motionTrackingReady = false; // set true if DMP init was successful Coord3D gyro; // in degrees (not radians) Coord3D accell;