NeoPixel (WS2812b) stability

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
M*I*B
Normal user
Posts: 379
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

NeoPixel (WS2812b) stability

#1 Post by M*I*B » 11 Jan 2023, 12:01

Hello there,

while I'm waiting for some hardware to go future with my other projects I play around with a 2812 RGB-stripe. For now any because my wife like that also (great! Some thing to upper the WAF) I have just create a simple clock with 12 LED's. I use a S07S for that with the last 1M VCC-build. The stripe have it's own power source (5V 5A PSU), the ESP is connected to a buffered powerpack.

What I have learned is that the stripes / the 2812 and/or the NeoPixel- plugin aren't stable. Sometimes one or more unaddressed LED comes up with a random color, sometimes the whole stripe show me the "finger" and all or most of all LED show any random color.

The rule is very simple:

Code: Select all

On Clock#Time=all,**:** Do

	TaskValueSet,tick,h,%syshour%
	TaskValueSet,tick,m,%sysmin%
	
	If [tick#h] > 12
		TaskValueSet,tick,h1,[tick#h]-12
	Elseif [tick#h] = 0
		TaskValueSet,tick,h1,12
	Else
		TaskValueSet,tick,h1,[tick#h]
	Endif
  
	NeoPixelLine,[tick#h1],12,25,25,0
	NeoPixelLine,1,[tick#h1],25,25,60

	If [tick#m] < 5
		TaskValueSet,tick,m1,12
	Else
		TaskValueSet,tick,m1,[tick#m]/5
	Endif

	NeoPixel,[tick#m1],180,20,40
Endon	
Colors are not as easy to take a picture from. Seems that the SmartPhone- CAM have problems with that. But I hope you can see what I mean
Attachments
IMG_20230111_114715.jpg
IMG_20230111_114715.jpg (31.28 KiB) Viewed 4024 times
DLzG
Micha

User avatar
Ath
Normal user
Posts: 4007
Joined: 10 Jun 2018, 12:06
Location: NL

Re: NeoPixel (WS2812b) stability

#2 Post by Ath » 11 Jan 2023, 12:21

Besides checking the wiring (I assume you have that covered), you could install the neopixel 1M build (either Domoticz or FHEM/HA)
When using the NeoPixel (BusFX) plugin, there is a nfx,simpleclock,... command that can configure the pixels to behave like a clock, like you are trying to do from rules. That may work more stable.
/Ton (PayPal.me)

User avatar
M*I*B
Normal user
Posts: 379
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: NeoPixel (WS2812b) stability

#3 Post by M*I*B » 11 Jan 2023, 12:27

... the wiring is ok and short (10cm).
The hint with the special build I will check out right now... Thanx for that...
But just out of interest: What's the problem with that here? Just timing trouble while sending the commands to the stripe?
DLzG
Micha

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: NeoPixel (WS2812b) stability

#4 Post by TD-er » 11 Jan 2023, 12:57

How did you connect the data pin to the ESP?
Via a transistor, acting as a level converter?
If not, then it might be that the 3V3 level from the ESP isn't enough to trigger all LEDs.
Maybe also use a strong(er) pull resistor to make the level more clear and switching faster between levels.
After all, it is a relatively high frequency and also the data line may act as an antenna on a longer cable.

User avatar
M*I*B
Normal user
Posts: 379
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: NeoPixel (WS2812b) stability

#5 Post by M*I*B » 11 Jan 2023, 13:11

... jepp, I use a digital FET as levelshifter ... And yes, that creates many QRM on 2m/70cm and even more on shortwave!!!
Will be a good idea to insert some RF choke and shield the whole thing as good as possible...
Meanwhile I have flash the special build (FHEM). The NeoPixel Ring Clock module is made for 60 LED? And also it isn't possible to change the color of the ticks? Or am I wrong?
I will try the fx then... looks good for now to increase the WAF :lol:
DLzG
Micha

User avatar
Ath
Normal user
Posts: 4007
Joined: 10 Jun 2018, 12:06
Location: NL

Re: NeoPixel (WS2812b) stability

#6 Post by Ath » 11 Jan 2023, 13:59

The NeoPixel BusFX plugin can be set to any number of Pixels (up to 300, AFAIR), but as long as you have a multiple of 12 (or you could try with 4 :lol:) the clock should be working just fine
/Ton (PayPal.me)

User avatar
M*I*B
Normal user
Posts: 379
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: NeoPixel (WS2812b) stability

#7 Post by M*I*B » 11 Jan 2023, 14:33

... ok, with 4 LED I better use a4 Relays and 4 15kW Beams that my neighbors als have some fun at night :lol: :lol: :lol:

EDIT:
Ok, that's crazy... I have forget that the 07S have 4M instead of 1M and used the 1M 1st. After rewriting my little rule to NFX all goes well as expected...
Then while dinner I remember about the 4M 07S and flashed the NeoPixel mega 4M.
So now the same rule don't work anymore... see the last line here...

Code: Select all

359847: EVENT: Clock#Time=Wed,14:52
359889: ACT  : TaskValueSet,tick,h,14
359906: ACT  : TaskValueSet,tick,m,52
359916: ACT  : TaskValueSet,tick,h1,14-12
359933: ACT  : TaskValueSet,tick,m1,52/5
359939: ACT  : nfx,line,2,12,606000
359941: NeoPixelBusFX: Set 96/96/0
359947: ACT  : nfx,line,1,2,000080
359949: NeoPixelBusFX: Set 0/0/128
359955: ACT  : nfx,one,2,00A000
359957: NeoPixelBusFX: Set 0/160/0
359961: ACT  : Endon 
359962: Command unknown: Endon 
359962: Command unknown: Endon :o :? :?:

EDIT 2:

looks like that I have killed the 1st 07S while flashing to death :lol:
DLzG
Micha

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: NeoPixel (WS2812b) stability

#8 Post by TD-er » 11 Jan 2023, 15:34

Command unknown "endon" is probably just a syntax error.

And it is possible the 1M firmware was storing the WiFi config data at a different position on the flash.
So maybe you should flash a 'blank' image (containing only 0xFF) to it and flash the 4M build to it.

User avatar
M*I*B
Normal user
Posts: 379
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: NeoPixel (WS2812b) stability

#9 Post by M*I*B » 11 Jan 2023, 16:10

... nope ... the 07S is death ... not flashable anymore ... I take a new one; have enough of them 8-)
DLzG
Micha

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: NeoPixel (WS2812b) stability

#10 Post by TD-er » 11 Jan 2023, 16:38

Maybe static discharge at pins that don't like it?

User avatar
M*I*B
Normal user
Posts: 379
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: NeoPixel (WS2812b) stability

#11 Post by M*I*B » 11 Jan 2023, 16:41

... maybe .. or just to write to often so that the flash are broken ... But doesn't matter: Death is death :lol:

BTW:
that "Endon" don't work also like "If", "Elseif" or any other with the 1st letter capitalized. The former bin have no problems with it and also a colored gui with code completion, but not the NeoPixel image ... Here I have to rite all in lower-case
DLzG
Micha

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: NeoPixel (WS2812b) stability

#12 Post by TD-er » 11 Jan 2023, 17:13

huh? That's for sure a bug.
Will look into it.

User avatar
M*I*B
Normal user
Posts: 379
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: NeoPixel (WS2812b) stability

#13 Post by M*I*B » 11 Jan 2023, 17:16

... wait a moment. I have just download the ESP_Easy_mega_20230111_neopixel_ESP8266_4M1M Jan 11 2023 Let#s see if that present here also... Moment...

Ok, not in the last build/merge... Can also be that my broken 07S have create that. I can't say for sure and can't reproduce it anymore (already in the bin)
Last edited by M*I*B on 11 Jan 2023, 17:20, edited 1 time in total.
DLzG
Micha

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: NeoPixel (WS2812b) stability

#14 Post by TD-er » 11 Jan 2023, 17:19

Just tested with these impressively complex rules:

Code: Select all

On  Clock#Time=All,**:** Do
  LogEntry,'"Just testing...."'
Endon
And it seems to work just fine.

User avatar
M*I*B
Normal user
Posts: 379
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: NeoPixel (WS2812b) stability

#15 Post by M*I*B » 11 Jan 2023, 17:21

... you are to fast and don't know the word "wait" hu? :lol: :lol: :lol:
DLzG
Micha

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: NeoPixel (WS2812b) stability

#16 Post by TD-er » 11 Jan 2023, 18:23

M*I*B wrote: 11 Jan 2023, 17:21 ... you are to fast and don't know the word "wait" hu? :lol: :lol: :lol:
Sure I do, I now already waited 2 minutes to reply ;)

User avatar
Alex P
Normal user
Posts: 45
Joined: 20 Apr 2022, 05:27
Location: RU

Re: NeoPixel (WS2812b) stability

#17 Post by Alex P » 07 Nov 2024, 10:09

I use NeoPixel (7-Segment) and artifacts are constantly present. I use a level converter. I tried to turn on NeoPixel Matrix, NeoPixel Ring Clock, NeoPixel (Candle). Only on the last one (Candle) there are no artifacts.
Build: ESP_Easy_mega_20240919_neopixel_ESP32s2_4M316k_LittleFS_CDC_ETH Sep 19 2024
Image
Attachments
20241107_144621_001_1.gif
20241107_144621_001_1.gif (1.02 MiB) Viewed 1114 times

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: NeoPixel (WS2812b) stability

#18 Post by TD-er » 07 Nov 2024, 21:32

Where is the start of the string?

Can you also try the latest test build I posted here: https://td-er.nl/ESPEasy/latest/
This one has a more recent ESP-IDF version.

User avatar
Ath
Normal user
Posts: 4007
Joined: 10 Jun 2018, 12:06
Location: NL

Re: NeoPixel (WS2812b) stability

#19 Post by Ath » 07 Nov 2024, 21:43

Alex P wrote: 07 Nov 2024, 10:09 I use NeoPixel (7-Segment) and artifacts are constantly present. I use a level converter. I tried to turn on NeoPixel Matrix, NeoPixel Ring Clock, NeoPixel (Candle). Only on the last one (Candle) there are no artifacts.
Build: ESP_Easy_mega_20240919_neopixel_ESP32s2_4M316k_LittleFS_CDC_ETH Sep 19 2024
You are using an ESP32-S2 in your project, but that's the second worst choice for a Neopixel unit (maybe we should drop support for this build, the ESP32-C2 does not properly support the used RMT technology, so Neopixel support has been disabled).

Can you use another ESP32 to drive your display?
/Ton (PayPal.me)

User avatar
Alex P
Normal user
Posts: 45
Joined: 20 Apr 2022, 05:27
Location: RU

Re: NeoPixel (WS2812b) stability

#20 Post by Alex P » 08 Nov 2024, 05:17

TD-er wrote: 07 Nov 2024, 21:32 Where is the start of the string?

Can you also try the latest test build I posted here: https://td-er.nl/ESPEasy/latest/
This one has a more recent ESP-IDF version.
Installed Build: ESP_Easy_mega_20241025_neopixel_ESP32s2_4M316k_LittleFS_CDC_ETH Oct 25 2024
In terms of artifacts, there may have been a little less, but they remained. Are there any differences in the program for NeoPixel (Candle), why does it work stably?
What hardware works stably with NeoPixel?
Снимок.PNG
Снимок.PNG (47.82 KiB) Viewed 1084 times

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: NeoPixel (WS2812b) stability

#21 Post by TD-er » 08 Nov 2024, 08:48

I guess I need to connect the logic analyzer to it to see if this is a timing issue.

The reason I asked to test the later build is that there has been some changes to how USB serial is handled on ESP32-S2.

So you have ESPEasy console also enabled on the USB-CDC port?
You can disable the ESPEasy console for now to see if this makes a difference. (Tools->Advanced)

User avatar
Alex P
Normal user
Posts: 45
Joined: 20 Apr 2022, 05:27
Location: RU

Re: NeoPixel (WS2812b) stability

#22 Post by Alex P » 08 Nov 2024, 09:07

TD-er wrote: 08 Nov 2024, 08:48 I guess I need to connect the logic analyzer to it to see if this is a timing issue.

The reason I asked to test the later build is that there has been some changes to how USB serial is handled on ESP32-S2.

So you have ESPEasy console also enabled on the USB-CDC port?
You can disable the ESPEasy console for now to see if this makes a difference. (Tools->Advanced)
Disabling console the USB-CDC port did not affect the display.

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: NeoPixel (WS2812b) stability

#23 Post by TD-er » 08 Nov 2024, 09:12

OK, this does eliminate at least one option...

We may need to compare both the candle and the clock plugin to see what is the main difference in addressing the LEDs.
Maybe it is just a matter of not keeping silent long enough between 'frames' and the S2 for some reason taking longer than other ESP's to send out the data (just a hypothesis, no idea if it is the actual cause).

Can you easily exchange the S2 for another ESP, for example an ESP32-S3 or ESP32-classic?

User avatar
Alex P
Normal user
Posts: 45
Joined: 20 Apr 2022, 05:27
Location: RU

Re: NeoPixel (WS2812b) stability

#24 Post by Alex P » 08 Nov 2024, 10:30

TD-er wrote: 08 Nov 2024, 09:12 Can you easily exchange the S2 for another ESP, for example an ESP32-S3 or ESP32-classic?
Installed Build: ESP_Easy_mega_20241025_neopixel_ESP32_4M316k Oct 25 2024
Works stably.

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: NeoPixel (WS2812b) stability

#25 Post by TD-er » 08 Nov 2024, 10:44

OK, so it seems to be S2 specific.

As Ton also mentioned, the S2 is a bit strange compared to all other ESP32-variants.

I have to check the code for the RMT driver, but as far as I could remember, there have been some differences among ESP32-variants regarding the chunk size we can send at once via RMT (hardware layout differences) and I have tweaked those manually to get more stable results per platform. Maybe the one for the ESP32-S2 needs some extra tweaking.

With RMT you can define a signal pattern by defining a 32-bit value, with this layout:
- 15 bits counter
- 1 bit high/low state
- 15 bits counter
- 1 bit high/low state

The counter is in clock cycles, based on the clock you connect to the RMT driver. (e.g. 80 MHz clock)

However you can only define a limited amount of "bits" to send like this, which differs per ESP32-version.
One has a bank of 64 bytes, others have 48 bytes, respectively 16 "bits" or 12 "bits" to be sent.
Also the number of banks differ per platform and whether you can combine banks or not.
So there is some room for tweaking here.
When a bank is being sent, you can update the other bank.
But as you might imagine, this is quite timing critical.

Maybe using I2S is a better solution for large strings of addressable LEDs as you can assign DMA.
DMA doesn't work very well with RMT

User avatar
Alex P
Normal user
Posts: 45
Joined: 20 Apr 2022, 05:27
Location: RU

Re: NeoPixel (WS2812b) stability

#26 Post by Alex P » 08 Nov 2024, 11:07

TD-er wrote: 08 Nov 2024, 10:44

Maybe using I2S is a better solution for large strings of addressable LEDs as you can assign DMA.
DMA doesn't work very well with RMT
Perhaps you need to settle on a stable option that will work everywhere, or make a choice of option?

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: NeoPixel (WS2812b) stability

#27 Post by TD-er » 08 Nov 2024, 11:17

Well it will be a complete rewrite of the code if I might switch.
Anyway, we have to see why it is failing first before deciding on the options.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests