ws2812 control via GPIO

Post Reply
cookay
Posts: 17
Joined: Sun Jan 11, 2015 1:08 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

ws2812 control via GPIO

Post by cookay »

Hi - It is possible to control a ws2812 LED strip via GPIO on a raspberry Pi using: https://learn.adafruit.com/neopixels-on ... i/software

Would it be possible to control this same strip with the C1?

Cheers

zehnm
Posts: 20
Joined: Thu Dec 18, 2014 5:13 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by zehnm »

I can't directly answer your question in regards to WS2812 LED strips since I'm controlling LPD8806 LEDs with the C1's SPI in an ambilight setting with Hyperion.
So far it's working great and the setup was easier than expected :)
My understanding is that WS2812 expects (more) precise timing. That could be an issue with the current C1 SPI driver (see other threads about SPI).
So I think it's possible, but might require more work than other LED controller chips...
If you haven't gotten the WS2812 LED strip yet you can still consider getting something else if you don't want to experiment - but that's usually part of the fun with such projects ;)
Or if all fails: use an AVR with FastLED connected over USB or UART...

illiac4
Posts: 25
Joined: Tue Dec 23, 2014 2:11 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by illiac4 »

Waht pins are you using or. are you using arduino on C1? Did you compile Hyperion or did just precompiled bins from RPi worked? I eas trying to compile Hyperion but it has failed on C1.

zehnm
Posts: 20
Joined: Thu Dec 18, 2014 5:13 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by zehnm »

I'm using the SPI interface on C1: pin 19 (MOSI), 23 (Clock) and ground. A 3m strip runs successfully with 16MHz, a 7m strip with 8MHz (32 LED/m).
I compiled Hyperion on C1 without DISPMANX and X11 support since I'm using it only in server mode. Kodi runs on another machine. Give me a few days for detailed compile instructions since I'm moving my setup to an eMMC module.

User avatar
odroid
Site Admin
Posts: 41084
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 3194 times
Been thanked: 1753 times
Contact:

Re: ws2812 control via GPIO

Post by odroid »

I am also waiting for your instruction. :)

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 61 times
Contact:

Re: ws2812 control via GPIO

Post by memeka »

I still have to run mine too :d I'm using bob light instead of Hyperion

cookay
Posts: 17
Joined: Sun Jan 11, 2015 1:08 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by cookay »

zehnm wrote:I can't directly answer your question in regards to WS2812 LED strips since I'm controlling LPD8806 LEDs with the C1's SPI in an ambilight setting with Hyperion.
So far it's working great and the setup was easier than expected :)
My understanding is that WS2812 expects (more) precise timing. That could be an issue with the current C1 SPI driver (see other threads about SPI).
So I think it's possible, but might require more work than other LED controller chips...
If you haven't gotten the WS2812 LED strip yet you can still consider getting something else if you don't want to experiment - but that's usually part of the fun with such projects ;)
Or if all fails: use an AVR with FastLED connected over USB or UART...
I already have the WS2812 so I'll plod along trying to get this to work. It is all part of the fun!

Good to know you have it working as an ambilight, that's exactly what I'm trying to accomplish.

It looks like FastLed has ws281x support now so I'll try this later. Cheers!
zehnm wrote:I'm using the SPI interface on C1: pin 19 (MOSI), 23 (Clock) and ground. A 3m strip runs successfully with 16MHz, a 7m strip with 8MHz (32 LED/m).
I compiled Hyperion on C1 without DISPMANX and X11 support since I'm using it only in server mode. Kodi runs on another machine. Give me a few days for detailed compile instructions since I'm moving my setup to an eMMC module.
Looking forward to seeing the instructions!

zehnm
Posts: 20
Joined: Thu Dec 18, 2014 5:13 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by zehnm »

There seems to be some interest, so here's a quick write up on how to get Hyperion working on the C1.
I hope I didn't introduce any errors since I tried to simplify a few steps in this how to ;)

Environment and intended setup:
  • Ubuntu image v1.1
  • All commands are executed under the user 'odroid'
  • Hyperion shall run as a server process
  • Kodi and other Hyperion clients run on other machines
Prepare environment:

Code: Select all

# change to base directory where you want to check out the source
# decide yourself ;-) e.g. /usr/local, /development, /home/odroid/projects, ... 
mkdir ~/projects
cd ~/projects

# make sure we're up to date
sudo apt-get update

# install required libraries
# If you are not using the Ubuntu image you might also need: git cmake build-essential libusb-1.0-0-dev python-dev
sudo apt-get install libQt4-dev
Checkout and configure Hyperion:

Code: Select all

export HYPERION_DIR="hyperion"
git clone --recursive https://github.com/tvdzwan/hyperion.git "$HYPERION_DIR"
mkdir "$HYPERION_DIR/build"
cd "$HYPERION_DIR/build"
cmake -DENABLE_DISPMANX=OFF ..

# build it. Note: you can run it with -j 4 to use all CPU cores 
# but I prefer the initial build with one core for easier error resolving
make
Hyperion installation:

Code: Select all

# install Hyperion in /opt/hyperion
# run the following commands as root or as shown with sudo

sudo mkdir /opt
# use the default layout from the RPi binary setup
sudo tar -C /opt -xzf ../deploy/hyperion.tar.gz
sudo ln -fs /opt/hyperion/config/hyperion.config.json /etc/hyperion.config.json

# remove RPi binary files and place our compiled versions in /usr/bin
sudo rm /opt/hyperion/bin/*
sudo cp ./bin/hyperion-remote /usr/bin/
sudo cp ./bin/hyperiond /usr/bin/
Odroid SPI configuration:

Code: Select all

# now we could test the SPI device with manually loading the Odroid C1 SPI driver
#sudo modprobe spicc
#sudo modprobe spidev
# or just make it permanent: add the following modules in /etc/modules file
sudo echo 'spicc' >> /etc/modules
sudo echo 'spidev' >> /etc/modules

# change access rules of spi device, so that non-root users can use it
sudo echo 'KERNEL=="spidev*", GROUP="spiuser", MODE="0660"' > /etc/udev/rules.d/50-spi.rules
# add an spi user group
sudo groupadd spiuser
# and add the odroid user to the group
sudo gpasswd -a odroid spiuser

# time to reboot to load the driver and access rule
sudo reboot
Hyperion test run:

Code: Select all

# now edit your configuration matching your LED setup or copy it from the Hyperion configuration tool (HyperCon.jar)
# sudo nano /opt/hyperion/config/hyperion.config.json

# test run
# console 1
hyperiond /etc/hyperion.config.json 

# there should be no errors and the leds must light up for a brief moment (startup effect)

# console 2
hyperion-remote -e "Blue mood blobs"

# press Ctrl+C in both terminals to terminate hyperiond and hyperion-remote
Enable Hyperion as service

Code: Select all

sudo ln -fs /opt/hyperion/init.d/hyperion.init.sh /etc/init.d/hyperion
sudo chmod +x /etc/init.d/hyperion
sudo update-rc.d hyperion defaults 98 02

# manually start the hyperion daemon or just reboot
sudo service hyperion start
Todo:
  • Configure Hyperion daemon to run as restricted user. This should NOT run as root!
  • Testing and fine tuning LED configuration :)
Edit: removed libprotobuf7 from required libraries
Last edited by zehnm on Fri Jan 16, 2015 7:08 am, edited 1 time in total.

User avatar
odroid
Site Admin
Posts: 41084
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 3194 times
Been thanked: 1753 times
Contact:

Re: ws2812 control via GPIO

Post by odroid »

Very neat and comprehensive guide. Thanks!
I've added it in the list of compatible add-on. :)
http://forum.odroid.com/viewtopic.php?f ... 751#p65751

zehnm
Posts: 20
Joined: Thu Dec 18, 2014 5:13 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by zehnm »

@odroid: your're welcome, I hope it helps anyone getting it to work easily.
Please change WS2812 to LPD8806 in the compatible add-on list. I don't have WS2812 LEDs to test...

User avatar
odroid
Site Admin
Posts: 41084
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 3194 times
Been thanked: 1753 times
Contact:

Re: ws2812 control via GPIO

Post by odroid »

Done ;)

cookay
Posts: 17
Joined: Sun Jan 11, 2015 1:08 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by cookay »

I'll test that guide with the WS2812 tonight

cookay
Posts: 17
Joined: Sun Jan 11, 2015 1:08 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by cookay »

Not had much luck...

First hurdle:

Code: Select all

odroid@odroid:/usr/lib$ sudo apt-get install libQt4-dev libprotobuf7
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libprotobuf7
However libprotobuf8 seems to be there...

The rest of the install went pretty much ok but upon running the test:

Code: Select all

odroid@odroid:/usr/lib$ hyperiond /etc/hyperion.config.json 
hyperiond: error while loading shared libraries: libbcm_host.so: cannot open shared object file: No such file or directory

zehnm
Posts: 20
Joined: Thu Dec 18, 2014 5:13 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by zehnm »

libprotobuf7 is most likely not required, I've added it while writing the how-to since it was listed in the Hyperion wiki. Should have double checked it. Sorry my fault.

If I remember correctly the libbcm_host.so error is what you get while trying to run the pre-compiled RPi version. Are you sure you are calling the compiled version and ran cmake as described?
I'll retest the setup tomorrow if that doesn't help...

cookay
Posts: 17
Joined: Sun Jan 11, 2015 1:08 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by cookay »

Thanks for your help zehnm.

I didn't copy over the compiled files correctly... :oops:

So I'm getting close! But still no cigar.

Code: Select all

hyperiond /etc/hyperion.config.json 
Application build time: Jan 16 2015 18:49:04
QCoreApplication initialised
Selected configuration file: /etc/hyperion.config.json
ColorTransform 'default' => [0; 49]
Device configuration: 
{
	"colorOrder" : "rgb",
	"name" : "MyPi",
	"output" : "/dev/spidev0.0",
	"rate" : 250000,
	"type" : "ws2812b"
}

Unable to create device ws2812b
Black border threshold set to 0.01 (3)
Not creating any smoothing
Effect loaded: Knight rider
Effect loaded: Blue mood blobs
Effect loaded: Cold mood blobs
Effect loaded: Full color mood blobs
Effect loaded: Green mood blobs
Effect loaded: Red mood blobs
Effect loaded: Warm mood blobs
Effect loaded: Rainbow mood
Effect loaded: Rainbow swirl fast
Effect loaded: Rainbow swirl
Effect loaded: Snake
Effect loaded: Strobe blue
Effect loaded: Strobe Raspbmc
Effect loaded: Strobe white
Initializing Python interpreter
Segmentation fault
It seems the ws2812b is disabled in the compiled version here. I have tried to run 'cmake -DENABLE_WS2812BPWM=ON .. ' after reading on this thread https://github.com/tvdzwan/hyperion/issues/6

But still no luck...

any ideas?

btw I'm still fairly a noob so really appreciate all of your help!

zehnm
Posts: 20
Joined: Thu Dec 18, 2014 5:13 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by zehnm »

I can check over the weekend if I see something in the source or docs on how to use them.
How exactly did you connect the WS2812B strip to your C1?
Are you trying to use the PWM method?
With some luck it's only a configuration issue or missing PWM driver. I haven't used PWM yet on the C1 but saw something about a new driver in this forum...

cookay
Posts: 17
Joined: Sun Jan 11, 2015 1:08 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by cookay »

I've got a bit further now.

I started again from a fresh install.

This time I ran

Code: Select all

cmake -DENABLE_WS2812BPWM=ON .. 
cmake -DENABLE_DISPMANX=OFF ..
sudo make
Rest of the setup went fine.

Now from running the test I get:

Code: Select all

sudo hyperiond /etc/hyperion.config.json 
Application build time: Jan 16 2015 22:40:57
QCoreApplication initialised
Selected configuration file: /etc/hyperion.config.json
ColorTransform 'default' => [0; 49]
Device configuration: 
{
	"colorOrder" : "rgb",
	"name" : "MyPi",
	"output" : "/dev/spidev0.0",
	"rate" : 250000,
	"type" : "ws2812b"
}

Page map: 1 pages
WS2812b init finished 
Black border threshold set to 0.01 (3)
Not creating any smoothing
Effect loaded: Knight rider
Effect loaded: Blue mood blobs
Effect loaded: Cold mood blobs
Effect loaded: Full color mood blobs
Effect loaded: Green mood blobs
Effect loaded: Red mood blobs
But no LEDs...

I've got the WS2812B hooked up to a seperate 5v supply, then ground to pin 6 and DN to Pin 19.

Not sure what is going wrong. Maybe the 'rate' is wrong?

cookay
Posts: 17
Joined: Sun Jan 11, 2015 1:08 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by cookay »

Tested the strip with my Pi. Works perfectly with the DN connected to pin 12.

zehnm
Posts: 20
Joined: Thu Dec 18, 2014 5:13 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by zehnm »

Bad news. I glanced over the Hyperion WS2812b source code and it's not using the PWM device driver but memory mapped register access.
This is low level access to the RPi hardware.
It seems to be possible to use the same method with the C1: http://forum.odroid.com/viewtopic.php?f ... 565#p66629
But this is different hardware and I'd be surprised if it's compatible.
So, someone with the skills and enough knowledge would have to write a C1 Hyperion driver...
Your best bet at the moment with the C1 is to combine it with an Arduino and Fastled.

cookay
Posts: 17
Joined: Sun Jan 11, 2015 1:08 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by cookay »

Ah that sucks :(

Thanks for looking it up dude.

I don't know if this helps at all.... but i can get the C1 to turn on the 1st LED by running this command:

hyperiond /etc/hyperion.config.json > /dev/spidev0.0

cookay
Posts: 17
Joined: Sun Jan 11, 2015 1:08 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by cookay »

So... I could possibly drive the WS2812 from my Raspberry Pi and run Kodi from the C1?

zehnm
Posts: 20
Joined: Thu Dec 18, 2014 5:13 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by zehnm »

This should work, I'm running Openelec on a MacMini and use the C1 with Hyperion to drive my LEDs.
You need the Hyperion XBMC-addon. As long as this addon is able to capture the screen on the C1 it will work :)

cookay
Posts: 17
Joined: Sun Jan 11, 2015 1:08 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by cookay »

Awesome. I'll probably set it up like that for now then. And hope someday that somebody builds a ws2812 driver for the C1.

I have quite a few friends who also want this setting up for them so the sooner the driver comes out more C1 orders will be coming in!

Thanks for your help Zehnm!

rafflesia
Posts: 7
Joined: Mon Jan 19, 2015 11:25 pm
languages_spoken: english, german
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by rafflesia »

Hello all,

I use WS2801 LED-Strips for "ambilight"-like TV-Background. My 100 LEDs are driven by a raspberry pi with boblight as controlling software.

There I tried to use the same setup with the C1. Compilation and installation of boblight was straight forward. For testing purposes I used boblight-X11. All LEDs where brighten up according to the desktop-background. Also the blue backgound of kodi worked.

BUT all LEDs where flickering a lot. So at this stage not usable. But as I just used my config-file from the raspberry I will try to alter the settings in the next days. Maybe this will help. But currently it looks like the SPI bus is not synced/clocked like the Pi one. Will investigate. Maybe a problem with wiring...

One problem I faced was out of my scope. Maybe someone here have an idea.
I started a video in kodi and all lights went black. So boblight-X11 could not "copy" the video from the media-player to analyze the screen. Also the kodi build-in boblight plug-in didn´t work. - I know that for the raspi things needed to be adjusted (in the firmware or omxplayer?) to capture the video and supply it to boblight. Is something like this also needed for the C1?

Best regards
Chris

karlkloss
Posts: 141
Joined: Tue Jan 13, 2015 9:34 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by karlkloss »

The WS2812 chip is very delicate.
It uses a 1-wire interface that interprets a short pulse as 0, a long pulse as 1 and a very long pulse as reset.
Not only is this timing difficult to meet by bit banging I/O ports using a non-realtime OS, but to make things worse, there are several clones of the WS2812 on the market, with different timings.
The cheapest and most stable solution is to spit out the data over a serial port, and use a separate microcontroller to do the timing.
This can be an Arduino(-Mini), a Teensy, or a STM32.
For all of the above mentioned micros, working code exists.

Arduino Pro Mini clones can be ordered from China at < $2, so I wouldn't bother implementing the protocol on the C1.
It will most likely not run without flickering, anyways, unless you dedicate one core to this exclusively, and run bare metal code on it.

WS2811 chips are a completely different kettle of fish, as they use SPI, and therefore don't depend on a precise timing.

WS2812 protocol has been implemented using hardware SPI on some microcontrollers, but it needs SPI controllers with very special options, that most of them don't provide. I doubt that the C1's SPI does, but this is impossible to tell without a detailed datasheet.

From looking at the code, it seems that Hyperion's WS2812 driver uses the PWM generator together with the DMA, to generate pulses with the right timing.
It may well be that such a trick is also possible with the C1, but I wouldn't hold my breath.

cookay
Posts: 17
Joined: Sun Jan 11, 2015 1:08 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by cookay »

In the end I setup the WS2812b on my Pi... It's a shame because I wanted to use the C1 as my Media Centre and my LED controller. The Pi is able to drive the LEDs and I could still use the C1 as my media centre then send the hyperion data to the Pi, but I want an all in one solution. Having the Pi and the C1 behind my TV is overkill...

The C1 will be used as an Owncloud server until the WS2812b becomes supported. If there is anything I can do to help drive the support for the WS2812b please let me know. I'm willing to do the testing etc..

User avatar
Matt
Posts: 575
Joined: Tue Feb 26, 2013 4:57 pm
languages_spoken: English
ODROIDs: X2, U2, XU+E rev.2, Smart Power
Location: Charlottesville, VA, USA
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by Matt »

If I were going to use a Pi or C1 (or any other board runing a non-realtime OS), I would go with an APA102 LED strip. Adafruit calls their WS2812 LEDs "Neopixels" and they call the APA102 LEDs "Dotstars". The way I understand it, the Dotstar LEDs use a standard implementation of the SPI protocol, so they will work with any microcontroller or microprocessor that has an SPI bus without having to worry about any timing issues. The only disadvantage would be the need for one more pin on the MCU/MPU than is needed by the Neopixel LEDs.
ODROID Boards: U2, X2, XU+E rev.2
Accessories: VU, Smart Power, 13" LCD Kit (for the X2)

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 61 times
Contact:

Re: ws2812 control via GPIO

Post by memeka »

i am using WS2801 on my odroid XU.
http://www.adafruit.com/products/322

randymgn
Posts: 1
Joined: Wed May 20, 2015 1:45 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by randymgn »

I have chosen APA102 LED for my experiments with music lights and I am a bit confused about all available strip and library options.
My planned system is Raspberry Pi B+, APA102 strip with 60 LEDs and, to be safe, some level shifter.

peel
Posts: 1
Joined: Sun Apr 03, 2016 6:06 pm
languages_spoken: english
ODROIDs: A few C2s
Has thanked: 0
Been thanked: 0
Contact:

Re: ws2812 control via GPIO

Post by peel »

Hi,
I've been looking into using https://github.com/jgarff/rpi_ws281x and failed miserably while trying to fiddle around with the code. I tried to fall back to running as RPi2, yet faced the issue of lacking RPI's VideoCore (/dev/vcio; as it sports Mali - /dev/mali) and the /dev/mailbox failed to be read (whereas creation worked fine).

Also as I finally managed to compile on AArm64 by setting CFLAGS=-w, running ./test yeilds no results and exits momentarily, whereas running the python examples results in

Code: Select all

[root@hell4 python]# python2 examples/strandtest.py
Traceback (most recent call last):
  File "examples/strandtest.py", line 8, in <module>
    from neopixel import *
  File "build/bdist.linux-aarch64/egg/neopixel.py", line 50, in <module>
  File "build/bdist.linux-aarch64/egg/neopixel.py", line 52, in Adafruit_NeoPixel
AttributeError: 'module' object has no attribute 'WS2811_STRIP_RGB'
Also simply replacing /dev/vcio to /dev/mali ends up with

Code: Select all

ioctl_set_msg failed, errno 25: Inappropriate ioctl for device
Any ideas how can I follow with that?

My setup:

Code: Select all

Processor   : AArch64 Processor rev 4 (aarch64)
processor   : 0
processor   : 1
processor   : 2
processor   : 3
Features    : fp asimd crc32
CPU implementer : 0x41
CPU architecture: AArch64
CPU variant : 0x0
CPU part    : 0xd03
CPU revision    : 4

Hardware    : ODROID-C2
Revision    : 020b
And

Code: Select all

[root@hell4 python]# uname -r
3.14.29-16-ARCH

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 61 times
Contact:

Re: ws2812 control via GPIO

Post by memeka »

peel - you have the same chances of making that rpi-only code working for odroids as you have for a windows pc.
/dev/mailbox is a rpi invention, does not exist anywhere else

aleksas
Posts: 13
Joined: Sat Jan 21, 2023 5:48 am
languages_spoken: english
ODROIDs: C2,C4, N2+
Has thanked: 0
Been thanked: 1 time
Contact:

Re: ws2812 control via GPIO

Post by aleksas »

Sorry for resurrecting old topic. There is a repo for controlling WS2812B LEDS over SPI MOSI pin by modulating necessary signal timings via data transfer command. It compiles on Odroid C4 without modifications, but aparently SPI signal differes for same parameters so after playing a bit with SPI speed and one/zero signal masks made a working driver. Here is a pull request: https://github.com/hepingood/ws2812b/pull/24

User avatar
odroid
Site Admin
Posts: 41084
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 3194 times
Been thanked: 1753 times
Contact:

Re: ws2812 control via GPIO

Post by odroid »

aleksas wrote:
Fri Apr 28, 2023 9:02 pm
Sorry for resurrecting old topic. There is a repo for controlling WS2812B LEDS over SPI MOSI pin by modulating necessary signal timings via data transfer command. It compiles on Odroid C4 without modifications, but aparently SPI signal differes for same parameters so after playing a bit with SPI speed and one/zero signal masks made a working driver. Here is a pull request: https://github.com/hepingood/ws2812b/pull/24
Seven years old thread. :o

Anyway, thank you for sharing a good news.
Can I ask you the kernel version you run on the C4 board now?

aleksas
Posts: 13
Joined: Sat Jan 21, 2023 5:48 am
languages_spoken: english
ODROIDs: C2,C4, N2+
Has thanked: 0
Been thanked: 1 time
Contact:

Re: ws2812 control via GPIO

Post by aleksas »

Sure.

$ uname -r
4.9.337-11

User avatar
odroid
Site Admin
Posts: 41084
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 3194 times
Been thanked: 1753 times
Contact:

Re: ws2812 control via GPIO

Post by odroid »

Thank you for the confirmation.

Post Reply

Return to “Issues”

Who is online

Users browsing this forum: No registered users and 2 guests