Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LPD8806 not working
#1
Hi.

So, I've been using the LPD8806 Led Strip for a while using PI4J and wiringPi. Decided to upgrade Rasbian and now my led strip is not responding anymore.

Thought hey, lets try using BiblioPixel, looks like the best stuff on the market for led strips.
Set everything up but when running the example to check if it works, it throws an error:

Code:
pi@raspberrypi ~ $ sudo python AllPixel.wiki/examples/AllPixelStripTest.py
Traceback (most recent call last):
  File "AllPixel.wiki/examples/AllPixelStripTest.py", line 11, in <module>
    driver = DriverSerial(num = 10, type = LEDTYPE.LPD8806)
  File "/usr/local/lib/python2.7/dist-packages/bibliopixel/drivers/serial_driver.py", line 99, in __init__
    resp = self._connect()
  File "/usr/local/lib/python2.7/dist-packages/bibliopixel/drivers/serial_driver.py", line 194, in _connect
    self._com =  serial.Serial(self.dev, timeout=5)
  File "/usr/local/lib/python2.7/dist-packages/serial/serialutil.py", line 282, in __init__
    self.open()
  File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 289, in open
    self.fd = os.open(self.portstr, os.O_RDWR|os.O_NOCTTY|os.O_NONBLOCK)
OSError: [Errno 2] No such file or directory: ''

Can't figure out what the issue is, can anyone help me?
#2
You are trying to use the serial driver. That's for our AllPixel LED controller. But I assume you are connecting the LPD8806 directly to the Pi's SPI port?
The AllPixel does support the LPD8806 (and a dozen others) but that's only for if you are actually using an AllPixel (or other USB serial device that supports the same protocol). If connecting the LPD8806 to the SPI port directly, you need to use DriverLPD8806: https://github.com/ManiacalLabs/BiblioPixel/wiki/DriverLPD8806
#3
Hi, Adam!

First of all, thanks a lot for developing this and being so quick to respond and helpful! I'm sure everybody appreciates your efforts.

Yes, I am using RPI with SPI and yes, I was using AllPixel stuff, stupid me.
Now, I've done a little script but it still throws an error.
Something must be wrong with my Led Strip or SPI . I've tried so many things when it comes to SPI to make it work but to no avail.

Anyway, I hope there's something wrong with my script or something:

Code:
from bibliopixel import *
from bibliopixel.drivers.LPD8806 import *
#set number of pixels & LED type here
driver = DriverLPD8806(60, c_order=ChannelOrder.GRB, use_py_spi=True, dev="/dev/spidev0.0", SPISpeed=2)
led = LEDStrip(driver)
led.all_off()
led.fillRGB(100,100,100)
led.update()

And the error:
Code:
sudo python testAnim.py
INFO - spi_driver_base - py-spidev speed @ 4.0 MHz
Traceback (most recent call last):
  File "testAnim.py", line 8, in <module>
    led.update()
  File "/usr/local/lib/python2.7/dist-packages/bibliopixel/led.py", line 123, in update
    d._update(self.buffer[pos:d.bufByteCount+pos])
  File "/usr/local/lib/python2.7/dist-packages/bibliopixel/drivers/driver_base.py", line 51, in _update
    self.update(data)
  File "/usr/local/lib/python2.7/dist-packages/bibliopixel/drivers/spi_driver_base.py", line 86, in update
    self._sendData()
  File "/usr/local/lib/python2.7/dist-packages/bibliopixel/drivers/spi_driver_base.py", line 79, in _sendData
    self.spi.xfer2(self._buf)
IOError: [Errno 22] Invalid argument

What could be wrong?
ls -l /dev/spidev* has both 0.0 and 0.1
lsmod | grep spi returns spi_bcm2835

Could my LedStrip be broken? At the moment it has almost all leds on a faded red color, don't know why, it's been like this after I've ran some tests.
Also, I'm considering buying a new LedStrip. Any advice? Which models are the best? Including price-performance,hehe.

Anyway, thanks a lot for answering!
Have a good day!
#4
It's not your strip. For the record, those strips are one way. You would never get an error if the strip was broken.
Can you run "pip freeze" at the console and paste the results here. It looks like py-spidev updated recently and it may have broken support.
Can you try settng use_py_spi to False?
#5
Hmm... OK, nevermind about py-spidev. I just tried your code on my RPi and it worked fine.

Still send me the pip freeze output... it will certainly help Smile
#6
pi@raspberrypi ~ $ pip freeze
BiblioPixel==2.0.5
Pillow==2.6.1
RPi.GPIO==0.6.0a3
RTIMULib==7.2.1
argparse==1.2.1
chardet==2.3.0
colorama==0.3.2
gevent==1.0.1
greenlet==0.4.2
html5lib==0.999
lxkeymap==0.1
lxml==3.4.0
mcpi==0.1.1
ndg-httpsclient==0.3.2
numpy==1.8.2
picamera==1.10
pifacecommon==4.2.1
pifacedigitalio==3.1.0
pyOpenSSL==0.13.1
pyasn1==0.1.7
pygame==1.9.2a0
pygobject==3.14.0
pyserial==2.7
requests==2.4.3
sense-hat==2.1.0
six==1.8.0
spidev==2.0
urllib3==1.9.1
urwid==1.2.1
wheel==0.24.0
wicd==1.7.2.4
wsgiref==0.1.2
#7
Try running "sudo pip install spidev --upgrade"
Now that I know it works with the new spidev I looked further and it seems that spidev 2.0 is broken with the newer linux kernel. So hopefully updating to spidev 3.1 should fix your problem.
#8
Ok, set use_py_spi to False and the error is gone.

But still nothing on the LPD8806.
When I run the animation there is a flicker on the first LED on the strip, but hardly noticeable, even if it reproduces when running the animation.
All other leds are stuck on a faded red and that one led is a combination of red and blue but it doesn't change or something. It just flickers, no matter what colors I set in the script.

Could it be broken? the clock or something?

The flicker was because I had SCLK connected to DI and not CI, i switched to test something. I inverted it. The faint flicker is gone but still not working.
Also I upgraded spidev. pip freeze now shows 3.1 but still nothing on the LPD8806. Seriously starting to think there's something wrong with the led strip but it worked before upgrading to jessie... had an old wheezy raspbian on my rpi..
#9
Check out this: https://github.com/ManiacalLabs/BiblioPixel/wiki/SPI-Setup

Probably is something to do with your strip, but the above is work a shot.
Are you running with sudo?

BTW... I hate Jessie so far. Nothing but problems. Can you try Wheezy again?
#10
Though I tried Wheezy, I will do it again. Also, followed the guide about the SPI-Setup, it is pretty straightforward.
Yup, I'm a sudo abuser, haha. I run almost everything with sudo, just to be sure.

If you could give me some advice on what to install and buy. I guess if I have everything you have, the LPD8806 should work for me as well. Initialy I thought LPD8806 is not compatible with the latest changes, but I guess it is.
I can't believe my strip is broken. Since it worked 2 weeks ago on my old setup, I doubt the fact that it is a coincidence, but I will buy another one.

Again, thanks for the support, Adam. You're truly a great guy!


Forum Jump:


Users browsing this thread: 1 Guest(s)