Python script example needed

Hi,

I’m having a hard time successfully running a python script. Using the PiPixel on a RPi 3 B+, a 32x8 APA102 led matrix (eventually two of those chained together), and python3.7 . Would anyone be so kind as to give me a small code example I can work from? Up to now, all I get is scrambled leds not doing anything good. I have tried the new Builder thingy, but no success either.

Eventually I will want to control individual led’s and trigger animations via OSC.

Here is my current code:

from BiblioPixelAnimations.matrix.GameOfLife import *

from bibliopixel.drivers.SPI.APA102 import *

from bibliopixel.layout import *

pixW = 32

pixH = 8

driver = APA102(pixW*pixH)

#this is to eventually include a second LED panel in series

coords = []

for i in range(pixH):

coords.append([j+(ipixW) for j in range(pixW)] + [k+(pixWpixH)+(i*pixW) for k in range(pixW)])

led = Matrix(driver, width = pixW, height = pixH, coord_map = coords)

anim = GameOfLife(led)

anim.run()

``

Thanks!

Thanks for the reply!

No success, here is the error message:

INFO - interfaces - file io spi dev /dev/spidev0.0

Traceback (most recent call last):

File “BiblioPixel_Test_01_B.py”, line 22, in

anim.start()

File “/usr/local/opt/python-3.7.2/lib/python3.7/site-packages/bibliopixel/animation/animation.py”, line 132, in start

self.threading.start()

AttributeError: ‘GameOfLife’ object has no attribute ‘threading’

``

When I was doing the run() command before, the leds were all lighting up in a scrambled way and pinkish in color, same as when not using the correct driver. I have the same issue if I try to call a single led by its address (wrong led with wrong color).

JFP

···

Le jeudi 10 janvier 2019 12:16:15 UTC-5, Tom Swirly a écrit :

Hello, and sorry about the delay!

You should be calling anim.start(), not anim.run()

That would certainly cause this problem.

I’m going to add a note to the documentation for run to say “DO NOT CALL THIS DIRECTLY!”

On Wed, Jan 9, 2019 at 11:15 PM Jean-François Primeau jf.pr...@gmail.com wrote:

Hi,

I’m having a hard time successfully running a python script. Using the PiPixel on a RPi 3 B+, a 32x8 APA102 led matrix (eventually two of those chained together), and python3.7 . Would anyone be so kind as to give me a small code example I can work from? Up to now, all I get is scrambled leds not doing anything good. I have tried the new Builder thingy, but no success either.

Eventually I will want to control individual led’s and trigger animations via OSC.

Here is my current code:

from BiblioPixelAnimations.matrix.GameOfLife import *

from bibliopixel.drivers.SPI.APA102 import *

from bibliopixel.layout import *

pixW = 32

pixH = 8

driver = APA102(pixW*pixH)

#this is to eventually include a second LED panel in series

coords = []

for i in range(pixH):

coords.append([j+(ipixW) for j in range(pixW)] + [k+(pixWpixH)+(i*pixW) for k in range(pixW)])

led = Matrix(driver, width = pixW, height = pixH, coord_map = coords)

anim = GameOfLife(led)

anim.run()

``

Thanks!

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-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/7c2e616b-44d0-4b49-ae8a-c1098a6fd97a%40googlegroups.com.

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


/t

https://tom.ritchford.com

https://tom.swirly.com

Agreed, how is your power hooked up? Can you send some pictures?

···

On Thu, Jan 10, 2019 at 2:10 PM Tom Swirly tom@swirly.com wrote:

Ah, and indeed, the “run vs start” advice was wrong for your program. I was thinking poorly…

So go back to using run and forget I said that…

the leds were all lighting up in a scrambled way and pinkish in color, same as when not using the correct driver.

I’m wondering if you aren’t getting enough power to the PiPixel?

Did you try running the simple test program here - https://github.com/ManiacalLabs/AllPixel/wiki/Library-Install-and-Strip-Example - and see if that ran?

On Thu, Jan 10, 2019 at 7:23 PM Jean-François Primeau jf.primeau@gmail.com wrote:

Thanks for the reply!

No success, here is the error message:

INFO - interfaces - file io spi dev /dev/spidev0.0

Traceback (most recent call last):

File “BiblioPixel_Test_01_B.py”, line 22, in

anim.start()

File “/usr/local/opt/python-3.7.2/lib/python3.7/site-packages/bibliopixel/animation/animation.py”, line 132, in start

self.threading.start()

AttributeError: ‘GameOfLife’ object has no attribute ‘threading’

``

When I was doing the run() command before, the leds were all lighting up in a scrambled way and pinkish in color, same as when not using the correct driver. I have the same issue if I try to call a single led by its address (wrong led with wrong color).

JFP

Le jeudi 10 janvier 2019 12:16:15 UTC-5, Tom Swirly a écrit :

Hello, and sorry about the delay!

You should be calling anim.start(), not anim.run()

That would certainly cause this problem.

