Giter Club home page Giter Club logo

Comments (21)

Winston-Lu avatar Winston-Lu commented on September 27, 2024

This is quite odd, try replacing the following void loop() function with the following and let me know if the issue persists:

void loop() {
  updateServer();
  fill_solid(leds, NUM_LEDS, CRGB::Black);
  #ifdef SPOTLIGHTPIN
  fill_solid(spotlightLed, WIDTH*HEIGHT, CRGB::Black);
  #endif
  FastLED.show();
  delay(1000 / FRAMES_PER_SECOND);
}

This should strip down most of the features so I can pinpoint where exactly the bug is. Once you start the clock, every LED should be off. The webserver will be active but won't update to show any effects

from esp8266-led-shelf.

xkeeevx avatar xkeeevx commented on September 27, 2024

Changed it and still the same. Only the first of downlighters and clock led flashing.

from esp8266-led-shelf.

Winston-Lu avatar Winston-Lu commented on September 27, 2024

Might be an issue with FastLED, does the following snippet also have the same issue? The segments should turn off but the spotlights should not change from their previous state

void loop() {
  fill_solid(leds, NUM_LEDS, CRGB::Black);
  FastLED.show();
  delay(1000 / FRAMES_PER_SECOND);
}

from esp8266-led-shelf.

xkeeevx avatar xkeeevx commented on September 27, 2024

Now only the downlighters (clock LEDs off) are on, but no flashing of the first LEDs

from esp8266-led-shelf.

Winston-Lu avatar Winston-Lu commented on September 27, 2024

How about this?

void loop() {
  fill_solid(leds, 207, CRGB::Black);
  fill_solid(spotlightLed, 10, CRGB::Black);
  FastLED.show();
  delay(1000 / FRAMES_PER_SECOND);
}

from esp8266-led-shelf.

xkeeevx avatar xkeeevx commented on September 27, 2024

Only the 2 bottom right downlighters are on, still no flashing.

from esp8266-led-shelf.

Winston-Lu avatar Winston-Lu commented on September 27, 2024

Wait, my bad. Change that 10 to 12 on the fill_solid(spotlightLed, 10, CRGB::Black); line

from esp8266-led-shelf.

xkeeevx avatar xkeeevx commented on September 27, 2024

All off, no flashing

from esp8266-led-shelf.

Winston-Lu avatar Winston-Lu commented on September 27, 2024

Now thats weird, try the following:

void loop() {
  fill_solid(leds, NUM_LEDS, CRGB::Black);
  fill_solid(spotlightLed, WIDTH*HEIGHT, CRGB::Black);
  FastLED.show();
  delay(1000 / FRAMES_PER_SECOND);
}

from esp8266-led-shelf.

xkeeevx avatar xkeeevx commented on September 27, 2024

All off, no flashing

from esp8266-led-shelf.

Winston-Lu avatar Winston-Lu commented on September 27, 2024

How about this?

void loop() {
  updateServer();
  fill_solid(leds, NUM_LEDS, CRGB::Black);
  fill_solid(spotlightLed, WIDTH*HEIGHT, CRGB::Black);
  FastLED.show();
  delay(1000 / FRAMES_PER_SECOND);
}

from esp8266-led-shelf.

xkeeevx avatar xkeeevx commented on September 27, 2024

All off but the first LEDs are flashing.

from esp8266-led-shelf.

Winston-Lu avatar Winston-Lu commented on September 27, 2024

Hm, do you know how to find which section of code or function is causing this so we don't need to go back and forth in comments? If I'm following the stack correctly there shouldn't be any obvious code that changes the LED's.

If you don't know how to debug which section is causing it, try commenting out lines in WebServer.cpp until it stops flashing

void updateServer(){
  webServer.handleClient();
  MDNS.update();
  
  static bool hasConnected = false;
  EVERY_N_SECONDS(1) {
    if (WiFi.status() != WL_CONNECTED) {hasConnected = false;}
    else if (!hasConnected) {
      hasConnected = true;
      MDNS.begin(NAME);
      MDNS.setHostname(NAME);
      webServer.begin();
      Serial.println("HTTP web server started");
      Serial.print("Connected! Open http://");
      Serial.print(WiFi.localIP());
      Serial.print(" or http://");
      Serial.print(NAME);
      Serial.println(".local in your browser");
    }
  }
}

Either the webServer.handleClient();, MDNS.update();, or EVERY_N_SECONDS(1){ ... } would be causing it. If you can narrow it down for me on your hardware setup it will help me figure out this issue. Narrowing it down to 1 or a few lines will help out drastically if multiple lines are causing this issue.

Another thing you can try doing is this:

void loop() {
  updateServer();
  fill_solid(leds, NUM_LEDS, CRGB::Black);
  fill_solid(spotlightLed, WIDTH*HEIGHT, CRGB::Black);
  FastLED.show();
  delay(1000 / FRAMES_PER_SECOND);
  FastLED.show();
}

Don't think it'll fix the issue but it would be worth a shot

from esp8266-led-shelf.

xkeeevx avatar xkeeevx commented on September 27, 2024

Ok here some infos: (state changed via if (power == 1) / if (power == 0))

  • without updateServer() the clock works fine on both states (on/off)
  • without webServer.handleClient() on: works fine (no flickering) - off: only first clock LED blinking green every ~3s
  • without MDNS.update() on: first clock LED is flickering - off: both first LED are flickering
  • without EVERY_N_SECONDS(1){ ... } on: first clock LED is flickering - off: both first LED are flickering

The new loop() didnt work.

from esp8266-led-shelf.

Winston-Lu avatar Winston-Lu commented on September 27, 2024

I unfortunately have no idea what is going on then since each of the possible functions here shouldn't be modifying any of the LED colors. You can try different output pins to see if that would work, otherwise it could be a stack corruption bug. I ordered a few ESP8266's since I do not have access to my clock and I'll do my best to fix this when I can replicate the hardware setup and narrow down the issue. Can you try commenting out #define SPOTLIGHTPIN ... and see if the issue still exists?

In the meantime, I can only offer this suggestion since this is the only one I can think of:
Replace the following line in LED_Clock.ino

//Change this section in the loop function
    fill_solid(leds, NUM_LEDS, CRGB::Black);
    #ifdef SPOTLIGHTPIN
    fill_solid(spotlightLed, WIDTH*HEIGHT, CRGB::Black);
    #endif
//to this
    solidSegments(CRGB::Black);
    #ifdef SPOTLIGHTPIN
    solidSpotlightsDedicated(CRGB::Black);
    #endif

from esp8266-led-shelf.

Winston-Lu avatar Winston-Lu commented on September 27, 2024

I was able to recreate this issue with my own setup and I unfortunately have no clue what is causing this issue other than a possible logic level discrepancy. Since the first LED is getting 3.3v logic signals as input and the rest of the LED's are getting 5v logic signals, this could be the issue. I will need to spend a lot more time narrowing down the issue here as the FastLED 100 demo reel still works fine despite that.

I've found that the FastLED.show() function is not working as it is supposed to, since the first LED reports their expected RGB values but display other incorrect values

In the meantime, I pushed a commit that should significantly reduce the amount of flashing and should be usable. It occasionally does flash maybe once every 5-30 seconds, and I still don't know where or what exactly is causing it

from esp8266-led-shelf.

xkeeevx avatar xkeeevx commented on September 27, 2024

Also tried a level shifter from 3,3V to 5V without success :(
The first clock LED is nearly OK for me but the downlighter LED is flickering as hell if I turn the clock off via webserver.

from esp8266-led-shelf.

Winston-Lu avatar Winston-Lu commented on September 27, 2024

Mind if I ask what are your voltage levels when you turn the LED's off and when they are on? Not sure if the logic level shifter would have a fast enough rise time depending on the quality of them. According to the datasheet for these LED's they are expecting a 0.7Vin data input, and with 5V as input, that expects a 3.5V input minimum to work reliably. If possible, try dropping the LED strip voltage to around 4.2V . My clock uses buck converters and they drop voltage quite easily under load so I don't see much flickering there. When I have my test strip which is about 30 LED's, they flicker.

At idle, my strip is at 4.7V, which requires a 3.30V input, and the ESP8266 typically outputs a bit lower than that so I get a bit of flicker. When the strip is on, the voltage drops to 4.2V but the flicker on the first LED is gone.

from esp8266-led-shelf.

xkeeevx avatar xkeeevx commented on September 27, 2024

The easiest workaround for me would be to add an additional first ("dead") LED at each strip and hide it in the shelfs. Is it possible to add this in the code?

from esp8266-led-shelf.

Winston-Lu avatar Winston-Lu commented on September 27, 2024

It would be possible, I'll see what I can do without a major refactor of the entire lighting effects file. I have something in mind but I'm not sure when I will have time to get around it. I'll do my best to have it done during the weekend

from esp8266-led-shelf.

Winston-Lu avatar Winston-Lu commented on September 27, 2024

I created an alpha branch here that should allow you to setup a sacrificial LED. let me know if there are any bugs with that. There is an extra option in the config file that is enabled by default to toggle this feature on/off.

Edit: This change has now been merged with master

from esp8266-led-shelf.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.