WS2801 and Beaglebone

Hello guys !

I’m looking for a way to use a strip of 50 WS2801 leds with my beaglebone black. All the documents I’ve found are related to Arduino or Raspberry so I have some issues to know the path I should follow.

I have this driver : http://elinux.org/BeaconBoard so currently I’m trying to rebuild an Angstrom kernel with this.

If anyone has already done it or have any advice I’m eager to hear it !

Thanks !

http://forum.beaglefu.com/topic/80-beaglebone-black-drive-a-ws2811-led-strip-with-spi/#entry217

Thanks !! I’ll try to adapt this to ws2801.

They should use the same communication “protocol” right ? Just SPI, but yeah I have no hands on there, but I’ve known the person who made that post for a while, so the information presented will be good.

I guess ! Maybe the timing is different, I’ll have to check the spreadsheet for that

I’ve just managed to make it work so I will give some feedback for those who would like to do the same.

Enjoy ! If it helped you, just let me know ; )

Thanks for the detailed instructions. It’s working for me with very little effort. In fact, if your are running the latest Debian image [1] the setup is even easier. py-spidev is already installed and you don’t have to disable the HDMI, rather you just disable a PWM.

  • beagle$ cat /sys/devices/bone_capemgr.*/slots
    0: 54:PF—
    1: 55:PF—
    2: 56:PF—
    3: 57:PF—
    4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
    5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
    7: ff:P-O-L Override Board Name,00A0,Override Manuf,bspm_P9_42_27
    8: ff:P-O-L Override Board Name,00A0,Override Manuf,bspm_P9_41_27
    9: ff:P-O-L Override Board Name,00A0,Override Manuf,am33xx_pwm
    10: ff:P-O-L Override Board Name,00A0,Override Manuf,bspwm_P9_21_b

  • Slot 10 is the PWM, so disable it with: beagle$ echo -10 > /sys/devices/bone_capemgr.*/slots

  • beagle$ cat /sys/devices/bone_capemgr.*/slots
    0: 54:PF—
    1: 55:PF—
    2: 56:PF—
    3: 57:PF—
    4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
    5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
    7: ff:P-O-L Override Board Name,00A0,Override Manuf,bspm_P9_42_27
    8: ff:P-O-L Override Board Name,00A0,Override Manuf,bspm_P9_41_27
    9: ff:P-O-L Override Board Name,00A0,Override Manuf,am33xx_pwm

  • It’s gone, next enable SPI 0, beagle$ echo BB-SPIDEV0 > /sys/devices/bone_capemgr.*/slots

0: 54:PF—
1: 55:PF—
2: 56:PF—
3: 57:PF—
4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
7: ff:P-O-L Override Board Name,00A0,Override Manuf,bspm_P9_42_27
8: ff:P-O-L Override Board Name,00A0,Override Manuf,bspm_P9_41_27
9: ff:P-O-L Override Board Name,00A0,Override Manuf,am33xx_pwm
11: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-SPIDEV0

  • SPI is ready to go. py-spidev is already installed, so back to the original instructions, except, we are running a different SPI, so some adjustments are needed
  • In this repository : https://github.com/hackerspaceshop/RaspberryPI_WS2801_Bridge/tree/master/software. Download the LedStrip_WS2801.py file to your BB. Edit LedStrip_WS2801.py and change self.spi.open(0, 1) to self.spi.open(1, 1) since we are using a different SPI device. You can use the demo.py to have an idea of what you can do with the library.
  • HW time : make sure your led strand is correctly powered (http://learn.adafruit.com/adalight-diy-ambient-tv-lighting/wiring-1 if you need help). Wire the led strand input to your BB : GND goes to pin 1 of P9, CO to pin 22 of P9, DO to pin 18 of P9.
  • Finally run python demo.py
    I powered the string off of a 5V supply and controlled it with the bone at 3.3V. This worked fine for about 90 LEDs, after that the colors weren’t right. I’m going to try a level converter to see if I can control a string of 240 LEDs.

–Mark

[1] BeagleBoard.org - latest-images