Using this addressable LED strip:
- WS2801 Led Full Color character string matrix screen point source 12mm 5V
- WS2801 IC Chip, Addressable Color, need for controller.
- Identify IC every led light,
- Red- Positive White- DAT, Green-CLK, Blue- GND
- The note glue craft processing, waterproof
- Lamp to Lamp around 3cm-5cm
- Max current: 0.02A
- Max power: 0.3w
- Size: 12mm
- Working voltage: DC 5V
I am trying to control it using my raspberry pi (running raspbian). Many sites point out that Wheezy does not have hardware SPI installed and I have to do a firmware update, install the beta Wheezy, or install Occidentalis. I don't want to do any of that, and besides I am fairly certain that I have SPI installed for the following reasons:
- I managed to download a program and run it which would turn all the lights on. However, this would crash my raspi and I had to physically unplug it. Also, I can no longer recreate this.
/dev/folder has the files
Right now the strip is connected like so:
I am using a 5V, 2A power adapter, and only the third light is on, and occasionaly the 28th LED lights up dimly. First I am having problems with SPI, which leads me to believe it might not/no longer be set up correctly. Observe the output of the following commands:
raspi@raspi4 ~ $ ls -l /dev/spi* crw------- 1 raspi raspi 153, 0 Jan 1 1970 /dev/spidev0.0 crw------- 1 raspi raspi 153, 1 Jan 1 1970 /dev/spidev0.1 -rw-r--r-- 1 raspi raspi 108 Feb 25 18:57 /dev/spidev0.3 raspi@raspi4 ~ $ sudo lsmod Module Size Used by bnep 10582 2 bluetooth 192720 7 bnep rfkill 18298 2 bluetooth nfsd 229865 11 binfmt_misc 6968 1 snd_bcm2835 16432 0 snd_pcm 77728 1 snd_bcm2835 snd_page_alloc 5169 1 snd_pcm snd_seq 53482 0 snd_seq_device 6462 1 snd_seq snd_timer 20110 2 snd_pcm,snd_seq snd 58744 5 snd_bcm2835,snd_timer,snd_pcm,snd_seq,snd_seq_device spidev 5248 0 leds_gpio 2243 0 led_class 3570 1 leds_gpio spi_bcm2708 4841 0
raspi@raspi4 ~/downloads/spidev_test $ sudo ./spidev_test #for spidev0.0 or 0.1 spi mode: 0 bits per word: 8 max speed: 500000 Hz (500 KHz) 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 raspi@raspi4 ~/downloads/spidev_test $ sudo ./spidev_test #for spidev0.3 can't set spi mode: Inappropriate ioctl for device
Frustrated, I tried banging through some tutorials, but none of the below seem to work either:
- Simple SPI on Raspi
- Simple Command Line Utility for Raspi
- Pixel Pi
- Light Painting With Raspi
- Raspberry Pi and the WS2801
Question: Can someone walk me through diagnosing this as either an SPI problem or a program problem.
- "which program did you manage to run"? RPI-LPD8806, specifically this python script
"What libraries have you installed"? Commands issued follow below
"How did you compile the SPI test program"? Like so,
gcc spidev_test.c -o spidev_test && sudo ./spidev_test
"Have you loaded the SPI modules"? "If so how"? Yes, like so
gpio load spi. Note that issuing the command
sudo modprobe spi_bcm2708fails with this error "libkmod: ERROR ../libkmod/libkmod.c:554 kmod_search_moddep: could not open moddep file '/lib/modules/3.6.11+/modules.dep.bin'"
sudo apt-get install python-dev git clone https://github.com/doceme/py-spidev.git cd py-spidev/ sudo python setup.py install git clone https://github.com/adammhaile/RPi-LPD8806.git cd RPi-LPD8806 python setup.py install `sudo apt-get update` `sudo apt-get install python-dev`