Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NeoPixelBus doesn't get updated for addressable effects #227

Closed
RvanBaarle opened this issue Apr 14, 2019 · 3 comments · May be fixed by esphome/esphome-core#586
Closed

NeoPixelBus doesn't get updated for addressable effects #227

RvanBaarle opened this issue Apr 14, 2019 · 3 comments · May be fixed by esphome/esphome-core#586

Comments

@RvanBaarle
Copy link

Operating environment/Installation (Hass.io/Docker/pip/etc.):

Docker

ESP (ESP32/ESP8266, Board/Sonoff):

ESP8266 ESP-12 type board (using nodemcu as platform in the config)

Affected component:

NeoPixelBus light

Description of problem:
Addressable light effects do not get updated properly. They only seem to update at random (couple second) intervals, or immediately when sending a turn_on event.
Normal effects do work as intended.

Problem-relevant YAML-configuration entries:

light:
 - platform: neopixelbus
   name: "Complete LED strip"
   id: ledstrip
   num_leds: 93
   pin: GPIO3
 - platform: partition
   name: "LED strip top"
   segments:
    - id: ledstrip
      from: 0
      to: 87
   effects:
    - addressable_rainbow:
    - addressable_color_wipe:
    - random:
         transition_length: 10s
         update_interval: 10s

Traceback (if applicable):


Additional information and things you've tried:
I tried fixing this issue myself. By inserting ESP_LOGD(TAG, "Updating LEDstrip"); in the loop method of the component, just before this->controller_->Show();. (On line 90 in this file to be specific), the issue resolves itself, but of course then your log gets filled with useless 'Updating LEDstrip' statements. I'm not sure how it's related, but the bug seems to be related to the logger. I found issue #182, could it be related?

@RvanBaarle
Copy link
Author

Looking further into the issue, I've found some more peculiarities:

  1. Disabling logging output over serial:
    This seems to have no effect at all.
  2. Disabling logging completely:
    The strip can't be updated anymore through sending turn_on events, it only updates after random intervals.
  3. Placing a logging statement after this->controller_->Show(); instead of in front of it:
    This makes the random updates happen more often, but it doesn't animate smoothly at all.

I'm still looking into it, but it seems a very low-level conflict somewhere.

@RvanBaarle
Copy link
Author

The delay caused by the logger seems to fix the issue. I'm still not 100% certain why.
I've found it can be avoided by not enabling the high frequency mode at the start of an addressable effect, I made a pull request with that change. esphome/esphome-core#586

@OttoWinter
Copy link
Member

Has been fixed some time ago.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants