bk1285 / rpi_wordclock

Software to create a Raspberry Pi based wordclock
GNU General Public License v3.0
214 stars 107 forks source link

Problems using raspberry zero w - distortet output #102

Closed atec111 closed 3 years ago

atec111 commented 5 years ago

Hi all,

I've come to this project from microcontroller.net version of a wordclock with usage of STM32F103C8T6 and ESP. I've built my watch after there tutorial and it worked for some time, but always after a while it just hangs (not that smart for a smartlike clock ;-)). I assume the problem was the ESP and my Wifi. But never found out.

I was very happy hearing of this project, because i like raspberries a lot more than arduinos or ESPs. But unfortunately it did not work out of the box for me :-(

Symptom: Application starts without errors. But Time as Words is lighted in different colors the same time, and not at the right place or amount (tried both wirings in the config). Other Plugins are also not working correctly. The best result comes with "rainbow" - it shows a correct horizontal Rainbow, but with decent flickering with wrong colors from time to time (more in the upper half, than in bottom). But the good thing - it seems all LEDs can blink =)

What I did: Almost everything what needs to be done on an brandnew from the scratch zero W. I've also done everything from Troubleshooting (using level shifter, same ground) and from closed threads (autostart in cron and no hello message).

My Wiring (as in Mikrocontroller.net): 651px-leds-datakabel

A Good shot from the Rainbow: 20181104_142155

And one from Time as Words (german) (should show 15:20 Uhr): 20181104_142119

I've just an 5V/4A Power Fuse, could that be the Problem? Or do I need something between level shifter and data-IN from WS2812?

Regards

FrankX0 commented 5 years ago

These symptoms suggest a noise problem, normally associated with not using a level shifter and/or a noise power-supply. As you already are using a level shifter this leaves the power supply. For my clock I initially used a cheap Chinese power supply, which caused similar problems and even destroyed the first LED of the clock due to excessive noise. Can you try to power your clock with a (5V) power-bank: if this works correctly you need to search for a new (maybe lower power rating) power supply. I use a 3A type. A lower power rating will also be less noisy.

Hope this helps.

For what it's worth: I am using this one: http://www.aliexpress.com/item/1pcs-lot-5V-3A-for-EU-Stander-5-5mm-2-1mm-Power-Adapter-AC-DC-Converter/32840979615.html?spm=a2g0s.9042311.0.0.1ec64c4dr6a1WT

bk1285 commented 5 years ago

Hi @atec111

I suspect at least two issues

Best, Bernd

atec111 commented 5 years ago

Hi all,

Thanks Bernd, your Wiring-Layout helped a lot. The correct words/letters are lit now. But additionally I assume that my power supply is not the perfect one. I was testing the clock when it was attached to a "power-cube" (multiple power plugs), and it seems, that some other device caused the worst of the distortions - when I attached it back to it's target destination (a single power-plug), the flickering/ghosting was mostly gone.

Now also the animations like sunrise work, despite some little misslighting of some letters from time to time.

I think it is necessary to change the power supply as the next step. Are there any recommendations? (Clock is mounted approximately 1,8m above a power-plug - I think it would be perfect if it has already the correct lenght, to prevent failures due to extensions or addtional plugs in between)

Regards, Andre

atec111 commented 5 years ago

Update: I've soldered an Micro-USB-Female Port to my Circuit and tryed a Power Bank (Anker, 5V/2A). Result: It was worse than my prior 5V/4A Power Supply. More flickering in Rainbow, more wrong lit lights in "the time". I've even tried a strong Micro-USB Power-Supply (Anker, with 5V/2.4A per Port). Result: Even more worse than the Power Bank. In Rainbow there was almost no correct picture and it was flickering so slow, that it was kind of wandering of single pixels - was looking kind of space invaders :-)

I've put my old Power-Supply back to the Clock. I've read in the web, that some guys powering a WS2812 could obeserve that the flickering would minimize, when using full brightness. I also tested this - with very good results. With brightness be less than 100 = Not usable. With brightness at max (255) very very few flickers in rainbow, and they getting even fewer with the time the clock is powered.

So far so good. Clock is usable, but full brightness is not the best solution. Anyone any Idea what could be done to solve and getting the same result in better way? I've read on the web, that using a Capacitor (bigger=better) on Data-Pin could/should help... Others say a 1K Resistor should. But there is never a really plausible electrical statement why that should help...

Regards, Andre

FrankX0 commented 5 years ago

Hi Andre,

As the power supply seems to be sufficient, I would guess it is due to the wiring. Can you share in detail how you have wired your clock, starting from the power source?

When you set the clock to a stable (non changing) display, do you the also see the flickering? Or do yo only see flickering when the contents changes (like the rainbow)? Can you disconnect the data line after a LED patterns is set? And then check for flickering? @bk1285: do you only send new data when required (so in case of the clock only every minute)?

For your information: I am running my application also with a zero W without any flickering.

atec111 commented 5 years ago

Hi Frank,

here is my wiring. (Cables for Data and Power to WS2812 are small Litze cable - I suppose 0,25mm². They worked with Micro-Net Setup) wiring

With my last tests, I think the Flickering in Rainbow was missleading. I think it is not Flickering, it is just misslighting. In Rainbow that seems to be flickering, because of continuous sending new frames.

On a non changing display, like the time, it is stable - but sometimes a littlebit wrong (on brightness 255, with less, it's more frequently wrong). For instance: Normally all Letters are kind of white. In case of misslighting, mostly the first letter is kind of green, rest is kind of turquoise, and an additonal letter behind the correct word is lit in dark blue. The Funny thing, that is then for all words. And sometimes additonally a minute is not lit or lit in violet. In Worst case, some words are missing to.

(Disconnecting Data): Data is soldered, so this test would be not so easy, but i think it is not necessary. When i Shut down with the Plugin, the poweroff Symbol stays lit.

So I assume in some cases the frames or better signals to WS2812 are not sharp enough, so that they will be missinterpreted. But why only sometimes, and why less frequently with full brightness......

Could the cable be to light? Is it possible, that there is a loose contact (but Clock is hanging, no movement at all)?

HeerNMeester commented 5 years ago

I had similar problems after a power outage. At first I suspected the Power supply as well (Cheap Chinese 5V10A) but replacing that did not solve the problem. I did not use a level shifter before but got the same results after installing one. In the end I replaced my RPi Zero V1.3 for a RPi Zero W. That solved the problem. My conclusion: the Pi died during the power outage or at least something on the GPIO.

FrankX0 commented 5 years ago

My guess would be that the dataline from the Pi to the level shifter and/or from the level shifter to the first LED is being disturbed. Either by external noise or by distortion due to return currents. If not done already, can you run a 0V connection close to the dataline from the Pi I/O connector to the 0V of the level shifter and from the level shifter to the 0V of the first LED?

In addition: good practise is to reference the 0V and 5V directly to the I/O connector of the Pi. So I would advise to power the level shifter from the I/O connector, where also the dataline is coming from.

bk1285 commented 5 years ago

@bk1285: do you only send new data when required (so in case of the clock only every minute)?

Yes, only once per minute.

FrankX0 commented 5 years ago

@atec111 did you succeed resolving your issue?

phenze commented 5 years ago

Hey guys,

i had this issue several times in the last two years since i built my clock. The Clock is working and sometimes colors are very strange and flickering around. Then after a while everything is normal again. Then again flickering.

I do not use a level shifter. As a power supply i use 5V/10A.

In my case it was everytime a broken led in the stripe or wrong connections between the stripes. I think i have a very bad stripe. I don't know but a broken LED could lead to a wrong data signal ? Couldn't it ? I'm not a hardware specialist. That also explains why the rainbow plugin is working best. There the data is sent very very often so that a wrong signal produced by a broken LED will not have that much effect.

But in Bernds wordclock software the signal is only sent every minute.

My solution was the following :

Did you try the strandtest example ? In my case i have modified it a bit that only the color wipe(turning ON each led individually ) is done. When running the example i can see exactly which LED has the error.

After that i cut the strip and replaced the broken LED. Then everything is running well again.

A modified strandtest example i have uploaded here: https://github.com/bk1285/rpi_wordclock/issues/106

Tetrikus commented 5 years ago

Same for me, when I've built my own Wordclock. I do use capacitors and LevelShifter, but whenever I have these issues, it's one of the following:

atec111 commented 5 years ago

I assume the same for my clock. But I think it is more a loose contact somewhere on data-wire. But unfortunately I hadn't enough time for detailed analysis until now. I hope xmas holidays will give me some ;-) I'll keep you updated.

bk1285 commented 3 years ago

Reopen, if still unresolved.