arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
21.93k stars 4.76k forks source link

SK6812 - Works in DMA mode but has issues in BitBang mode #2357

Closed TimelessNL closed 6 years ago

TimelessNL commented 6 years ago

Tasmota firmware : 5.12.0 Hardware: NodeMCU 1.0 (currently for testing, since it has easy access to all the pins) user_config :

#define USE_WS2812_CTYPE     3
#define WS2812_LEDS          2 //purely for testing

I've 2 versions of the SK6812 LED strip at this moment.

  1. RGBNW (IP20)(60LED/Meter)
  2. RGBW (IP65)(30LED/Meter) But there seems to be a problem with nr2.

SK6812 - RGBNW (IP20)(60LED/Meter) (total length 5m) DMA Mode (RXpin) = OK BitBang mode (RXpn) = OK

SK6812 - RGBW (IP65)(30LED/Meter) (total length 5m) DMA Mode (RXpin) = OK BitBang mode (RXpin) = ISSUE

Let me give some scenarios: NOTE: Start point for all is: LED strip is OFF and COLOR=1 (a.k.a RED).

scenario 1:

  1. Set brightness to 20% (randomly chosen). 1a. Strip turns on 100% and RGBW (all leds)
  2. Set brightness to 15% (randomly chosen). 2a. Strip turns to 15% and Red (2 configured leds)
  3. Set brightness to 20% (randomly chosen). 3a. Strip turns on 100% and RGBW (all leds)
  4. Set brightness to 40% (randomly chosen). 4a. Strip turns to 40% and Red (2 configured leds)

scenario 2:

  1. Turn Strip on 1a. LED strip turns on 100% RGBW (all leds)
  2. Turn strip off. 2a. LED strip turns off (all leds)
  3. Set brightness to 15% (randomly chosen). 3a. Strip turns to 15% and Red (2 configured leds)
  4. Turn strip off. 4a. LED strip turns on 100% RGBW (all leds)
  5. Turn Strip on. 5a. Strip turns to 15% and Red (2 configured leds)

scenario 3:

  1. Turn Strip on. 1a. LED strip turns on 100% RGBW (all leds)
  2. Set brightness to 15% (randomly chosen). 2a. Strip turns to 15% and Red (2 configured leds)
  3. Turn strip off. 3a. LED strip turns on 100% RGBW (all leds)
  4. Turn Strip on. 4a. Strip turns to 15% and Red (2 configured leds)

Note: I repeated these scenario's over and over again, and the results are always the same. So it's not just random.

So I have no idea why DMA mode works fine while BitBang does not. Also my other SK6812 strip works just fine in both modes.

I also noticed that the SK6812 is default OFF after applying 5V DC without any signal wire attached. While the WS2812 is default ON after applying 5V DC without any signal wire attached. This is the first time I tried the SK6812 and actually like the default OFF feature.

Jason2866 commented 6 years ago

I think the problem is the led strip. The other you have works as expected. Try a another one from a different manufactor

TimelessNL commented 6 years ago

I wish I could, these are the only SK6812 strips I have and are both from the same seller, don't know if they are from the same manufacturer though.

Of course I could buy another strip but that does not explain why this current strip works fine in DMA mode. And the error scenarios are repeatable, nothing random. That's why I don't think it's all to blame on the LED strip.

Jason2866 commented 6 years ago

Yes, the problem can be repeated. But to find it, it is neccersary to check where to search...

TimelessNL commented 6 years ago

neccersary to check where to search...

Sorry, I don't understand what you meant by that.

The strip works fine in DMA mode and has repeatable issues in BitBang mode. And even those issues seem to result in the correct dimming and color after certain steps. If the strip was faulty I would have expected to see some glitching or random patterns, but that was not the case.

TimelessNL commented 6 years ago

Update: I also tested another SK6812 RGBW 60Leds/Meter IP67 (5M total) from the same seller which gave me identical issues in BitBang mode, DMA mode worked fine. Based on that I assume my other SK6812 is fine only the chips behave differently.

Frogmore42 commented 6 years ago

The timing will be different using DMA vs bit-banging. Some chips are more tolerant of variations than others.

scottdalton commented 6 years ago

I just ran into this same issue today testing out an SK6812 strip. I had identical behavior with both bitbang and DMA modes. Thinking it was a timing issue, I tried rebuilding with the CPU frequency upped from 80MHz to 160MHz and the problem resolved. You might give it a try and see if this fixes it for you as well?

TimelessNL commented 6 years ago

@scottdalton: I will test 160Mhz and report the results. Normally a higher CPU freq will generate more heat. What about the ESP8266. Is it safe to double the CPU freq?

@Frogmore42: True, but wouldn't that give more inconsistent results? My tests results are always repeatable, the results aren't just random. A timing issue will most likely result in glitching I suppose.

Frogmore42 commented 6 years ago

@TimelessNL perhaps, perhaps not. If you have access to an oscilloscope, you could put it on the lines and see the difference in the signal.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 6 years ago

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem.