How to control WS281x RGB LED strip?
-
@luz thanx for support.
New video: youtube.com/watch?v=5GpZlGmnKGs.
I send string many times:
echo -en '\x10\x00\x00\x10\x00\x00\x10\x00\x00' >/dev/ledchain0
And here is chaotic colors.
But!
Sometimes led strip work properly.cat /dev/ledchain0: Ready Last update: 0 repeats, last timeout=0 nS, max irq=10575 nS Totals: updates=87, overruns=0, retries=0, errors=0, irqs=286
Strip power:
From laboratory power supply +5V to +5V strip and to AMS1117_3.3. GND to Omega and to GND strip.
Data wire frompwm0 (G18)
topin 2
74AHCT1G125.
74AHCT1G125:1 and 3 pin
toGND
,5 pin
to+5V
,4 pin
to strip WS2813pin DI
.
Three LEDS don't need in fat wires.
-
@luz
in your schematicsLEDCHAIN_DATA_3V
connect toG46/UA_RX1
.
I connecting topwm0 (G18)
.
Does it matter?
-
@luz Thanx! WS2813 and WS2818 work!
https://www.youtube.com/watch?v=rqpyM6vhPLA
-
@Alexandr-Didenko nice device! I assume your I/O are i2c or SPI based? If so, your hardware could run as a digitalSTROM gateway, just by running my vdcd on it. Any plans to open source your device? Or produce and sell it?
BTW: how did you get the WS281x to work, finally?
-
@Alexandr-Didenko nice device! I assume your I/O are i2c or SPI based? If so, your hardware could run as a digitalSTROM gateway, just by running my vdcd on it. Any plans to open source your device? Or produce and sell it?
-
@luz I/O - MCP23017 - i2c. My plans - to sell it.
I don't know what I do, that WS281x to work
Honestly!
It suddenly began to work.
I thing that oscilloscope give interference.
-
@Alexandr-Didenko said in How to control WS281x RGB LED strip?:
@luz I/O - MCP23017 - i2c. My plans - to sell it.
Let me know when it becomes available
I don't know what I do, that WS281x to work
Honestly!
It suddenly began to work.I think that oscilloscope give interference.
Could be, depending on the probe. Anyway, I'm glad you have it working now!
-
@luz!!!
In your schematics I seev-net
on the Omega.
What is this?
And how workETHLED_AMPEN (PWM/G18)
?
I connect to G18 (PMW0)LEDCHAIN_DATA_3V
.
Why you connectLEDCHAIN_DATA_3V
toG46/UA_RX1
?
G45
andG46
(UART1) doesn't havePWM
-
Hi @Alexandr-Didenko !!!!!
-
V-NET
is not connected on the Omega2. It is here for compatibility with the Omega1 which had different ethernet PHY logic that needed a bias voltage on the center taps of the ethernet transformers. I started with Pixelboard before the Omega2 came out... -
ETHLED_AMPEN
is just a GPIO I'm using for switching the audio on and off in the Pixelboard as it is now, but I had variants w/o audio so I also connected it to the ethernet jack's LED. The idea was to have it show ethernet activity using theledtrig-netdev
LED kernel module. I tried once briefly, but it didn't work right away. -
PWM on
G46
: the pin mux in the MT7688 has several options of exposing the PWM outputs, not just GPIO 18 and 19. A while back I posted a annotated pinout of the Omega2 (and 2S) with all possible pin functions labelled - that helped me a lot to design Omega2(S) circuits.
You can switch theuart1
group topwm01
withomega2-ctrl
to get PWM1 onG46
.
-
-
@luz said in How to control WS281x RGB LED strip?:
You can switch the uart1 group to pwm01 with omega2-ctrl to get PWM1 on G46.
How? On the Omega2S+
omega2-ctrl gpiomux get
say that uart1 doesn't have pwm options.root@Omega-6E01:~# omega2-ctrl gpiomux get Group i2c - [i2c] gpio Group uart0 - [uart] gpio Group uart1 - [uart] gpio Group uart2 - [uart] gpio pwm Group pwm0 - [pwm] gpio Group pwm1 - pwm [gpio] Group refclk - refclk [gpio] Group spi_s - spi_s [gpio] Group spi_cs1 - [spi_cs1] gpio refclk Group i2s - i2s [gpio] pcm Group ephy - [ephy] gpio Group wled - wled [gpio]
-
Hi @Alexandr-Didenko, are you sure you have the latest omega2-ctrl? Your screendump looks like a version prior to April 2017, when @Lazar-Demin merged my patch fixing exactly those missing modes for the uart groups.
Judging from the makefile in the Onion OpenWrt feed, any build of omega2-ctrl done since April 2017 would have pulled from the omega2-ctrl
HEAD
and thus included the patch.However, it seems that @onion might have forgotten to bump the package version back then, and if they never rebuilt the FW from scratch since, it might be that even recent FW builds still contain the pre-April 2017 version
Maybe just try to force-update it via opkg:
opkg update opkg --force-reinstall omega2-ctrl
The April 2017 version will show:
root@Omega-WXYZ:~# omega2-ctrl gpiomux get Group i2c - [i2c] gpio Group uart0 - [uart] gpio Group uart1 - uart [gpio] pwm01 Group uart2 - uart [gpio] pwm23 Group pwm0 - pwm [gpio] Group pwm1 - pwm [gpio] Group refclk - refclk [gpio] Group spi_s - spi_s [gpio] pwm01_uart2 Group spi_cs1 - [spi_cs1] gpio refclk Group i2s - i2s [gpio] pcm Group ephy - [ephy] gpio Group wled - wled [gpio]
-
@luz Good catch! We, in fact, did not up the version number of
omega2-ctrl
I've upped it now and a v0.2 will be available when we release the next fw build
-
Dear @luz
I found the bug.-
- If disconnect WS2813 from omega2 pin and connect again - then WS2813 behaves wrong.
If remove the power and then power on - then work as it should.
- If disconnect WS2813 from omega2 pin and connect again - then WS2813 behaves wrong.
-
- First pixel sometimes shifting. For strip consisting of 10 LEDs - in programm we must write 11 LEDs
I thought it was a problem on my side. But no. It in Omega or yours side.
However! Thanx for your job! You are the only one who did it! Low bow!
Unfortunately, I do not know how to solve it so that it is stable and accurate.
-
-
@Alexandr-Didenko said in How to control WS281x RGB LED strip?:
-
- If disconnect WS2813 from omega2 pin and connect again - then WS2813 behaves wrong.
Note that WS2813
DIN
pins are quite delicate, and very easy to destroy or at least get a latch-up.- Never send a data signal to a WS2813 which is not powered with 5V properly.
- if the cable is longer than a few inches, use a shielded cable for the data.
- maybe use a serial resistor in the data line to dampen spikes a bit - you have quite heavy undershoots on your scope diagrams you posted earlier in this thread.
-
- First pixel sometimes shifting. For strip consisting of 10 LEDs - in programm we must write 11 LEDs
Sounds like a damaged first LED to me.
I thought it was a problem on my side. But no. It in Omega or yours side.
I'd be surprised.
Because in the meantime, I have used the exact same circuitry for a large installation with 20 Omega2 each driving 518 WS2813, and all of them ran 100% stable severals days uninterrupted. One of these panels still is in my office and I use it to test new stuff every day, and it runs practically 24/7.
Only one caveat: if you have software installed that makes use of the other hardware PWM unit's interrupt, please make sure to use the latest p44-ledchain (OpenWrt 18.06 build here), because there was a bug in handling the PWM interrupts.
-