Maniacal Labs User Forum
Trouble with Animations timing out - Printable Version

+- Maniacal Labs User Forum (http://forum.maniacallabs.com)
+-- Forum: BiblioPixel (http://forum.maniacallabs.com/forumdisplay.php?fid=4)
+--- Forum: BiblioPixel Support (http://forum.maniacallabs.com/forumdisplay.php?fid=8)
+--- Thread: Trouble with Animations timing out (/showthread.php?tid=126)



Trouble with Animations timing out - kentells - 12-13-2016

After copying the animation repo
I figured out that to run some of the animations that have been made I basically just have to import:
Code:
from bibliopixel.led import *
from bibliopixel.animation import *
from bibliopixel.drivers.serial_driver import *
from bibliopixel.drivers.visualizer import *
from BiblioPixelAnimations.matrix.GameOfLife import *
#from BiblioPixelAnimations.matrix.ScreenGrab import *
from BiblioPixelAnimations.matrix.ImageShow import *

#These are needed for ImageAnim
from BiblioPixelAnimations.matrix.ImageAnim import *
import bibliopixel.image as image


#create driver for a 16x10 grid, use the size of your display
#driver = DriverVisualizer(width=16, height=10, stayTop=True)
driver = DriverSerial(num = 160, type = LEDTYPE.WS2812B, c_order = ChannelOrder.GRB)
led = LEDMatrix(driver,
                                width = 10,
                                height = 16,
                                rotation = MatrixRotation.ROTATE_90,
                                vert_flip = True,
                                serpentine = True)

#These are specific for running with ImageAnim
anim = ImageAnim(led, "/home/kent/Downloads/manwithballoon.gif")

#This is specific for ImageShow
#anim = ImageShow(led, "/home/kent/Downloads/Testpixelart.jpg")
#anim = ImageShow(led, "/home/kent/Downloads/picachu.jpg")

#anim = ScreenGrab(led)
#anim = GameOfLifeClock(led)
try:
    #run the animation
    #anim.run()
    anim.run(untilComplete = True, max_cycles = 5)
except KeyboardInterrupt:
    #Ctrl+C will exit the animation and turn the LEDs offs
    led.all_off()
    led.update()
From BiblioPixelAnimations.matrix.<animation> import *

and then
anim = <animation>(led)
anim.run()

For the most part the above is true at least, Of course there are some 3rd party softwares that need to be installed for some.
At first I wasn't putting them in a try: but it still happened even after I did.

Running a 16x10 matrix with the AllPixel from KS.

For GameOfLife and GameOfLifeRGB they continuously run. no problem

But for ImageShow:
The picture does show for 3-5 sec.
This is the error.
INFO - serial_driver - Using COM Port: /dev/ttyACM0, Device ID: 0, Device Ver: 0
Traceback (most recent call last):
File "KentsTest.py", line 37, in <module>
anim.run()
File "/home/kent/Documents/BiblioPixel-master/bibliopixel/animation.py", line 191, in run
self._run(amt, fps, sleep, max_steps, untilComplete, max_cycles, seconds)
File "/home/kent/Documents/BiblioPixel-master/bibliopixel/animation.py", line 130, in _run
self._led.update()
File "/home/kent/Documents/BiblioPixel-master/bibliopixel/led.py", line 201, in update
self.driver[i]._update(data[i])
File "/home/kent/Documents/BiblioPixel-master/bibliopixel/drivers/driver_base.py", line 54, in _update
self.update(data)
File "/home/kent/Documents/BiblioPixel-master/bibliopixel/drivers/serial_driver.py", line 326, in update
resp = self._com.read(1)
File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 490, in read
'device reports readiness to read but returned no data '
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

And then it loses connection and I have to unplug and replug the allpixel. (Meanwhile the pixels just go a bit random and red)

When running ImageAnim Again the picture shows but I get the following (slightly different message at the bottom)
INFO - serial_driver - Using COM Port: /dev/ttyACM0, Device ID: 0, Device Ver: 0
INFO - ImageAnim - Loading /home/kent/Downloads/manwithballoon.gif ...
Traceback (most recent call last):
File "KentsTest.py", line 37, in <module>
anim.run(untilComplete = True, max_cycles = 5)
File "/home/kent/Documents/BiblioPixel-master/bibliopixel/animation.py", line 191, in run
self._run(amt, fps, sleep, max_steps, untilComplete, max_cycles, seconds)
File "/home/kent/Documents/BiblioPixel-master/bibliopixel/animation.py", line 130, in _run
self._led.update()
File "/home/kent/Documents/BiblioPixel-master/bibliopixel/led.py", line 201, in update
self.driver[i]._update(data[i])
File "/home/kent/Documents/BiblioPixel-master/bibliopixel/drivers/driver_base.py", line 54, in _update
self.update(data)
File "/home/kent/Documents/BiblioPixel-master/bibliopixel/drivers/serial_driver.py", line 324, in update
self._com.write(packet)
File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 554, in write
raise SerialException('write failed: {}'.format(v))
serial.serialutil.SerialException: write failed: [Errno 5] Input/output error

And again it loses connection.
Quick Note: I don't remember it throwing the error when going to the visualizer.

I guess last question would be is it best to choose pictures that match my resolution because a 128x128 seemed to just get wiped out by averages.


RE: Trouble with Animations timing out - Adam - 12-13-2016

Does it always work for Game of Life and others, just not for Images?
Also, I need the following:
- OS type and version
- results of "pip freeze"
- bibliopixel version

It wouldn't throw the same error for the visualizer. This is a serial error. Never seen serial fail when doing specific animations thought... that's a new one.


RE: Trouble with Animations timing out - kentells - 12-15-2016

OK
OS = Ubuntu 16.04.1LTS

pip freeze
adium-theme-ubuntu==0.3.4
BiblioPixel==2.1.2
BiblioPixelAnimations===85b3b390b9147976924387a7a9e96527a9452ab2
numpy==1.11.2
Pillow==3.4.2
PyAudio==0.2.8
pygobject==3.20.0
pyserial==3.2.1
spidev==2.0
unity-lens-photos==1.0
virtualenv==15.1.0


I'm pretty new to this whole thing so I would imagine it is something I'm doing.
GameOfLife does seem to work fine, I believe the Analog Clock also worked.
The Image do seem the ones causing the problem.
I would test some more but going on vacation until next week. If I don't hear from you I'll test some other animations.

Thanks so much!

-Kent