I’m going to add a note to the documentation for run to say “DO NOT CALL THIS DIRECTLY!”

On Wed, Jan 9, 2019 at 11:15 PM Jean-François Primeau jf.pr...@gmail.com wrote:

Hi,

I’m having a hard time successfully running a python script. Using the PiPixel on a RPi 3 B+, a 32x8 APA102 led matrix (eventually two of those chained together), and python3.7 . Would anyone be so kind as to give me a small code example I can work from? Up to now, all I get is scrambled leds not doing anything good. I have tried the new Builder thingy, but no success either.

Eventually I will want to control individual led’s and trigger animations via OSC.

Here is my current code:

from BiblioPixelAnimations.matrix.GameOfLife import *

from bibliopixel.drivers.SPI.APA102 import *

from bibliopixel.layout import *

pixW = 32

pixH = 8

driver = APA102(pixW*pixH)

#this is to eventually include a second LED panel in series

coords = []

for i in range(pixH):

coords.append([j+(ipixW) for j in range(pixW)] + [k+(pixWpixH)+(i*pixW) for k in range(pixW)])

led = Matrix(driver, width = pixW, height = pixH, coord_map = coords)

anim = GameOfLife(led)

anim.run()

``

Thanks!

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-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/7c2e616b-44d0-4b49-ae8a-c1098a6fd97a%40googlegroups.com.

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


/t

https://tom.ritchford.com

https://tom.swirly.com

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/53ef0d0d-44f7-49b3-b6be-df3eadcbd228%40googlegroups.com.

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


/t

https://tom.ritchford.com

https://tom.swirly.com

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/CAOuQWfWtJonpzLhjLY%2BPL%3DOt1EPjb%2BaWYReduSxSGoiOpg4ncg%40mail.gmail.com.

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

I doubt it is a power problem as I can run the animations properly with the bp command line. The led panel is getting its power straight from a power outlet, with the ground also being connected to the pipixel (clock, data and ground only are used from the pipixel, not the onboard power). Do you still need a picture of the setup?

I had the same problem with the weird random led color and placement when I first tried the bp command line and the .yml file was not configured with the correct driver.

JFP

···

Le jeudi 10 janvier 2019 14:11:34 UTC-5, Adam Haile a écrit :

Agreed, how is your power hooked up? Can you send some pictures?

On Thu, Jan 10, 2019 at 2:10 PM Tom Swirly t...@swirly.com wrote:

Ah, and indeed, the “run vs start” advice was wrong for your program. I was thinking poorly…

So go back to using run and forget I said that…

the leds were all lighting up in a scrambled way and pinkish in color, same as when not using the correct driver.

I’m wondering if you aren’t getting enough power to the PiPixel?

Did you try running the simple test program here - https://github.com/ManiacalLabs/AllPixel/wiki/Library-Install-and-Strip-Example - and see if that ran?

On Thu, Jan 10, 2019 at 7:23 PM Jean-François Primeau jf.pr...@gmail.com wrote:

Thanks for the reply!

No success, here is the error message:

INFO - interfaces - file io spi dev /dev/spidev0.0

Traceback (most recent call last):

File “BiblioPixel_Test_01_B.py”, line 22, in

anim.start()

File “/usr/local/opt/python-3.7.2/lib/python3.7/site-packages/bibliopixel/animation/animation.py”, line 132, in start

self.threading.start()

AttributeError: ‘GameOfLife’ object has no attribute ‘threading’

``

When I was doing the run() command before, the leds were all lighting up in a scrambled way and pinkish in color, same as when not using the correct driver. I have the same issue if I try to call a single led by its address (wrong led with wrong color).

JFP

Le jeudi 10 janvier 2019 12:16:15 UTC-5, Tom Swirly a écrit :

Hello, and sorry about the delay!

You should be calling anim.start(), not anim.run()

That would certainly cause this problem.

I’m going to add a note to the documentation for run to say “DO NOT CALL THIS DIRECTLY!”

On Wed, Jan 9, 2019 at 11:15 PM Jean-François Primeau jf.pr...@gmail.com wrote:

Hi,

I’m having a hard time successfully running a python script. Using the PiPixel on a RPi 3 B+, a 32x8 APA102 led matrix (eventually two of those chained together), and python3.7 . Would anyone be so kind as to give me a small code example I can work from? Up to now, all I get is scrambled leds not doing anything good. I have tried the new Builder thingy, but no success either.

Eventually I will want to control individual led’s and trigger animations via OSC.

Here is my current code:

from BiblioPixelAnimations.matrix.GameOfLife import *

from bibliopixel.drivers.SPI.APA102 import *

from bibliopixel.layout import *

pixW = 32

pixH = 8

driver = APA102(pixW*pixH)

#this is to eventually include a second LED panel in series

coords = []

for i in range(pixH):

coords.append([j+(ipixW) for j in range(pixW)] + [k+(pixWpixH)+(i*pixW) for k in range(pixW)])

led = Matrix(driver, width = pixW, height = pixH, coord_map = coords)

anim = GameOfLife(led)

anim.run()

``

Thanks!

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-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/7c2e616b-44d0-4b49-ae8a-c1098a6fd97a%40googlegroups.com.

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


/t

https://tom.ritchford.com

https://tom.swirly.com

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-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/53ef0d0d-44f7-49b3-b6be-df3eadcbd228%40googlegroups.com.

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


/t

https://tom.ritchford.com

https://tom.swirly.com

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-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/CAOuQWfWtJonpzLhjLY%2BPL%3DOt1EPjb%2BaWYReduSxSGoiOpg4ncg%40mail.gmail.com.

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

I’ve finally managed to make it run! there was this argument missing on the driver declaration line:

driver = APA102(spi_interface = SPI_INTERFACES.PERIPHERY, num = pixW*pixH)

``

Now the animations are running as expected, with 2 panels of 32x8 on top of each other. Still a bit wonky when i set them one after another in a line (32x8 and another 32x8 at its right), will have to work this out. Any pointers or ideas on how to make this work?

Thanks!

JFP

···

Le jeudi 10 janvier 2019 15:16:37 UTC-5, Jean-François Primeau a écrit :

I doubt it is a power problem as I can run the animations properly with the bp command line. The led panel is getting its power straight from a power outlet, with the ground also being connected to the pipixel (clock, data and ground only are used from the pipixel, not the onboard power). Do you still need a picture of the setup?

I had the same problem with the weird random led color and placement when I first tried the bp command line and the .yml file was not configured with the correct driver.

JFP

Le jeudi 10 janvier 2019 14:11:34 UTC-5, Adam Haile a écrit :

Agreed, how is your power hooked up? Can you send some pictures?

On Thu, Jan 10, 2019 at 2:10 PM Tom Swirly t...@swirly.com wrote:

Ah, and indeed, the “run vs start” advice was wrong for your program. I was thinking poorly…

So go back to using run and forget I said that…

the leds were all lighting up in a scrambled way and pinkish in color, same as when not using the correct driver.

I’m wondering if you aren’t getting enough power to the PiPixel?

Did you try running the simple test program here - https://github.com/ManiacalLabs/AllPixel/wiki/Library-Install-and-Strip-Example - and see if that ran?

On Thu, Jan 10, 2019 at 7:23 PM Jean-François Primeau jf.pr...@gmail.com wrote:

Thanks for the reply!

No success, here is the error message:

INFO - interfaces - file io spi dev /dev/spidev0.0

Traceback (most recent call last):

File “BiblioPixel_Test_01_B.py”, line 22, in

anim.start()

File “/usr/local/opt/python-3.7.2/lib/python3.7/site-packages/bibliopixel/animation/animation.py”, line 132, in start

self.threading.start()

AttributeError: ‘GameOfLife’ object has no attribute ‘threading’

``

When I was doing the run() command before, the leds were all lighting up in a scrambled way and pinkish in color, same as when not using the correct driver. I have the same issue if I try to call a single led by its address (wrong led with wrong color).

JFP

Le jeudi 10 janvier 2019 12:16:15 UTC-5, Tom Swirly a écrit :

Hello, and sorry about the delay!

You should be calling anim.start(), not anim.run()

That would certainly cause this problem.

I’m going to add a note to the documentation for run to say “DO NOT CALL THIS DIRECTLY!”

On Wed, Jan 9, 2019 at 11:15 PM Jean-François Primeau jf.pr...@gmail.com wrote:

Hi,

I’m having a hard time successfully running a python script. Using the PiPixel on a RPi 3 B+, a 32x8 APA102 led matrix (eventually two of those chained together), and python3.7 . Would anyone be so kind as to give me a small code example I can work from? Up to now, all I get is scrambled leds not doing anything good. I have tried the new Builder thingy, but no success either.

Eventually I will want to control individual led’s and trigger animations via OSC.

Here is my current code:

from BiblioPixelAnimations.matrix.GameOfLife import *

from bibliopixel.drivers.SPI.APA102 import *

from bibliopixel.layout import *

pixW = 32

pixH = 8

driver = APA102(pixW*pixH)

#this is to eventually include a second LED panel in series

coords = []

for i in range(pixH):

coords.append([j+(ipixW) for j in range(pixW)] + [k+(pixWpixH)+(i*pixW) for k in range(pixW)])

led = Matrix(driver, width = pixW, height = pixH, coord_map = coords)

anim = GameOfLife(led)

anim.run()

``

Thanks!

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-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/7c2e616b-44d0-4b49-ae8a-c1098a6fd97a%40googlegroups.com.

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


/t

https://tom.ritchford.com

https://tom.swirly.com

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-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/53ef0d0d-44f7-49b3-b6be-df3eadcbd228%40googlegroups.com.

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


/t

https://tom.ritchford.com

https://tom.swirly.com

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-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/CAOuQWfWtJonpzLhjLY%2BPL%3DOt1EPjb%2BaWYReduSxSGoiOpg4ncg%40mail.gmail.com.

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