ValueError: 5 is not a valid LED type - Trying to use TM1804

I’m trying to get an old LED strip that uses TM1804 working on Raspberry PI model 1.

I enabled SPI via:

sudo raspi-config

I installed BiblioPixel via:

sudo pip3 install BiblioPixel (NOTE: This took a very long time to install/compile – 1.5 hours)

sudo pip3 install pyserial --upgrade

sudo pip3 install spidev

I am trying to run a simple test program. I’m not sure the program is correct. In the end, I’m just trying to get a few LEDs to light. I have PIN 19 (MOSI) connected to the data line of the LED stip.

—BEGIN PROGRAM–

import bibliopixel

causes frame timing information to be output

bibliopixel.log.setLogLevel(bibliopixel.log.DEBUG)

Load driver for the AllPixel

from bibliopixel.drivers.SPI import *

from bibliopixel.drivers.driver_base import *

set number of pixels & LED type here

driver = Serial(num = 10, ledtype = LEDTYPE.TM1804, device_id = 2)

driver = SPI(ledtype = LEDTYPE.TM1804, num = 10, dev=’/dev/spidev0.0’, interface=‘FILE’, spi_speed=1, c_order = ChannelOrder.RGB, gamma = bibliopixel.gamma.DEFAULT)

load the LEDStrip class

from bibliopixel.layout import *

led = Strip(driver)

load channel test animation

from bibliopixel.animation import StripChannelTest

anim = StripChannelTest(led)

try:

run the animation

anim.run()

except KeyboardInterrupt:

Ctrl+C will exit the animation and turn the LEDs offs

led.all_off()

led.update()

—END PROGRAM–

When I run this via:

python3 led.py

I get this:

ValueError: 5 is not a valid LED type.

Did I miss installing something? Does my sample program look OK?

TM1804 isn’t an SPI compatible LED strip and there’s no driver for it in the SPI class. You’d need to use the Serial driver with an AllPixel

···

On Tue, Apr 30, 2019 at 11:00 PM Kurt Kellner kurt.kellner@gmail.com wrote:

I’m trying to get an old LED strip that uses TM1804 working on Raspberry PI model 1.

I enabled SPI via:

sudo raspi-config

I installed BiblioPixel via:

sudo pip3 install BiblioPixel (NOTE: This took a very long time to install/compile – 1.5 hours)

sudo pip3 install pyserial --upgrade

sudo pip3 install spidev

I am trying to run a simple test program. I’m not sure the program is correct. In the end, I’m just trying to get a few LEDs to light. I have PIN 19 (MOSI) connected to the data line of the LED stip.

—BEGIN PROGRAM–

import bibliopixel

causes frame timing information to be output

bibliopixel.log.setLogLevel(bibliopixel.log.DEBUG)

Load driver for the AllPixel

from bibliopixel.drivers.SPI import *

from bibliopixel.drivers.driver_base import *

set number of pixels & LED type here

driver = Serial(num = 10, ledtype = LEDTYPE.TM1804, device_id = 2)

driver = SPI(ledtype = LEDTYPE.TM1804, num = 10, dev=’/dev/spidev0.0’, interface=‘FILE’, spi_speed=1, c_order = ChannelOrder.RGB, gamma = bibliopixel.gamma.DEFAULT)

load the LEDStrip class

from bibliopixel.layout import *

led = Strip(driver)

load channel test animation

from bibliopixel.animation import StripChannelTest

anim = StripChannelTest(led)

try:

run the animation

anim.run()

except KeyboardInterrupt:

Ctrl+C will exit the animation and turn the LEDs offs

led.all_off()

led.update()

—END PROGRAM–

When I run this via:

python3 led.py

I get this:

ValueError: 5 is not a valid LED type.

Did I miss installing something? Does my sample program look OK?

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-labs-users@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/bbd40f9b-e243-46e7-8695-4f4064f3e492%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.