Controlling multiple allpixels with multiple instances of bp occasionally errors

I have two allpixels for my current project, both of which will be controlling about 400 leds. In stress testing this setup to make sure my rpi can handle running it, I started up two instances of bp with the same project, only chancing the device_id.

{

“driver”: {

“typename”: “serial”,

“num”: 400,

“ledtype”: “APA102”,

“device_id”: X,

“c_order”: “bgr”

},

“layout”: {

“typename”: “bibliopixel.layout.strip.Strip”

},

“animation”: {

“typename”: “BiblioPixelAnimations.strip.Rainbows.RainbowCycle”

},

“run”: {

“fps”: 30

},

“path”: “/development/BiblioPixelAnimations”

}

Running one works fine. Running both, most of the time, seems to work fine. However, occasionally when I startup the second instance, the already running instance will terminate with one of the following errors.

TypeError: error() got an unexpected keyword argument ‘fail’

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

These failures seem to always occur within a few seconds. If it runs longer than that, it has stayed stable for at lest 30 minutes.

Are there issues with running multiple instances of bp, both controlling serial devices?

I ran my test a dozen times or so with verbose logging and got the following traces.

···

==============================================

DEBUG - devices - Error getting device_id for /dev/ttyACM0, 921600

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 165, in run_context

yield

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/usr/lib/python3.5/contextlib.py”, line 77, in exit

self.gen.throw(type, value, traceback)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 167, in run_context

self.cleanup(clean_layout)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 89, in cleanup

self.layout.cleanup()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 73, in cleanup

self.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

==============================================

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 58ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

==============================================

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 165, in run_context

yield

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/usr/lib/python3.5/contextlib.py”, line 77, in exit

self.gen.throw(type, value, traceback)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 167, in run_context

self.cleanup(clean_layout)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 89, in cleanup

self.layout.cleanup()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 73, in cleanup

self.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

On Sunday, February 4, 2018 at 10:50:18 PM UTC-6, Diddy Wolf wrote:

I have two allpixels for my current project, both of which will be controlling about 400 leds. In stress testing this setup to make sure my rpi can handle running it, I started up two instances of bp with the same project, only chancing the device_id.

{

“driver”: {

“typename”: “serial”,

“num”: 400,

“ledtype”: “APA102”,

“device_id”: X,

“c_order”: “bgr”

},

“layout”: {

“typename”: “bibliopixel.layout.strip.Strip”

},

“animation”: {

“typename”: “BiblioPixelAnimations.strip.Rainbows.RainbowCycle”

},

“run”: {

“fps”: 30

},

“path”: “/development/BiblioPixelAnimations”

}

Running one works fine. Running both, most of the time, seems to work fine. However, occasionally when I startup the second instance, the already running instance will terminate with one of the following errors.

TypeError: error() got an unexpected keyword argument ‘fail’

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

These failures seem to always occur within a few seconds. If it runs longer than that, it has stayed stable for at lest 30 minutes.

Are there issues with running multiple instances of bp, both controlling serial devices?

Sorry for the delay. Upgraded to 3.4.6. Still seeing a crash occasionally. Not as readily as before (maybe once in 20 attempts?). Got two unique tracebacks this time.

···

======================================================

DEBUG - devices - Error getting device_id for /dev/ttyACM1, 921600

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 37ms!

ERROR - devices - There was an unknown error communicating with the device.

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

======================================================

DEBUG - devices - Error getting device_id for /dev/ttyACM0, 921600

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 120, in update_colors

self.set_device_brightness(brightness)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 121, in set_brightness

resp = ord(self._com.read(1))

TypeError: ord() expected a character, but string of length 0 found

======================================================

On Friday, February 9, 2018 at 8:26:20 AM UTC-6, Tom Swirly wrote:

Sorry for the delay here.

I just pushed a new version that at least handles the crash - you can get it by typing

pip install bibliopixel --upgrade

Try it with your issue and let me know how it goes!

On Mon, Feb 5, 2018 at 10:47 AM, Tom Swirly t...@swirly.com wrote:

This is a very clear report, thanks!

You allowed me to see that there’s a bug in handling the error where we crash where we shouldn’t - I sent out a pull request to fix that: https://github.com/ManiacalLabs/BiblioPixel/pull/611

However, why are you getting that error in the first place? I personally run with a setup much like yours and I don’t get these exceptions.

Adam will be able to weigh in on the causes of this. However, we should be able to recover from these error, perhaps without any visible effects, most likely with a bit of jitter (timing error) that will be barely unnoticeable - even if we can’t eliminate the cause of the errors.

On Mon, Feb 5, 2018 at 5:52 AM, Diddy Wolf didd...@gmail.com wrote:

I ran my test a dozen times or so with verbose logging and got the following traces.

==============================================

DEBUG - devices - Error getting device_id for /dev/ttyACM0, 921600

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 165, in run_context

yield

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/usr/lib/python3.5/contextlib.py”, line 77, in exit

self.gen.throw(type, value, traceback)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 167, in run_context

self.cleanup(clean_layout)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 89, in cleanup

self.layout.cleanup()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 73, in cleanup

self.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

==============================================

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 58ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

==============================================

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 165, in run_context

yield

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/usr/lib/python3.5/contextlib.py”, line 77, in exit

self.gen.throw(type, value, traceback)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 167, in run_context

self.cleanup(clean_layout)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 89, in cleanup

self.layout.cleanup()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 73, in cleanup

self.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

On Sunday, February 4, 2018 at 10:50:18 PM UTC-6, Diddy Wolf wrote:

I have two allpixels for my current project, both of which will be controlling about 400 leds. In stress testing this setup to make sure my rpi can handle running it, I started up two instances of bp with the same project, only chancing the device_id.

{

“driver”: {

“typename”: “serial”,

“num”: 400,

“ledtype”: “APA102”,

“device_id”: X,

“c_order”: “bgr”

},

“layout”: {

“typename”: “bibliopixel.layout.strip.Strip”

},

“animation”: {

“typename”: “BiblioPixelAnimations.strip.Rainbows.RainbowCycle”

},

“run”: {

“fps”: 30

},

“path”: “/development/BiblioPixelAnimations”

}

Running one works fine. Running both, most of the time, seems to work fine. However, occasionally when I startup the second instance, the already running instance will terminate with one of the following errors.

TypeError: error() got an unexpected keyword argument ‘fail’

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

These failures seem to always occur within a few seconds. If it runs longer than that, it has stayed stable for at lest 30 minutes.

Are there issues with running multiple instances of bp, both controlling serial devices?

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/dc91c93a-ec14-42d1-ac85-9a70febb2d25%40googlegroups.com.

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

/t

https://tom.ritchford.com

https://tom.swirly.com


/t

https://tom.ritchford.com

https://tom.swirly.com

Diddy,

So, there’s a ton of things that couple possibly cause that issue. 99.9% of the time it’s not an issue but on super rare occasions I’ve seen that. I think you are #3 in almost 4 years.

Let’s run through some questions and checks…

  • What Raspberry Pi are you using?

  • Are you running the latest version of Raspbian? Or are you using something other than Raspbian?

  • Are you running the Pi without without X windows running?

  • How are you powering your Pi? It may not be getting enough power and therefore the AllPixels aren’t. Is there a lightning bolt icon or rainbow square in the top right of the screen on the Pi? If so, you don’t have enough power.

  • How are you powering the LEDs? Through the barrel jack on the AllPixel or from USB power?

  • How exactly are you starting each of the bibliopixel instances. Please provide the full command/script/project/etc.

Basically when this happens there are usually 2 culprits:

  • Something is not getting enough power.

  • Something on the pi is taking up resources and it’s not getting enough cycles to properly communicate with the AllPixels.

One troubleshooting step here would be to try running this on a normal PC. Preferably a Windows PC… The reason for that is actually because the serial stack in some versions of linux is pretty bad (old Raspbian being one of them) and does not cope well with multiple serial connections at once. Windows on the other hand handles it flawlessly. I have made some displays with 3, 4, and 5 AllPixels that have trouble on Ubuntu and older Raspbian but work perfectly fine on Windows 7+
As noted though, latest Raspbian should likely be fine. This would just help confirm if it’s the AllPixels or it’s the controlling device.

···

On Sat, Feb 17, 2018 at 5:47 AM, Tom Swirly tom@swirly.com wrote:

So I have a pull request out now to possibly mitigate this issue.

But we aren’t seeing this issue locally so I can’t really test it… so…

Diddy, I see you wisely do everything in a virtualenv…

could I convince you/talk you through patching in this branch into your own virtualenv so that we can see if it works better??

In fact, here are the instructions…

  1. Create a temporary directory
  2. Create a fresh virtualenv in that directory (or wherever you like) and activate it
  3. Download my branch here into the directory and unzip it
  4. cd to the topmost directory of that branch
  5. Type
  • python setup.py develop
  • Now, try running your project using this virtualenv
  • When we’re all done, you can delete the whole temporary directory
    If I update the code on that branch, you can just repeat step 3 again and unzip it over the old code and you’re good to go (because you set it up with develop in step 5).

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/CAOuQWfXZb7mzghDoKrUS0po%3Di4vA6GQEv%2Bkq4bN2UwtY8H9-Nw%40mail.gmail.com.

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

On Sat, Feb 17, 2018 at 10:31 AM, Tom Swirly tom@swirly.com wrote:

Oh, and thanks again for the clear trouble report. I’m pretty sure that given those stack traces, I can at least make it ignore the errors. Now, I expect that will result in some sort of quality issue like missed frames but those might be totally invisible to the user…


/t

https://tom.ritchford.com

https://tom.swirly.com

On Sat, Feb 17, 2018 at 10:30 AM, Tom Swirly tom@swirly.com wrote:

Eh, no troubles with the delay, sorry you’re having this problem!

However, it’s an interesting problem now, not a trivial one. I still don’t think the program should crash - I filed an issue here last year about this - but the fact that it’s happening so often means that there is some actual hardware issue going on here too.

I’m going to get Adam to check in on this issue from the hardware end. From my end, I’ll try to come up with a way to recover gracefully from these errors, which should not be fatal - but you shouldn’t be having them either…

The AllPixels seem to have proven to be very reliable, mainly because there isn’t much to 'em - IIRC we have yet to find an error stemming from them, but who knows how many people had issues we didn’t report. Could it be that there’s a wiring issue? An intermittent short circuit, perhaps?


/t

https://tom.ritchford.com

https://tom.swirly.com

On Sat, Feb 17, 2018 at 6:01 AM, Diddy Wolf diddywolf@gmail.com wrote:

Sorry for the delay. Upgraded to 3.4.6. Still seeing a crash occasionally. Not as readily as before (maybe once in 20 attempts?). Got two unique tracebacks this time.

======================================================

DEBUG - devices - Error getting device_id for /dev/ttyACM1, 921600

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 37ms!

ERROR - devices - There was an unknown error communicating with the device.

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

======================================================

DEBUG - devices - Error getting device_id for /dev/ttyACM0, 921600

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 120, in update_colors

self.set_device_brightness(brightness)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 121, in set_brightness

resp = ord(self._com.read(1))

TypeError: ord() expected a character, but string of length 0 found

======================================================

On Friday, February 9, 2018 at 8:26:20 AM UTC-6, Tom Swirly wrote:

Sorry for the delay here.

I just pushed a new version that at least handles the crash - you can get it by typing

pip install bibliopixel --upgrade

Try it with your issue and let me know how it goes!

On Mon, Feb 5, 2018 at 10:47 AM, Tom Swirly t...@swirly.com wrote:

This is a very clear report, thanks!

You allowed me to see that there’s a bug in handling the error where we crash where we shouldn’t - I sent out a pull request to fix that: https://github.com/ManiacalLabs/BiblioPixel/pull/611

However, why are you getting that error in the first place? I personally run with a setup much like yours and I don’t get these exceptions.

Adam will be able to weigh in on the causes of this. However, we should be able to recover from these error, perhaps without any visible effects, most likely with a bit of jitter (timing error) that will be barely unnoticeable - even if we can’t eliminate the cause of the errors.

On Mon, Feb 5, 2018 at 5:52 AM, Diddy Wolf didd...@gmail.com wrote:

I ran my test a dozen times or so with verbose logging and got the following traces.

==============================================

DEBUG - devices - Error getting device_id for /dev/ttyACM0, 921600

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 165, in run_context

yield

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/usr/lib/python3.5/contextlib.py”, line 77, in exit

self.gen.throw(type, value, traceback)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 167, in run_context

self.cleanup(clean_layout)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 89, in cleanup

self.layout.cleanup()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 73, in cleanup

self.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

==============================================

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 58ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

==============================================

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 165, in run_context

yield

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/usr/lib/python3.5/contextlib.py”, line 77, in exit

self.gen.throw(type, value, traceback)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 167, in run_context

self.cleanup(clean_layout)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 89, in cleanup

self.layout.cleanup()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 73, in cleanup

self.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

On Sunday, February 4, 2018 at 10:50:18 PM UTC-6, Diddy Wolf wrote:

I have two allpixels for my current project, both of which will be controlling about 400 leds. In stress testing this setup to make sure my rpi can handle running it, I started up two instances of bp with the same project, only chancing the device_id.

{

“driver”: {

“typename”: “serial”,

“num”: 400,

“ledtype”: “APA102”,

“device_id”: X,

“c_order”: “bgr”

},

“layout”: {

“typename”: “bibliopixel.layout.strip.Strip”

},

“animation”: {

“typename”: “BiblioPixelAnimations.strip.Rainbows.RainbowCycle”

},

“run”: {

“fps”: 30

},

“path”: “/development/BiblioPixelAnimations”

}

Running one works fine. Running both, most of the time, seems to work fine. However, occasionally when I startup the second instance, the already running instance will terminate with one of the following errors.

TypeError: error() got an unexpected keyword argument ‘fail’

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

These failures seem to always occur within a few seconds. If it runs longer than that, it has stayed stable for at lest 30 minutes.

Are there issues with running multiple instances of bp, both controlling serial devices?

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/dc91c93a-ec14-42d1-ac85-9a70febb2d25%40googlegroups.com.

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

/t

https://tom.ritchford.com

https://tom.swirly.com


/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/e174c729-287d-411f-8104-5b7d35883fb7%40googlegroups.com.

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


/t

https://tom.ritchford.com

https://tom.swirly.com

Adam and Tom,

Please find my answers inline below.

  • What Raspberry Pi are you using?

It’s a Pi 3 B.

  • Are you running the latest version of Raspbian? Or are you using something other than Raspbian?

It’s running the latest Raspbian Stretch Lite.

  • Are you running the Pi without without X windows running?

Lite, so no X.

  • How are you powering your Pi? It may not be getting enough power and therefore the AllPixels aren’t. Is there a lightning bolt icon or rainbow square in the top right of the screen on the Pi? If so, you don’t have enough power.

Not sure how to verify that from the cli, but the Pi is being powered by a 2.5a adaptor. The two AllPixels are the only connected devices.

  • How are you powering the LEDs? Through the barrel jack on the AllPixel or from USB power?

Not using the barrel jack currently as I don’t have the plugs setup to do so, but the final setup will likely be using them for the first section of leds. I’ve also got half a dozen powertap boards to inject power further down each strip in the final setup.

My test setup however is much simpler. I’ve got two full spools of leds (5m / 150 leds each), one hooked up to each AllPixel. The led strips have an extra set of power leads at each end, and I’ve connected both spools directly to a 5v 40a power supply.

  • How exactly are you starting each of the bibliopixel instances. Please provide the full command/script/project/etc.

I have the following project in two files, one set to device 1 and one set to device 2.

{

“driver”: {

“typename”: “serial”,

“num”: 400,

“ledtype”: “APA102”,

“device_id”: X,

“c_order”: “bgr”

},

“layout”: {

“typename”: “bibliopixel.layout.strip.Strip”

},

“animation”: {

“typename”: “BiblioPixelAnimations.strip.Rainbows.RainbowCycle”

},

“run”: {

“fps”: 30

},

“path”: “/development/BiblioPixelAnimations”

}

Yes, this project specifies 400 leds even though there are only 150 connected. This was originally intended as a stress test to make sure the Pi would keep up the frame rate when generating the animation for the full setup (each AllPixel will be controlling ~380 leds in the final setup). Correct me if I’m wrong, but I don’t believe there is any way for the AllPixel to know that there aren’t 400 leds connected so this shouldn’t cause any functional issue.

For my test, I’m opening two SSH sessions to the Pi, and running the command below (again, one for each device id) in each of them.

bp run -v stress_test_devX.json

I’ll start one for device 1, I wait for it to start up and the leds to start showing the animation, then I’ll start the second device in the other window. If the failure is going to occur, it so far has always happened within about 30 seconds for the opposite device from the one I just started. So, if I start 1, then 2, once 2 is running 1 may fail. For testing this issue, I’ll alternate back and forth between both devices, terminating one of them with ctrl+c and then starting it back up, waiting 30 seconds to see if the opposite instance fails, then stopping and starting that other instance. The failure has happened in both directions (when starting device 1, device 2 has failed, and when starting device 2, device 1 has failed).

My reasoning for testing in this way is that I’m considering writing my own front end code to manage the whole room, since I want to be able to control the separate sections. I foresee a case where I may want to change just one of the two strips, so my front end code would stop and start only one of the bp instances.

I’ll try that development branch soon and let y’all know how that goes. Might take me a bit longer to try on Windows since I don’t have a python environment setup on my Windows box.

Thanks for all the help on this.

···

On Saturday, February 17, 2018 at 5:56:16 AM UTC-6, Adam Haile wrote:

Diddy,

So, there’s a ton of things that couple possibly cause that issue. 99.9% of the time it’s not an issue but on super rare occasions I’ve seen that. I think you are #3 in almost 4 years.

Let’s run through some questions and checks…

  • What Raspberry Pi are you using?
  • Are you running the latest version of Raspbian? Or are you using something other than Raspbian?
  • Are you running the Pi without without X windows running?
  • How are you powering your Pi? It may not be getting enough power and therefore the AllPixels aren’t. Is there a lightning bolt icon or rainbow square in the top right of the screen on the Pi? If so, you don’t have enough power.
  • How are you powering the LEDs? Through the barrel jack on the AllPixel or from USB power?
  • How exactly are you starting each of the bibliopixel instances. Please provide the full command/script/project/etc.

Basically when this happens there are usually 2 culprits:

  • Something is not getting enough power.
  • Something on the pi is taking up resources and it’s not getting enough cycles to properly communicate with the AllPixels.

One troubleshooting step here would be to try running this on a normal PC. Preferably a Windows PC… The reason for that is actually because the serial stack in some versions of linux is pretty bad (old Raspbian being one of them) and does not cope well with multiple serial connections at once. Windows on the other hand handles it flawlessly. I have made some displays with 3, 4, and 5 AllPixels that have trouble on Ubuntu and older Raspbian but work perfectly fine on Windows 7+
As noted though, latest Raspbian should likely be fine. This would just help confirm if it’s the AllPixels or it’s the controlling device.

On Sat, Feb 17, 2018 at 5:47 AM, Tom Swirly t...@swirly.com wrote:

So I have a pull request out now to possibly mitigate this issue.

But we aren’t seeing this issue locally so I can’t really test it… so…

Diddy, I see you wisely do everything in a virtualenv…

could I convince you/talk you through patching in this branch into your own virtualenv so that we can see if it works better??

In fact, here are the instructions…

  1. Create a temporary directory
  2. Create a fresh virtualenv in that directory (or wherever you like) and activate it
  3. Download my branch here into the directory and unzip it
  4. cd to the topmost directory of that branch
  5. Type
  • python setup.py develop
  • Now, try running your project using this virtualenv
  • When we’re all done, you can delete the whole temporary directory
    If I update the code on that branch, you can just repeat step 3 again and unzip it over the old code and you’re good to go (because you set it up with develop in step 5).

On Sat, Feb 17, 2018 at 10:31 AM, Tom Swirly t...@swirly.com wrote:

Oh, and thanks again for the clear trouble report. I’m pretty sure that given those stack traces, I can at least make it ignore the errors. Now, I expect that will result in some sort of quality issue like missed frames but those might be totally invisible to the user…

On Sat, Feb 17, 2018 at 10:30 AM, Tom Swirly t...@swirly.com wrote:

Eh, no troubles with the delay, sorry you’re having this problem!

However, it’s an interesting problem now, not a trivial one. I still don’t think the program should crash - I filed an issue here last year about this - but the fact that it’s happening so often means that there is some actual hardware issue going on here too.

I’m going to get Adam to check in on this issue from the hardware end. From my end, I’ll try to come up with a way to recover gracefully from these errors, which should not be fatal - but you shouldn’t be having them either…

The AllPixels seem to have proven to be very reliable, mainly because there isn’t much to 'em - IIRC we have yet to find an error stemming from them, but who knows how many people had issues we didn’t report. Could it be that there’s a wiring issue? An intermittent short circuit, perhaps?

On Sat, Feb 17, 2018 at 6:01 AM, Diddy Wolf didd...@gmail.com wrote:

Sorry for the delay. Upgraded to 3.4.6. Still seeing a crash occasionally. Not as readily as before (maybe once in 20 attempts?). Got two unique tracebacks this time.

======================================================

DEBUG - devices - Error getting device_id for /dev/ttyACM1, 921600

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 37ms!

ERROR - devices - There was an unknown error communicating with the device.

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

======================================================

DEBUG - devices - Error getting device_id for /dev/ttyACM0, 921600

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 120, in update_colors

self.set_device_brightness(brightness)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 121, in set_brightness

resp = ord(self._com.read(1))

TypeError: ord() expected a character, but string of length 0 found

======================================================

On Friday, February 9, 2018 at 8:26:20 AM UTC-6, Tom Swirly wrote:

Sorry for the delay here.

I just pushed a new version that at least handles the crash - you can get it by typing

pip install bibliopixel --upgrade

Try it with your issue and let me know how it goes!

On Mon, Feb 5, 2018 at 10:47 AM, Tom Swirly t...@swirly.com wrote:

This is a very clear report, thanks!

You allowed me to see that there’s a bug in handling the error where we crash where we shouldn’t - I sent out a pull request to fix that: https://github.com/ManiacalLabs/BiblioPixel/pull/611

However, why are you getting that error in the first place? I personally run with a setup much like yours and I don’t get these exceptions.

Adam will be able to weigh in on the causes of this. However, we should be able to recover from these error, perhaps without any visible effects, most likely with a bit of jitter (timing error) that will be barely unnoticeable - even if we can’t eliminate the cause of the errors.

On Mon, Feb 5, 2018 at 5:52 AM, Diddy Wolf didd...@gmail.com wrote:

I ran my test a dozen times or so with verbose logging and got the following traces.

==============================================

DEBUG - devices - Error getting device_id for /dev/ttyACM0, 921600

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 165, in run_context

yield

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/usr/lib/python3.5/contextlib.py”, line 77, in exit

self.gen.throw(type, value, traceback)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 167, in run_context

self.cleanup(clean_layout)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 89, in cleanup

self.layout.cleanup()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 73, in cleanup

self.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

==============================================

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 58ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

==============================================

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 165, in run_context

yield

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/usr/lib/python3.5/contextlib.py”, line 77, in exit

self.gen.throw(type, value, traceback)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 167, in run_context

self.cleanup(clean_layout)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 89, in cleanup

self.layout.cleanup()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 73, in cleanup

self.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

On Sunday, February 4, 2018 at 10:50:18 PM UTC-6, Diddy Wolf wrote:

I have two allpixels for my current project, both of which will be controlling about 400 leds. In stress testing this setup to make sure my rpi can handle running it, I started up two instances of bp with the same project, only chancing the device_id.

{

“driver”: {

“typename”: “serial”,

“num”: 400,

“ledtype”: “APA102”,

“device_id”: X,

“c_order”: “bgr”

},

“layout”: {

“typename”: “bibliopixel.layout.strip.Strip”

},

“animation”: {

“typename”: “BiblioPixelAnimations.strip.Rainbows.RainbowCycle”

},

“run”: {

“fps”: 30

},

“path”: “/development/BiblioPixelAnimations”

}

Running one works fine. Running both, most of the time, seems to work fine. However, occasionally when I startup the second instance, the already running instance will terminate with one of the following errors.

TypeError: error() got an unexpected keyword argument ‘fail’

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

These failures seem to always occur within a few seconds. If it runs longer than that, it has stayed stable for at lest 30 minutes.

Are there issues with running multiple instances of bp, both controlling serial devices?

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/dc91c93a-ec14-42d1-ac85-9a70febb2d25%40googlegroups.com.

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

/t

https://tom.ritchford.com

https://tom.swirly.com


/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/e174c729-287d-411f-8104-5b7d35883fb7%40googlegroups.com.

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


/t

https://tom.ritchford.com

https://tom.swirly.com


/t

https://tom.ritchford.com

https://tom.swirly.com


/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/CAOuQWfXZb7mzghDoKrUS0po%3Di4vA6GQEv%2Bkq4bN2UwtY8H9-Nw%40mail.gmail.com.

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

Yeah… it’s power. You are trying to drive all your LEDs off USB power. That’s not going to work. Max is about 60 LEDs total from USB power. And you have two AllPixels.
Also… 2.5A is not always 2.5A. That’s usually a max value. Is it a phone charge style power adapter? If so, the device needs to negotiate for >500mA and the Raspberry Pi doesn’t do that. You need a “dump” supply. The basic rule there is that if the adapter has a USB port on it, you won’t get more than 500mA on the Pi. If the USB cable is permanently attached, it’s probably a dumb supply and will work.

Try disconnecting your LEDs from the AllPixels entirely and running your tests again. That way the LEDs aren’t trying to draw more power than the pi can supply.

···

On Sat, Feb 17, 2018 at 12:11 PM, Diddy Wolf diddywolf@gmail.com wrote:

Adam and Tom,

Please find my answers inline below.

  • What Raspberry Pi are you using?

It’s a Pi 3 B.

  • Are you running the latest version of Raspbian? Or are you using something other than Raspbian?

It’s running the latest Raspbian Stretch Lite.

  • Are you running the Pi without without X windows running?

Lite, so no X.

  • How are you powering your Pi? It may not be getting enough power and therefore the AllPixels aren’t. Is there a lightning bolt icon or rainbow square in the top right of the screen on the Pi? If so, you don’t have enough power.

Not sure how to verify that from the cli, but the Pi is being powered by a 2.5a adaptor. The two AllPixels are the only connected devices.

  • How are you powering the LEDs? Through the barrel jack on the AllPixel or from USB power?

Not using the barrel jack currently as I don’t have the plugs setup to do so, but the final setup will likely be using them for the first section of leds. I’ve also got half a dozen powertap boards to inject power further down each strip in the final setup.

My test setup however is much simpler. I’ve got two full spools of leds (5m / 150 leds each), one hooked up to each AllPixel. The led strips have an extra set of power leads at each end, and I’ve connected both spools directly to a 5v 40a power supply.

  • How exactly are you starting each of the bibliopixel instances. Please provide the full command/script/project/etc.

I have the following project in two files, one set to device 1 and one set to device 2.

{

“driver”: {

“typename”: “serial”,

“num”: 400,

“ledtype”: “APA102”,

“device_id”: X,

“c_order”: “bgr”

},

“layout”: {

“typename”: “bibliopixel.layout.strip.Strip”

},

“animation”: {

“typename”: “BiblioPixelAnimations.strip.Rainbows.RainbowCycle”

},

“run”: {

“fps”: 30

},

“path”: “/development/BiblioPixelAnimations”

}

Yes, this project specifies 400 leds even though there are only 150 connected. This was originally intended as a stress test to make sure the Pi would keep up the frame rate when generating the animation for the full setup (each AllPixel will be controlling ~380 leds in the final setup). Correct me if I’m wrong, but I don’t believe there is any way for the AllPixel to know that there aren’t 400 leds connected so this shouldn’t cause any functional issue.

For my test, I’m opening two SSH sessions to the Pi, and running the command below (again, one for each device id) in each of them.

bp run -v stress_test_devX.json

I’ll start one for device 1, I wait for it to start up and the leds to start showing the animation, then I’ll start the second device in the other window. If the failure is going to occur, it so far has always happened within about 30 seconds for the opposite device from the one I just started. So, if I start 1, then 2, once 2 is running 1 may fail. For testing this issue, I’ll alternate back and forth between both devices, terminating one of them with ctrl+c and then starting it back up, waiting 30 seconds to see if the opposite instance fails, then stopping and starting that other instance. The failure has happened in both directions (when starting device 1, device 2 has failed, and when starting device 2, device 1 has failed).

My reasoning for testing in this way is that I’m considering writing my own front end code to manage the whole room, since I want to be able to control the separate sections. I foresee a case where I may want to change just one of the two strips, so my front end code would stop and start only one of the bp instances.

I’ll try that development branch soon and let y’all know how that goes. Might take me a bit longer to try on Windows since I don’t have a python environment setup on my Windows box.

Thanks for all the help on this.

On Saturday, February 17, 2018 at 5:56:16 AM UTC-6, Adam Haile wrote:

Diddy,

So, there’s a ton of things that couple possibly cause that issue. 99.9% of the time it’s not an issue but on super rare occasions I’ve seen that. I think you are #3 in almost 4 years.

Let’s run through some questions and checks…

  • What Raspberry Pi are you using?
  • Are you running the latest version of Raspbian? Or are you using something other than Raspbian?
  • Are you running the Pi without without X windows running?
  • How are you powering your Pi? It may not be getting enough power and therefore the AllPixels aren’t. Is there a lightning bolt icon or rainbow square in the top right of the screen on the Pi? If so, you don’t have enough power.
  • How are you powering the LEDs? Through the barrel jack on the AllPixel or from USB power?
  • How exactly are you starting each of the bibliopixel instances. Please provide the full command/script/project/etc.

Basically when this happens there are usually 2 culprits:

  • Something is not getting enough power.
  • Something on the pi is taking up resources and it’s not getting enough cycles to properly communicate with the AllPixels.

One troubleshooting step here would be to try running this on a normal PC. Preferably a Windows PC… The reason for that is actually because the serial stack in some versions of linux is pretty bad (old Raspbian being one of them) and does not cope well with multiple serial connections at once. Windows on the other hand handles it flawlessly. I have made some displays with 3, 4, and 5 AllPixels that have trouble on Ubuntu and older Raspbian but work perfectly fine on Windows 7+
As noted though, latest Raspbian should likely be fine. This would just help confirm if it’s the AllPixels or it’s the controlling device.

On Sat, Feb 17, 2018 at 5:47 AM, Tom Swirly t...@swirly.com wrote:

So I have a pull request out now to possibly mitigate this issue.

But we aren’t seeing this issue locally so I can’t really test it… so…

Diddy, I see you wisely do everything in a virtualenv…

could I convince you/talk you through patching in this branch into your own virtualenv so that we can see if it works better??

In fact, here are the instructions…

  1. Create a temporary directory
  2. Create a fresh virtualenv in that directory (or wherever you like) and activate it
  3. Download my branch here into the directory and unzip it
  4. cd to the topmost directory of that branch
  5. Type
  • python setup.py develop
  • Now, try running your project using this virtualenv
  • When we’re all done, you can delete the whole temporary directory
    If I update the code on that branch, you can just repeat step 3 again and unzip it over the old code and you’re good to go (because you set it up with develop in step 5).

On Sat, Feb 17, 2018 at 10:31 AM, Tom Swirly t...@swirly.com wrote:

Oh, and thanks again for the clear trouble report. I’m pretty sure that given those stack traces, I can at least make it ignore the errors. Now, I expect that will result in some sort of quality issue like missed frames but those might be totally invisible to the user…

On Sat, Feb 17, 2018 at 10:30 AM, Tom Swirly t...@swirly.com wrote:

Eh, no troubles with the delay, sorry you’re having this problem!

However, it’s an interesting problem now, not a trivial one. I still don’t think the program should crash - I filed an issue here last year about this - but the fact that it’s happening so often means that there is some actual hardware issue going on here too.

I’m going to get Adam to check in on this issue from the hardware end. From my end, I’ll try to come up with a way to recover gracefully from these errors, which should not be fatal - but you shouldn’t be having them either…

The AllPixels seem to have proven to be very reliable, mainly because there isn’t much to 'em - IIRC we have yet to find an error stemming from them, but who knows how many people had issues we didn’t report. Could it be that there’s a wiring issue? An intermittent short circuit, perhaps?

On Sat, Feb 17, 2018 at 6:01 AM, Diddy Wolf didd...@gmail.com wrote:

Sorry for the delay. Upgraded to 3.4.6. Still seeing a crash occasionally. Not as readily as before (maybe once in 20 attempts?). Got two unique tracebacks this time.

======================================================

DEBUG - devices - Error getting device_id for /dev/ttyACM1, 921600

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 37ms!

ERROR - devices - There was an unknown error communicating with the device.

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

======================================================

DEBUG - devices - Error getting device_id for /dev/ttyACM0, 921600

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 120, in update_colors

self.set_device_brightness(brightness)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 121, in set_brightness

resp = ord(self._com.read(1))

TypeError: ord() expected a character, but string of length 0 found

======================================================

On Friday, February 9, 2018 at 8:26:20 AM UTC-6, Tom Swirly wrote:

Sorry for the delay here.

I just pushed a new version that at least handles the crash - you can get it by typing

pip install bibliopixel --upgrade

Try it with your issue and let me know how it goes!

On Mon, Feb 5, 2018 at 10:47 AM, Tom Swirly t...@swirly.com wrote:

This is a very clear report, thanks!

You allowed me to see that there’s a bug in handling the error where we crash where we shouldn’t - I sent out a pull request to fix that: https://github.com/ManiacalLabs/BiblioPixel/pull/611

However, why are you getting that error in the first place? I personally run with a setup much like yours and I don’t get these exceptions.

Adam will be able to weigh in on the causes of this. However, we should be able to recover from these error, perhaps without any visible effects, most likely with a bit of jitter (timing error) that will be barely unnoticeable - even if we can’t eliminate the cause of the errors.

On Mon, Feb 5, 2018 at 5:52 AM, Diddy Wolf didd...@gmail.com wrote:

I ran my test a dozen times or so with verbose logging and got the following traces.

==============================================

DEBUG - devices - Error getting device_id for /dev/ttyACM0, 921600

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 165, in run_context

yield

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/usr/lib/python3.5/contextlib.py”, line 77, in exit

self.gen.throw(type, value, traceback)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 167, in run_context

self.cleanup(clean_layout)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 89, in cleanup

self.layout.cleanup()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 73, in cleanup

self.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

==============================================

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 58ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

==============================================

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 165, in run_context

yield

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/usr/lib/python3.5/contextlib.py”, line 77, in exit

self.gen.throw(type, value, traceback)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 167, in run_context

self.cleanup(clean_layout)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 89, in cleanup

self.layout.cleanup()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 73, in cleanup

self.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

On Sunday, February 4, 2018 at 10:50:18 PM UTC-6, Diddy Wolf wrote:

I have two allpixels for my current project, both of which will be controlling about 400 leds. In stress testing this setup to make sure my rpi can handle running it, I started up two instances of bp with the same project, only chancing the device_id.

{

“driver”: {

“typename”: “serial”,

“num”: 400,

“ledtype”: “APA102”,

“device_id”: X,

“c_order”: “bgr”

},

“layout”: {

“typename”: “bibliopixel.layout.strip.Strip”

},

“animation”: {

“typename”: “BiblioPixelAnimations.strip.Rainbows.RainbowCycle”

},

“run”: {

“fps”: 30

},

“path”: “/development/BiblioPixelAnimations”

}

Running one works fine. Running both, most of the time, seems to work fine. However, occasionally when I startup the second instance, the already running instance will terminate with one of the following errors.

TypeError: error() got an unexpected keyword argument ‘fail’

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

These failures seem to always occur within a few seconds. If it runs longer than that, it has stayed stable for at lest 30 minutes.

Are there issues with running multiple instances of bp, both controlling serial devices?

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/dc91c93a-ec14-42d1-ac85-9a70febb2d25%40googlegroups.com.

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

/t

https://tom.ritchford.com

https://tom.swirly.com


/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/e174c729-287d-411f-8104-5b7d35883fb7%40googlegroups.com.

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


/t

https://tom.ritchford.com

https://tom.swirly.com


/t

https://tom.ritchford.com

https://tom.swirly.com


/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/CAOuQWfXZb7mzghDoKrUS0po%3Di4vA6GQEv%2Bkq4bN2UwtY8H9-Nw%40mail.gmail.com.

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

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/116047a9-2da3-41f4-8f88-815f62433386%40googlegroups.com.

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

The LED strips aren’t being powered by USB. They’re connected to an 5v 40a power supply. That’s the gray brick at the bottom of the photo I posted.

In either case, I disconnected the LED strips and I can still replicate the issue.

···

======================================================

DEBUG - devices - Error getting device_id for /dev/ttyACM0, 921600

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

======================================================

DEBUG - devices - Error getting device_id for /dev/ttyACM1, 921600

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 120, in update_colors

self.set_device_brightness(brightness)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 121, in set_brightness

resp = ord(self._com.read(1))

TypeError: ord() expected a character, but string of length 0 found

======================================================

On Saturday, February 17, 2018 at 11:20:05 AM UTC-6, Adam Haile wrote:

Yeah… it’s power. You are trying to drive all your LEDs off USB power. That’s not going to work. Max is about 60 LEDs total from USB power. And you have two AllPixels.
Also… 2.5A is not always 2.5A. That’s usually a max value. Is it a phone charge style power adapter? If so, the device needs to negotiate for >500mA and the Raspberry Pi doesn’t do that. You need a “dump” supply. The basic rule there is that if the adapter has a USB port on it, you won’t get more than 500mA on the Pi. If the USB cable is permanently attached, it’s probably a dumb supply and will work.

Try disconnecting your LEDs from the AllPixels entirely and running your tests again. That way the LEDs aren’t trying to draw more power than the pi can supply.

On Sat, Feb 17, 2018 at 12:11 PM, Diddy Wolf didd...@gmail.com wrote:

Adam and Tom,

Please find my answers inline below.

  • What Raspberry Pi are you using?

It’s a Pi 3 B.

  • Are you running the latest version of Raspbian? Or are you using something other than Raspbian?

It’s running the latest Raspbian Stretch Lite.

  • Are you running the Pi without without X windows running?

Lite, so no X.

  • How are you powering your Pi? It may not be getting enough power and therefore the AllPixels aren’t. Is there a lightning bolt icon or rainbow square in the top right of the screen on the Pi? If so, you don’t have enough power.

Not sure how to verify that from the cli, but the Pi is being powered by a 2.5a adaptor. The two AllPixels are the only connected devices.

  • How are you powering the LEDs? Through the barrel jack on the AllPixel or from USB power?

Not using the barrel jack currently as I don’t have the plugs setup to do so, but the final setup will likely be using them for the first section of leds. I’ve also got half a dozen powertap boards to inject power further down each strip in the final setup.

My test setup however is much simpler. I’ve got two full spools of leds (5m / 150 leds each), one hooked up to each AllPixel. The led strips have an extra set of power leads at each end, and I’ve connected both spools directly to a 5v 40a power supply.

  • How exactly are you starting each of the bibliopixel instances. Please provide the full command/script/project/etc.

I have the following project in two files, one set to device 1 and one set to device 2.

{

“driver”: {

“typename”: “serial”,

“num”: 400,

“ledtype”: “APA102”,

“device_id”: X,

“c_order”: “bgr”

},

“layout”: {

“typename”: “bibliopixel.layout.strip.Strip”

},

“animation”: {

“typename”: “BiblioPixelAnimations.strip.Rainbows.RainbowCycle”

},

“run”: {

“fps”: 30

},

“path”: “/development/BiblioPixelAnimations”

}

Yes, this project specifies 400 leds even though there are only 150 connected. This was originally intended as a stress test to make sure the Pi would keep up the frame rate when generating the animation for the full setup (each AllPixel will be controlling ~380 leds in the final setup). Correct me if I’m wrong, but I don’t believe there is any way for the AllPixel to know that there aren’t 400 leds connected so this shouldn’t cause any functional issue.

For my test, I’m opening two SSH sessions to the Pi, and running the command below (again, one for each device id) in each of them.

bp run -v stress_test_devX.json

I’ll start one for device 1, I wait for it to start up and the leds to start showing the animation, then I’ll start the second device in the other window. If the failure is going to occur, it so far has always happened within about 30 seconds for the opposite device from the one I just started. So, if I start 1, then 2, once 2 is running 1 may fail. For testing this issue, I’ll alternate back and forth between both devices, terminating one of them with ctrl+c and then starting it back up, waiting 30 seconds to see if the opposite instance fails, then stopping and starting that other instance. The failure has happened in both directions (when starting device 1, device 2 has failed, and when starting device 2, device 1 has failed).

My reasoning for testing in this way is that I’m considering writing my own front end code to manage the whole room, since I want to be able to control the separate sections. I foresee a case where I may want to change just one of the two strips, so my front end code would stop and start only one of the bp instances.

I’ll try that development branch soon and let y’all know how that goes. Might take me a bit longer to try on Windows since I don’t have a python environment setup on my Windows box.

Thanks for all the help on this.

On Saturday, February 17, 2018 at 5:56:16 AM UTC-6, Adam Haile wrote:

Diddy,

So, there’s a ton of things that couple possibly cause that issue. 99.9% of the time it’s not an issue but on super rare occasions I’ve seen that. I think you are #3 in almost 4 years.

Let’s run through some questions and checks…

  • What Raspberry Pi are you using?
  • Are you running the latest version of Raspbian? Or are you using something other than Raspbian?
  • Are you running the Pi without without X windows running?
  • How are you powering your Pi? It may not be getting enough power and therefore the AllPixels aren’t. Is there a lightning bolt icon or rainbow square in the top right of the screen on the Pi? If so, you don’t have enough power.
  • How are you powering the LEDs? Through the barrel jack on the AllPixel or from USB power?
  • How exactly are you starting each of the bibliopixel instances. Please provide the full command/script/project/etc.

Basically when this happens there are usually 2 culprits:

  • Something is not getting enough power.
  • Something on the pi is taking up resources and it’s not getting enough cycles to properly communicate with the AllPixels.

One troubleshooting step here would be to try running this on a normal PC. Preferably a Windows PC… The reason for that is actually because the serial stack in some versions of linux is pretty bad (old Raspbian being one of them) and does not cope well with multiple serial connections at once. Windows on the other hand handles it flawlessly. I have made some displays with 3, 4, and 5 AllPixels that have trouble on Ubuntu and older Raspbian but work perfectly fine on Windows 7+
As noted though, latest Raspbian should likely be fine. This would just help confirm if it’s the AllPixels or it’s the controlling device.

On Sat, Feb 17, 2018 at 5:47 AM, Tom Swirly t...@swirly.com wrote:

So I have a pull request out now to possibly mitigate this issue.

But we aren’t seeing this issue locally so I can’t really test it… so…

Diddy, I see you wisely do everything in a virtualenv…

could I convince you/talk you through patching in this branch into your own virtualenv so that we can see if it works better??

In fact, here are the instructions…

  1. Create a temporary directory
  2. Create a fresh virtualenv in that directory (or wherever you like) and activate it
  3. Download my branch here into the directory and unzip it
  4. cd to the topmost directory of that branch
  5. Type
  • python setup.py develop
  • Now, try running your project using this virtualenv
  • When we’re all done, you can delete the whole temporary directory
    If I update the code on that branch, you can just repeat step 3 again and unzip it over the old code and you’re good to go (because you set it up with develop in step 5).

On Sat, Feb 17, 2018 at 10:31 AM, Tom Swirly t...@swirly.com wrote:

Oh, and thanks again for the clear trouble report. I’m pretty sure that given those stack traces, I can at least make it ignore the errors. Now, I expect that will result in some sort of quality issue like missed frames but those might be totally invisible to the user…

On Sat, Feb 17, 2018 at 10:30 AM, Tom Swirly t...@swirly.com wrote:

Eh, no troubles with the delay, sorry you’re having this problem!

However, it’s an interesting problem now, not a trivial one. I still don’t think the program should crash - I filed an issue here last year about this - but the fact that it’s happening so often means that there is some actual hardware issue going on here too.

I’m going to get Adam to check in on this issue from the hardware end. From my end, I’ll try to come up with a way to recover gracefully from these errors, which should not be fatal - but you shouldn’t be having them either…

The AllPixels seem to have proven to be very reliable, mainly because there isn’t much to 'em - IIRC we have yet to find an error stemming from them, but who knows how many people had issues we didn’t report. Could it be that there’s a wiring issue? An intermittent short circuit, perhaps?

On Sat, Feb 17, 2018 at 6:01 AM, Diddy Wolf didd...@gmail.com wrote:

Sorry for the delay. Upgraded to 3.4.6. Still seeing a crash occasionally. Not as readily as before (maybe once in 20 attempts?). Got two unique tracebacks this time.

======================================================

DEBUG - devices - Error getting device_id for /dev/ttyACM1, 921600

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 37ms!

ERROR - devices - There was an unknown error communicating with the device.

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

======================================================

DEBUG - devices - Error getting device_id for /dev/ttyACM0, 921600

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 120, in update_colors

self.set_device_brightness(brightness)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 121, in set_brightness

resp = ord(self._com.read(1))

TypeError: ord() expected a character, but string of length 0 found

======================================================

On Friday, February 9, 2018 at 8:26:20 AM UTC-6, Tom Swirly wrote:

Sorry for the delay here.

I just pushed a new version that at least handles the crash - you can get it by typing

pip install bibliopixel --upgrade

Try it with your issue and let me know how it goes!

On Mon, Feb 5, 2018 at 10:47 AM, Tom Swirly t...@swirly.com wrote:

This is a very clear report, thanks!

You allowed me to see that there’s a bug in handling the error where we crash where we shouldn’t - I sent out a pull request to fix that: https://github.com/ManiacalLabs/BiblioPixel/pull/611

However, why are you getting that error in the first place? I personally run with a setup much like yours and I don’t get these exceptions.

Adam will be able to weigh in on the causes of this. However, we should be able to recover from these error, perhaps without any visible effects, most likely with a bit of jitter (timing error) that will be barely unnoticeable - even if we can’t eliminate the cause of the errors.

On Mon, Feb 5, 2018 at 5:52 AM, Diddy Wolf didd...@gmail.com wrote:

I ran my test a dozen times or so with verbose logging and got the following traces.

==============================================

DEBUG - devices - Error getting device_id for /dev/ttyACM0, 921600

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 165, in run_context

yield

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/usr/lib/python3.5/contextlib.py”, line 77, in exit

self.gen.throw(type, value, traceback)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 167, in run_context

self.cleanup(clean_layout)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 89, in cleanup

self.layout.cleanup()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 73, in cleanup

self.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

==============================================

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 58ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

==============================================

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 165, in run_context

yield

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/usr/lib/python3.5/contextlib.py”, line 77, in exit

self.gen.throw(type, value, traceback)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 167, in run_context

self.cleanup(clean_layout)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 89, in cleanup

self.layout.cleanup()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 73, in cleanup

self.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

On Sunday, February 4, 2018 at 10:50:18 PM UTC-6, Diddy Wolf wrote:

I have two allpixels for my current project, both of which will be controlling about 400 leds. In stress testing this setup to make sure my rpi can handle running it, I started up two instances of bp with the same project, only chancing the device_id.

{

“driver”: {

“typename”: “serial”,

“num”: 400,

“ledtype”: “APA102”,

“device_id”: X,

“c_order”: “bgr”

},

“layout”: {

“typename”: “bibliopixel.layout.strip.Strip”

},

“animation”: {

“typename”: “BiblioPixelAnimations.strip.Rainbows.RainbowCycle”

},

“run”: {

“fps”: 30

},

“path”: “/development/BiblioPixelAnimations”

}

Running one works fine. Running both, most of the time, seems to work fine. However, occasionally when I startup the second instance, the already running instance will terminate with one of the following errors.

TypeError: error() got an unexpected keyword argument ‘fail’

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

These failures seem to always occur within a few seconds. If it runs longer than that, it has stayed stable for at lest 30 minutes.

Are there issues with running multiple instances of bp, both controlling serial devices?

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/dc91c93a-ec14-42d1-ac85-9a70febb2d25%40googlegroups.com.

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

/t

https://tom.ritchford.com

https://tom.swirly.com


/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/e174c729-287d-411f-8104-5b7d35883fb7%40googlegroups.com.

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


/t

https://tom.ritchford.com

https://tom.swirly.com


/t

https://tom.ritchford.com

https://tom.swirly.com


/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/CAOuQWfXZb7mzghDoKrUS0po%3Di4vA6GQEv%2Bkq4bN2UwtY8H9-Nw%40mail.gmail.com.

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

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/116047a9-2da3-41f4-8f88-815f62433386%40googlegroups.com.

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

Ah, sorry… I misunderstood. I still wonder if your supply for the Pi itself is actually giving the right about of current. Do you have it connected to a monitor? If so, look for that lightning bolt icon.

···

On Sat, Feb 17, 2018 at 12:37 PM, Diddy Wolf diddywolf@gmail.com wrote:

The LED strips aren’t being powered by USB. They’re connected to an 5v 40a power supply. That’s the gray brick at the bottom of the photo I posted.

In either case, I disconnected the LED strips and I can still replicate the issue.

======================================================

DEBUG - devices - Error getting device_id for /dev/ttyACM0, 921600

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

======================================================

DEBUG - devices - Error getting device_id for /dev/ttyACM1, 921600

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 120, in update_colors

self.set_device_brightness(brightness)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 121, in set_brightness

resp = ord(self._com.read(1))

TypeError: ord() expected a character, but string of length 0 found

======================================================

On Saturday, February 17, 2018 at 11:20:05 AM UTC-6, Adam Haile wrote:

Yeah… it’s power. You are trying to drive all your LEDs off USB power. That’s not going to work. Max is about 60 LEDs total from USB power. And you have two AllPixels.
Also… 2.5A is not always 2.5A. That’s usually a max value. Is it a phone charge style power adapter? If so, the device needs to negotiate for >500mA and the Raspberry Pi doesn’t do that. You need a “dump” supply. The basic rule there is that if the adapter has a USB port on it, you won’t get more than 500mA on the Pi. If the USB cable is permanently attached, it’s probably a dumb supply and will work.

Try disconnecting your LEDs from the AllPixels entirely and running your tests again. That way the LEDs aren’t trying to draw more power than the pi can supply.

On Sat, Feb 17, 2018 at 12:11 PM, Diddy Wolf didd...@gmail.com wrote:

Adam and Tom,

Please find my answers inline below.

  • What Raspberry Pi are you using?

It’s a Pi 3 B.

  • Are you running the latest version of Raspbian? Or are you using something other than Raspbian?

It’s running the latest Raspbian Stretch Lite.

  • Are you running the Pi without without X windows running?

Lite, so no X.

  • How are you powering your Pi? It may not be getting enough power and therefore the AllPixels aren’t. Is there a lightning bolt icon or rainbow square in the top right of the screen on the Pi? If so, you don’t have enough power.

Not sure how to verify that from the cli, but the Pi is being powered by a 2.5a adaptor. The two AllPixels are the only connected devices.

  • How are you powering the LEDs? Through the barrel jack on the AllPixel or from USB power?

Not using the barrel jack currently as I don’t have the plugs setup to do so, but the final setup will likely be using them for the first section of leds. I’ve also got half a dozen powertap boards to inject power further down each strip in the final setup.

My test setup however is much simpler. I’ve got two full spools of leds (5m / 150 leds each), one hooked up to each AllPixel. The led strips have an extra set of power leads at each end, and I’ve connected both spools directly to a 5v 40a power supply.

  • How exactly are you starting each of the bibliopixel instances. Please provide the full command/script/project/etc.

I have the following project in two files, one set to device 1 and one set to device 2.

{

“driver”: {

“typename”: “serial”,

“num”: 400,

“ledtype”: “APA102”,

“device_id”: X,

“c_order”: “bgr”

},

“layout”: {

“typename”: “bibliopixel.layout.strip.Strip”

},

“animation”: {

“typename”: “BiblioPixelAnimations.strip.Rainbows.RainbowCycle”

},

“run”: {

“fps”: 30

},

“path”: “/development/BiblioPixelAnimations”

}

Yes, this project specifies 400 leds even though there are only 150 connected. This was originally intended as a stress test to make sure the Pi would keep up the frame rate when generating the animation for the full setup (each AllPixel will be controlling ~380 leds in the final setup). Correct me if I’m wrong, but I don’t believe there is any way for the AllPixel to know that there aren’t 400 leds connected so this shouldn’t cause any functional issue.

For my test, I’m opening two SSH sessions to the Pi, and running the command below (again, one for each device id) in each of them.

bp run -v stress_test_devX.json

I’ll start one for device 1, I wait for it to start up and the leds to start showing the animation, then I’ll start the second device in the other window. If the failure is going to occur, it so far has always happened within about 30 seconds for the opposite device from the one I just started. So, if I start 1, then 2, once 2 is running 1 may fail. For testing this issue, I’ll alternate back and forth between both devices, terminating one of them with ctrl+c and then starting it back up, waiting 30 seconds to see if the opposite instance fails, then stopping and starting that other instance. The failure has happened in both directions (when starting device 1, device 2 has failed, and when starting device 2, device 1 has failed).

My reasoning for testing in this way is that I’m considering writing my own front end code to manage the whole room, since I want to be able to control the separate sections. I foresee a case where I may want to change just one of the two strips, so my front end code would stop and start only one of the bp instances.

I’ll try that development branch soon and let y’all know how that goes. Might take me a bit longer to try on Windows since I don’t have a python environment setup on my Windows box.

Thanks for all the help on this.

On Saturday, February 17, 2018 at 5:56:16 AM UTC-6, Adam Haile wrote:

Diddy,

So, there’s a ton of things that couple possibly cause that issue. 99.9% of the time it’s not an issue but on super rare occasions I’ve seen that. I think you are #3 in almost 4 years.

Let’s run through some questions and checks…

  • What Raspberry Pi are you using?
  • Are you running the latest version of Raspbian? Or are you using something other than Raspbian?
  • Are you running the Pi without without X windows running?
  • How are you powering your Pi? It may not be getting enough power and therefore the AllPixels aren’t. Is there a lightning bolt icon or rainbow square in the top right of the screen on the Pi? If so, you don’t have enough power.
  • How are you powering the LEDs? Through the barrel jack on the AllPixel or from USB power?
  • How exactly are you starting each of the bibliopixel instances. Please provide the full command/script/project/etc.

Basically when this happens there are usually 2 culprits:

  • Something is not getting enough power.
  • Something on the pi is taking up resources and it’s not getting enough cycles to properly communicate with the AllPixels.

One troubleshooting step here would be to try running this on a normal PC. Preferably a Windows PC… The reason for that is actually because the serial stack in some versions of linux is pretty bad (old Raspbian being one of them) and does not cope well with multiple serial connections at once. Windows on the other hand handles it flawlessly. I have made some displays with 3, 4, and 5 AllPixels that have trouble on Ubuntu and older Raspbian but work perfectly fine on Windows 7+
As noted though, latest Raspbian should likely be fine. This would just help confirm if it’s the AllPixels or it’s the controlling device.

On Sat, Feb 17, 2018 at 5:47 AM, Tom Swirly t...@swirly.com wrote:

So I have a pull request out now to possibly mitigate this issue.

But we aren’t seeing this issue locally so I can’t really test it… so…

Diddy, I see you wisely do everything in a virtualenv…

could I convince you/talk you through patching in this branch into your own virtualenv so that we can see if it works better??

In fact, here are the instructions…

  1. Create a temporary directory
  2. Create a fresh virtualenv in that directory (or wherever you like) and activate it
  3. Download my branch here into the directory and unzip it
  4. cd to the topmost directory of that branch
  5. Type
  • python setup.py develop
  • Now, try running your project using this virtualenv
  • When we’re all done, you can delete the whole temporary directory
    If I update the code on that branch, you can just repeat step 3 again and unzip it over the old code and you’re good to go (because you set it up with develop in step 5).

On Sat, Feb 17, 2018 at 10:31 AM, Tom Swirly t...@swirly.com wrote:

Oh, and thanks again for the clear trouble report. I’m pretty sure that given those stack traces, I can at least make it ignore the errors. Now, I expect that will result in some sort of quality issue like missed frames but those might be totally invisible to the user…

On Sat, Feb 17, 2018 at 10:30 AM, Tom Swirly t...@swirly.com wrote:

Eh, no troubles with the delay, sorry you’re having this problem!

However, it’s an interesting problem now, not a trivial one. I still don’t think the program should crash - I filed an issue here last year about this - but the fact that it’s happening so often means that there is some actual hardware issue going on here too.

I’m going to get Adam to check in on this issue from the hardware end. From my end, I’ll try to come up with a way to recover gracefully from these errors, which should not be fatal - but you shouldn’t be having them either…

The AllPixels seem to have proven to be very reliable, mainly because there isn’t much to 'em - IIRC we have yet to find an error stemming from them, but who knows how many people had issues we didn’t report. Could it be that there’s a wiring issue? An intermittent short circuit, perhaps?

On Sat, Feb 17, 2018 at 6:01 AM, Diddy Wolf didd...@gmail.com wrote:

Sorry for the delay. Upgraded to 3.4.6. Still seeing a crash occasionally. Not as readily as before (maybe once in 20 attempts?). Got two unique tracebacks this time.

======================================================

DEBUG - devices - Error getting device_id for /dev/ttyACM1, 921600

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 37ms!

ERROR - devices - There was an unknown error communicating with the device.

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

======================================================

DEBUG - devices - Error getting device_id for /dev/ttyACM0, 921600

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 120, in update_colors

self.set_device_brightness(brightness)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 121, in set_brightness

resp = ord(self._com.read(1))

TypeError: ord() expected a character, but string of length 0 found

======================================================

On Friday, February 9, 2018 at 8:26:20 AM UTC-6, Tom Swirly wrote:

Sorry for the delay here.

I just pushed a new version that at least handles the crash - you can get it by typing

pip install bibliopixel --upgrade

Try it with your issue and let me know how it goes!

On Mon, Feb 5, 2018 at 10:47 AM, Tom Swirly t...@swirly.com wrote:

This is a very clear report, thanks!

You allowed me to see that there’s a bug in handling the error where we crash where we shouldn’t - I sent out a pull request to fix that: https://github.com/ManiacalLabs/BiblioPixel/pull/611

However, why are you getting that error in the first place? I personally run with a setup much like yours and I don’t get these exceptions.

Adam will be able to weigh in on the causes of this. However, we should be able to recover from these error, perhaps without any visible effects, most likely with a bit of jitter (timing error) that will be barely unnoticeable - even if we can’t eliminate the cause of the errors.

On Mon, Feb 5, 2018 at 5:52 AM, Diddy Wolf didd...@gmail.com wrote:

I ran my test a dozen times or so with verbose logging and got the following traces.

==============================================

DEBUG - devices - Error getting device_id for /dev/ttyACM0, 921600

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 165, in run_context

yield

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/usr/lib/python3.5/contextlib.py”, line 77, in exit

self.gen.throw(type, value, traceback)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 167, in run_context

self.cleanup(clean_layout)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 89, in cleanup

self.layout.cleanup()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 73, in cleanup

self.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

==============================================

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 58ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

==============================================

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 165, in run_context

yield

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/usr/lib/python3.5/contextlib.py”, line 77, in exit

self.gen.throw(type, value, traceback)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 167, in run_context

self.cleanup(clean_layout)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 89, in cleanup

self.layout.cleanup()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 73, in cleanup

self.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

On Sunday, February 4, 2018 at 10:50:18 PM UTC-6, Diddy Wolf wrote:

I have two allpixels for my current project, both of which will be controlling about 400 leds. In stress testing this setup to make sure my rpi can handle running it, I started up two instances of bp with the same project, only chancing the device_id.

{

“driver”: {

“typename”: “serial”,

“num”: 400,

“ledtype”: “APA102”,

“device_id”: X,

“c_order”: “bgr”

},

“layout”: {

“typename”: “bibliopixel.layout.strip.Strip”

},

“animation”: {

“typename”: “BiblioPixelAnimations.strip.Rainbows.RainbowCycle”

},

“run”: {

“fps”: 30

},

“path”: “/development/BiblioPixelAnimations”

}

Running one works fine. Running both, most of the time, seems to work fine. However, occasionally when I startup the second instance, the already running instance will terminate with one of the following errors.

TypeError: error() got an unexpected keyword argument ‘fail’

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

These failures seem to always occur within a few seconds. If it runs longer than that, it has stayed stable for at lest 30 minutes.

Are there issues with running multiple instances of bp, both controlling serial devices?

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/dc91c93a-ec14-42d1-ac85-9a70febb2d25%40googlegroups.com.

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

/t

https://tom.ritchford.com

https://tom.swirly.com


/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/e174c729-287d-411f-8104-5b7d35883fb7%40googlegroups.com.

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


/t

https://tom.ritchford.com

https://tom.swirly.com


/t

https://tom.ritchford.com

https://tom.swirly.com


/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/CAOuQWfXZb7mzghDoKrUS0po%3Di4vA6GQEv%2Bkq4bN2UwtY8H9-Nw%40mail.gmail.com.

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

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/116047a9-2da3-41f4-8f88-815f62433386%40googlegroups.com.

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

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/c1bd96b9-88af-4dd1-b69b-84a67fd1ac8d%40googlegroups.com.

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

Deployed your dev branch. Still getting the below tracebacks on occasion. I will note that it seems to be catching some errors since 3.4.6. I do see “ERROR - devices - There was an unknown error communicating with the device.” on some occasions with no crash.

Note that this is still with the LED strips disconnected from the AllPixels.

···

======================================================

(bpdev) pi@raspberrypi:~/projects/playroom_lighting/projects $ bp run -v stress_test_dev2.json

DEBUG - devices - Error getting device_id for /dev/ttyACM1, 921600

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 58ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/bpdev/bin/bp”, line 6, in

exec(compile(open(file).read(), file, ‘exec’))

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/scripts/bp”, line 15, in

main.main()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/animation/animation.py”, line 89, in start

self.threading.start()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/animation/animation.py”, line 94, in run_all_frames

self._run_one_frame()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/animation/animation.py”, line 135, in _run_one_frame

self.layout.push_to_driver()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/drivers/driver_base.py”, line 120, in update_colors

self.set_device_brightness(brightness)

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/drivers/serial/driver.py”, line 121, in set_brightness

resp = ord(self._com.read(1))

TypeError: ord() expected a character, but string of length 0 found

======================================================

(bpdev) pi@raspberrypi:~/projects/playroom_lighting/projects $ bp run -v stress_test_dev1.json

DEBUG - devices - Error getting device_id for /dev/ttyACM0, 921600

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/bpdev/lib/python3.5/site-packages/pyserial-3.4-py3.5.egg/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/bpdev/bin/bp”, line 6, in

exec(compile(open(file).read(), file, ‘exec’))

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/scripts/bp”, line 15, in

main.main()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/animation/animation.py”, line 89, in start

self.threading.start()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/animation/animation.py”, line 94, in run_all_frames

self._run_one_frame()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/animation/animation.py”, line 135, in _run_one_frame

self.layout.push_to_driver()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/bpdev/lib/python3.5/site-packages/pyserial-3.4-py3.5.egg/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

======================================================

On Saturday, February 17, 2018 at 4:48:20 AM UTC-6, Tom Swirly wrote:

So I have a pull request out now to possibly mitigate this issue.

But we aren’t seeing this issue locally so I can’t really test it… so…

Diddy, I see you wisely do everything in a virtualenv…

could I convince you/talk you through patching in this branch into your own virtualenv so that we can see if it works better??

In fact, here are the instructions…

  1. Create a temporary directory
  2. Create a fresh virtualenv in that directory (or wherever you like) and activate it
  3. Download my branch here into the directory and unzip it
  4. cd to the topmost directory of that branch
  5. Type
  • python setup.py develop
  • Now, try running your project using this virtualenv
  • When we’re all done, you can delete the whole temporary directory
    If I update the code on that branch, you can just repeat step 3 again and unzip it over the old code and you’re good to go (because you set it up with develop in step 5).

On Sat, Feb 17, 2018 at 10:31 AM, Tom Swirly t...@swirly.com wrote:

Oh, and thanks again for the clear trouble report. I’m pretty sure that given those stack traces, I can at least make it ignore the errors. Now, I expect that will result in some sort of quality issue like missed frames but those might be totally invisible to the user…

On Sat, Feb 17, 2018 at 10:30 AM, Tom Swirly t...@swirly.com wrote:

Eh, no troubles with the delay, sorry you’re having this problem!

However, it’s an interesting problem now, not a trivial one. I still don’t think the program should crash - I filed an issue here last year about this - but the fact that it’s happening so often means that there is some actual hardware issue going on here too.

I’m going to get Adam to check in on this issue from the hardware end. From my end, I’ll try to come up with a way to recover gracefully from these errors, which should not be fatal - but you shouldn’t be having them either…

The AllPixels seem to have proven to be very reliable, mainly because there isn’t much to 'em - IIRC we have yet to find an error stemming from them, but who knows how many people had issues we didn’t report. Could it be that there’s a wiring issue? An intermittent short circuit, perhaps?

On Sat, Feb 17, 2018 at 6:01 AM, Diddy Wolf didd...@gmail.com wrote:

Sorry for the delay. Upgraded to 3.4.6. Still seeing a crash occasionally. Not as readily as before (maybe once in 20 attempts?). Got two unique tracebacks this time.

======================================================

DEBUG - devices - Error getting device_id for /dev/ttyACM1, 921600

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 37ms!

ERROR - devices - There was an unknown error communicating with the device.

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

======================================================

DEBUG - devices - Error getting device_id for /dev/ttyACM0, 921600

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 120, in update_colors

self.set_device_brightness(brightness)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 121, in set_brightness

resp = ord(self._com.read(1))

TypeError: ord() expected a character, but string of length 0 found

======================================================

On Friday, February 9, 2018 at 8:26:20 AM UTC-6, Tom Swirly wrote:

Sorry for the delay here.

I just pushed a new version that at least handles the crash - you can get it by typing

pip install bibliopixel --upgrade

Try it with your issue and let me know how it goes!

On Mon, Feb 5, 2018 at 10:47 AM, Tom Swirly t...@swirly.com wrote:

This is a very clear report, thanks!

You allowed me to see that there’s a bug in handling the error where we crash where we shouldn’t - I sent out a pull request to fix that: https://github.com/ManiacalLabs/BiblioPixel/pull/611

However, why are you getting that error in the first place? I personally run with a setup much like yours and I don’t get these exceptions.

Adam will be able to weigh in on the causes of this. However, we should be able to recover from these error, perhaps without any visible effects, most likely with a bit of jitter (timing error) that will be barely unnoticeable - even if we can’t eliminate the cause of the errors.

On Mon, Feb 5, 2018 at 5:52 AM, Diddy Wolf didd...@gmail.com wrote:

I ran my test a dozen times or so with verbose logging and got the following traces.

==============================================

DEBUG - devices - Error getting device_id for /dev/ttyACM0, 921600

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 165, in run_context

yield

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/usr/lib/python3.5/contextlib.py”, line 77, in exit

self.gen.throw(type, value, traceback)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 167, in run_context

self.cleanup(clean_layout)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 89, in cleanup

self.layout.cleanup()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 73, in cleanup

self.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

==============================================

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 58ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

==============================================

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 165, in run_context

yield

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/usr/lib/python3.5/contextlib.py”, line 77, in exit

self.gen.throw(type, value, traceback)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 167, in run_context

self.cleanup(clean_layout)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 89, in cleanup

self.layout.cleanup()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 73, in cleanup

self.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

On Sunday, February 4, 2018 at 10:50:18 PM UTC-6, Diddy Wolf wrote:

I have two allpixels for my current project, both of which will be controlling about 400 leds. In stress testing this setup to make sure my rpi can handle running it, I started up two instances of bp with the same project, only chancing the device_id.

{

“driver”: {

“typename”: “serial”,

“num”: 400,

“ledtype”: “APA102”,

“device_id”: X,

“c_order”: “bgr”

},

“layout”: {

“typename”: “bibliopixel.layout.strip.Strip”

},

“animation”: {

“typename”: “BiblioPixelAnimations.strip.Rainbows.RainbowCycle”

},

“run”: {

“fps”: 30

},

“path”: “/development/BiblioPixelAnimations”

}

Running one works fine. Running both, most of the time, seems to work fine. However, occasionally when I startup the second instance, the already running instance will terminate with one of the following errors.

TypeError: error() got an unexpected keyword argument ‘fail’

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

These failures seem to always occur within a few seconds. If it runs longer than that, it has stayed stable for at lest 30 minutes.

Are there issues with running multiple instances of bp, both controlling serial devices?

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/dc91c93a-ec14-42d1-ac85-9a70febb2d25%40googlegroups.com.

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

/t

https://tom.ritchford.com

https://tom.swirly.com


/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/e174c729-287d-411f-8104-5b7d35883fb7%40googlegroups.com.

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


/t

https://tom.ritchford.com

https://tom.swirly.com


/t

https://tom.ritchford.com

https://tom.swirly.com


/t

https://tom.ritchford.com

https://tom.swirly.com

Do you have something other than the Pi you can try this on? Just trying to narrow down possibilities now. and 100% of the time I’ve seen this it worked on a difference system.

···

On Sat, Feb 17, 2018 at 1:00 PM, Diddy Wolf diddywolf@gmail.com wrote:

Deployed your dev branch. Still getting the below tracebacks on occasion. I will note that it seems to be catching some errors since 3.4.6. I do see “ERROR - devices - There was an unknown error communicating with the device.” on some occasions with no crash.

Note that this is still with the LED strips disconnected from the AllPixels.

======================================================

(bpdev) pi@raspberrypi:~/projects/playroom_lighting/projects $ bp run -v stress_test_dev2.json

DEBUG - devices - Error getting device_id for /dev/ttyACM1, 921600

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 58ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/bpdev/bin/bp”, line 6, in

exec(compile(open(file).read(), file, ‘exec’))

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/scripts/bp”, line 15, in

main.main()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/animation/animation.py”, line 89, in start

self.threading.start()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/animation/animation.py”, line 94, in run_all_frames

self._run_one_frame()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/animation/animation.py”, line 135, in _run_one_frame

self.layout.push_to_driver()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/drivers/driver_base.py”, line 120, in update_colors

self.set_device_brightness(brightness)

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/drivers/serial/driver.py”, line 121, in set_brightness

resp = ord(self._com.read(1))

TypeError: ord() expected a character, but string of length 0 found

======================================================

(bpdev) pi@raspberrypi:~/projects/playroom_lighting/projects $ bp run -v stress_test_dev1.json

DEBUG - devices - Error getting device_id for /dev/ttyACM0, 921600

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/bpdev/lib/python3.5/site-packages/pyserial-3.4-py3.5.egg/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/bpdev/bin/bp”, line 6, in

exec(compile(open(file).read(), file, ‘exec’))

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/scripts/bp”, line 15, in

main.main()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/animation/animation.py”, line 89, in start

self.threading.start()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/animation/animation.py”, line 94, in run_all_frames

self._run_one_frame()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/animation/animation.py”, line 135, in _run_one_frame

self.layout.push_to_driver()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/projects/playroom_lighting/dev/BiblioPixel-animation/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/bpdev/lib/python3.5/site-packages/pyserial-3.4-py3.5.egg/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

======================================================

On Saturday, February 17, 2018 at 4:48:20 AM UTC-6, Tom Swirly wrote:

So I have a pull request out now to possibly mitigate this issue.

But we aren’t seeing this issue locally so I can’t really test it… so…

Diddy, I see you wisely do everything in a virtualenv…

could I convince you/talk you through patching in this branch into your own virtualenv so that we can see if it works better??

In fact, here are the instructions…

  1. Create a temporary directory
  2. Create a fresh virtualenv in that directory (or wherever you like) and activate it
  3. Download my branch here into the directory and unzip it
  4. cd to the topmost directory of that branch
  5. Type
  • python setup.py develop
  • Now, try running your project using this virtualenv
  • When we’re all done, you can delete the whole temporary directory
    If I update the code on that branch, you can just repeat step 3 again and unzip it over the old code and you’re good to go (because you set it up with develop in step 5).

On Sat, Feb 17, 2018 at 10:31 AM, Tom Swirly t...@swirly.com wrote:

Oh, and thanks again for the clear trouble report. I’m pretty sure that given those stack traces, I can at least make it ignore the errors. Now, I expect that will result in some sort of quality issue like missed frames but those might be totally invisible to the user…

On Sat, Feb 17, 2018 at 10:30 AM, Tom Swirly t...@swirly.com wrote:

Eh, no troubles with the delay, sorry you’re having this problem!

However, it’s an interesting problem now, not a trivial one. I still don’t think the program should crash - I filed an issue here last year about this - but the fact that it’s happening so often means that there is some actual hardware issue going on here too.

I’m going to get Adam to check in on this issue from the hardware end. From my end, I’ll try to come up with a way to recover gracefully from these errors, which should not be fatal - but you shouldn’t be having them either…

The AllPixels seem to have proven to be very reliable, mainly because there isn’t much to 'em - IIRC we have yet to find an error stemming from them, but who knows how many people had issues we didn’t report. Could it be that there’s a wiring issue? An intermittent short circuit, perhaps?

On Sat, Feb 17, 2018 at 6:01 AM, Diddy Wolf didd...@gmail.com wrote:

Sorry for the delay. Upgraded to 3.4.6. Still seeing a crash occasionally. Not as readily as before (maybe once in 20 attempts?). Got two unique tracebacks this time.

======================================================

DEBUG - devices - Error getting device_id for /dev/ttyACM1, 921600

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 37ms!

ERROR - devices - There was an unknown error communicating with the device.

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

======================================================

DEBUG - devices - Error getting device_id for /dev/ttyACM0, 921600

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 70, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 120, in update_colors

self.set_device_brightness(brightness)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 121, in set_brightness

resp = ord(self._com.read(1))

TypeError: ord() expected a character, but string of length 0 found

======================================================

On Friday, February 9, 2018 at 8:26:20 AM UTC-6, Tom Swirly wrote:

Sorry for the delay here.

I just pushed a new version that at least handles the crash - you can get it by typing

pip install bibliopixel --upgrade

Try it with your issue and let me know how it goes!

On Mon, Feb 5, 2018 at 10:47 AM, Tom Swirly t...@swirly.com wrote:

This is a very clear report, thanks!

You allowed me to see that there’s a bug in handling the error where we crash where we shouldn’t - I sent out a pull request to fix that: https://github.com/ManiacalLabs/BiblioPixel/pull/611

However, why are you getting that error in the first place? I personally run with a setup much like yours and I don’t get these exceptions.

Adam will be able to weigh in on the causes of this. However, we should be able to recover from these error, perhaps without any visible effects, most likely with a bit of jitter (timing error) that will be barely unnoticeable - even if we can’t eliminate the cause of the errors.

On Mon, Feb 5, 2018 at 5:52 AM, Diddy Wolf didd...@gmail.com wrote:

I ran my test a dozen times or so with verbose logging and got the following traces.

==============================================

DEBUG - devices - Error getting device_id for /dev/ttyACM0, 921600

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 165, in run_context

yield

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/usr/lib/python3.5/contextlib.py”, line 77, in exit

self.gen.throw(type, value, traceback)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 167, in run_context

self.cleanup(clean_layout)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 89, in cleanup

self.layout.cleanup()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 73, in cleanup

self.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

==============================================

INFO - devices - Using COM Port: /dev/ttyACM1, Device ID: 1, Device Ver: 0

DEBUG - run - Running file stress_test_dev1.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 58ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

==============================================

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 501, 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?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 165, in run_context

yield

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 133, in run_one_frame

self.layout.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 129, in _send_packet

resp = self._com.read(1)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/serial/serialposix.py”, line 509, in read

raise SerialException(‘read failed: {}’.format(e))

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/pi/.virtualenvs/playroom_lighting/bin/bp”, line 15, in

main.main()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/main.py”, line 84, in main

return run(args) or 0

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 136, in run

_run_animations(animations, args.pause, args.name)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/main/run.py”, line 112, in _run_animations

animation.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 186, in start

self.threading.start()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 70, in start

self.target()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/animation_threading.py”, line 30, in target

self.run()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 176, in run_all_frames

self.run_one_frame()

File “/usr/lib/python3.5/contextlib.py”, line 77, in exit

self.gen.throw(type, value, traceback)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 167, in run_context

self.cleanup(clean_layout)

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/animation/animation.py”, line 89, in cleanup

self.layout.cleanup()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 73, in cleanup

self.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/layout/layout.py”, line 106, in push_to_driver

self.threading.push_to_driver()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 93, in push_to_driver

self.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/util/threads/update_threading.py”, line 83, in update_colors

d.update_colors()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/driver_base.py”, line 123, in update_colors

self._send_packet()

File “/home/pi/.virtualenvs/playroom_lighting/lib/python3.5/site-packages/bibliopixel/drivers/serial/driver.py”, line 131, in _send_packet

self.devices.error(fail=False)

TypeError: error() got an unexpected keyword argument ‘fail’

On Sunday, February 4, 2018 at 10:50:18 PM UTC-6, Diddy Wolf wrote:

I have two allpixels for my current project, both of which will be controlling about 400 leds. In stress testing this setup to make sure my rpi can handle running it, I started up two instances of bp with the same project, only chancing the device_id.

{

“driver”: {

“typename”: “serial”,

“num”: 400,

“ledtype”: “APA102”,

“device_id”: X,

“c_order”: “bgr”

},

“layout”: {

“typename”: “bibliopixel.layout.strip.Strip”

},

“animation”: {

“typename”: “BiblioPixelAnimations.strip.Rainbows.RainbowCycle”

},

“run”: {

“fps”: 30

},

“path”: “/development/BiblioPixelAnimations”

}

Running one works fine. Running both, most of the time, seems to work fine. However, occasionally when I startup the second instance, the already running instance will terminate with one of the following errors.

TypeError: error() got an unexpected keyword argument ‘fail’

serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

These failures seem to always occur within a few seconds. If it runs longer than that, it has stayed stable for at lest 30 minutes.

Are there issues with running multiple instances of bp, both controlling serial devices?

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/dc91c93a-ec14-42d1-ac85-9a70febb2d25%40googlegroups.com.

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

/t

https://tom.ritchford.com

https://tom.swirly.com


/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/e174c729-287d-411f-8104-5b7d35883fb7%40googlegroups.com.

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


/t

https://tom.ritchford.com

https://tom.swirly.com


/t

https://tom.ritchford.com

https://tom.swirly.com


/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/9c940d7d-a2e1-4746-9004-0fb23a9f3edb%40googlegroups.com.

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

Also, I want to just note real quick that our official support for multiple AllPixels at one time is them both being controlled from the same bibliopixel instance. I’ll be 100% honest… we don’t test multiple bibliopixel instances with serial devices like the AllPixel. We will now, it’s just never been something that we really thought anyone would ever do. I don’t really think that this small semantic difference is what the issue is, but as I’ve noted: my experience with the linux serial stack is that it’s not very robust at all and I can imagine this causing an issue with 2 separate processes trying to get serial resources at the same time.

···

On Sun, Feb 18, 2018 at 6:40 AM, Tom Swirly tom@swirly.com wrote:

Ah, gotta get better at giving instructions, “Scroll back somewhere in a long thread” is teh lame. :slight_smile:

  1. Go to the temporary directory you created before.
  2. Download my branch here into the directory and unzip it
    You should immediately see the new functionality in that virtualenv you created before, so you can just run your test the way you saw it before.

I am in agreement with Adam that it’s almost certainly a hardware issue at the root.

Serial connections are really stupid - just a single wire with a voltage on it. If that voltage isn’t happening, it’s nearly always because either there’s some missing or incorrect hardware connection, or because there simply isn’t enough current (because your circuit is underpowered somehow).

However, we should be robust against any such thing. Even in real world correct installations, temporary low-power states are not uncommon - “the fridge on the same line turns on and for a second the voltage drops 30%” - we shouldn’t just die horribly when that happens.

So I appreciate :smiley: your having run into this foot-gun, so that we can make the system more robust against foot-guns…


/t

https://tom.ritchford.com

https://tom.swirly.com

I certainly appreciate all of the input on this. If the answer ends up being “this isn’t supported”, then I’ll just have to rearrange how I’m running animations and only use one instance of BP (the new split animation should make that fairly easy). At least none of this so far has any impact on the actual build (nothing so far is going to require me to change the topology of the physical hardware).

I did set this up on my windows PC and I don’t see the issue there. I also hopefully ruled out power by powering the Pi from my 5v 40a power supply, and I still see issues. If 40 amps isn’t enough, then I don’t know what would be. I think we can safely point the finger at “linux serial stack issues” at this point.

Tom, I tried the updated version of your dev branch and I still see the same errors.

That being the case, I offer below my own “I know just enough python to be dangerous” solution for your consideration and/or amusement.

in bibliopixel/util/threads/update_threading.py:

class NoThreading(object):

def push_to_driver(self):

“”“Push the current pixel state to the driver”""

try:

self.wait_for_update()

self.update_colors()

except KeyboardInterrupt:

raise

except:

error=“Update failed.”

log.error(error)

pass

``

Basically, when pushing an update to the driver, catch any errors (except keyboard interrupt), log it as a failure, and move on.

This results in the following instead of a crash.

(bpdev) pi@raspberrypi:~/projects/playroom_lighting/projects $ bp run -v stress_test_dev2.json

DEBUG - devices - Error getting device_id for /dev/ttyACM1, 921600

INFO - devices - Using COM Port: /dev/ttyACM0, Device ID: 2, Device Ver: 0

DEBUG - run - Running file stress_test_dev2.json

DEBUG - animation_threading - Animation starts on main thread

WARNING - animation_threading - Frame-time of 33ms set, but took 35ms!

ERROR - update_threading - Update failed.

I’m entirely sure there is a better place to implement a solution like this, but this was the least complicated method that was in the path of all of the exceptions I’ve hit. And hey, at least in my limited testing, it works. :slight_smile:

···

On Sunday, February 18, 2018 at 8:04:27 AM UTC-6, Tom Swirly wrote:

:-o o.O

Whoa, good reading skills there. I hadn’t noticed that.

We really want control of the scheduling ourselves in the long run.

But in the medium run, this mechanism allows a user to take advantage of more than one core, something we can’t do right now in one bp instance.

I would only recommend “two instances of bp” as a viable strategy if you aren’t able to get the smooth frame rates you need and looking at your core usage shows one core maxed out on CPU and the others idling.

Congratulations, Diddy, on managing to come up with an “abuse” of the software that we never thought about, but seems completely logical in hindsight. :smiley:

On Sun, Feb 18, 2018 at 1:07 PM, Adam Haile adamm...@gmail.com wrote:

Also, I want to just note real quick that our official support for multiple AllPixels at one time is them both being controlled from the same bibliopixel instance. I’ll be 100% honest… we don’t test multiple bibliopixel instances with serial devices like the AllPixel. We will now, it’s just never been something that we really thought anyone would ever do. I don’t really think that this small semantic difference is what the issue is, but as I’ve noted: my experience with the linux serial stack is that it’s not very robust at all and I can imagine this causing an issue with 2 separate processes trying to get serial resources at the same time.

On Sun, Feb 18, 2018 at 6:40 AM, Tom Swirly t...@swirly.com wrote:

Ah, gotta get better at giving instructions, “Scroll back somewhere in a long thread” is teh lame. :slight_smile:

  1. Go to the temporary directory you created before.
  2. Download my branch here into the directory and unzip it
    You should immediately see the new functionality in that virtualenv you created before, so you can just run your test the way you saw it before.

I am in agreement with Adam that it’s almost certainly a hardware issue at the root.

Serial connections are really stupid - just a single wire with a voltage on it. If that voltage isn’t happening, it’s nearly always because either there’s some missing or incorrect hardware connection, or because there simply isn’t enough current (because your circuit is underpowered somehow).

However, we should be robust against any such thing. Even in real world correct installations, temporary low-power states are not uncommon - “the fridge on the same line turns on and for a second the voltage drops 30%” - we shouldn’t just die horribly when that happens.

So I appreciate :smiley: your having run into this foot-gun, so that we can make the system more robust against foot-guns…


/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/CAG8g-TZ6Hpex79xGyTv5sG4qg-uHJmaisiMiARx-0_48Qcf1Cg%40mail.gmail.com.

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


/t

https://tom.ritchford.com

https://tom.swirly.com

hmmm, wondering about this one.

Trying to run two all_pixels off of a mac mini right now (no problems with computation or power, and LEDs have external power supplies).

Running into an issue when one of the all_pixels is controlling WS2811 LEDs and one is controlling APA102 LEDs (I’m assuming they are different data structures)

Running either of the all_pixels separately works just fine, but if I try to run them simultaneously (same virtual environment, two separate processes) I get the following errors:

Traceback (most recent call last):
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/serial/serialposix.py”, line 265, in open
self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
FileNotFoundError: [Errno 2] No such file or directory: ‘/dev/cu.usbmodem8’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/drivers/serial/driver.py”, line 93, in _connect
self.dev, baudrate=self.devices.baudrate, timeout=5)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/serial/serialutil.py”, line 240, in init
self.open()
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/serial/serialposix.py”, line 268, in open
raise SerialException(msg.errno, “could not open port {}: {}”.format(self._port, msg))
serial.serialutil.SerialException: [Errno 2] could not open port /dev/cu.usbmodem8: [Errno 2] No such file or directory: ‘/dev/cu.usbmodem8’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/main/run.py”, line 88, in _get_projects
project = common_flags.make_project(args, desc, root_file)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/main/common_flags.py”, line 178, in make_project
return project.project(desc, project_flags, root_file=root_file)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/project/project.py”, line 151, in project
project = construct.construct(**desc)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/project/construct.py”, line 13, in construct
return datatype(*args, **kwds)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/project/project.py”, line 53, in init
self.drivers = [create(d, ‘drivers’) for d in drivers]
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/project/project.py”, line 53, in
self.drivers = [create(d, ‘drivers’) for d in drivers]
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/project/project.py”, line 47, in create
python_path=‘bibliopixel.’ + name)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/project/recurse.py”, line 73, in recurse
d = call(post, desc)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/project/recurse.py”, line 43, in call
return f and f(desc)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/project/project.py”, line 40, in post
return self.construct_child(name, **desc)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/project/project.py”, line 25, in construct_child
return construct(self, **kwds)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/drivers/driver_base.py”, line 37, in construct
return cls(maker=project.maker, **desc)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/drivers/serial/driver.py”, line 66, in init
resp = self._connect()
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/drivers/serial/driver.py”, line 99, in _connect
“\n”.join(ports))
TypeError: (‘Unable to create drivers’, ‘sequence item 0: expected str instance, tuple found’)

Unable to create drivers
sequence item 0: expected str instance, tuple found

Traceback (most recent call last):
File “/anaconda3/envs/bibliopixel/bin/bp”, line 15, in
main.main()
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/main/main.py”, line 78, in main
result = run(args) or 0
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/main/run.py”, line 185, in run
run_once(args)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/main/run.py”, line 161, in run_once
projects = _get_projects(args)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/main/run.py”, line 119, in _get_projects
raise ValueError(‘Run aborted’)

···

Not sure why it can’t find the port if they are both running (it finds it fine if it runs alone) but also a problem with getting a tuple instead of a string when creating the driver?

*nix systems have had issues if you try to do two separate BP processes with two separate AllPixels. Trying to find an old forum post about that… but elluding me right now.

···

On Sun, Jul 15, 2018 at 6:51 PM Eric Stiens estiens@gmail.com wrote:

hmmm, wondering about this one.

Trying to run two all_pixels off of a mac mini right now (no problems with computation or power, and LEDs have external power supplies).

Running into an issue when one of the all_pixels is controlling WS2811 LEDs and one is controlling APA102 LEDs (I’m assuming they are different data structures)

Running either of the all_pixels separately works just fine, but if I try to run them simultaneously (same virtual environment, two separate processes) I get the following errors:

Traceback (most recent call last):
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/serial/serialposix.py”, line 265, in open
self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
FileNotFoundError: [Errno 2] No such file or directory: ‘/dev/cu.usbmodem8’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/drivers/serial/driver.py”, line 93, in _connect
self.dev, baudrate=self.devices.baudrate, timeout=5)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/serial/serialutil.py”, line 240, in init
self.open()
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/serial/serialposix.py”, line 268, in open
raise SerialException(msg.errno, “could not open port {}: {}”.format(self._port, msg))
serial.serialutil.SerialException: [Errno 2] could not open port /dev/cu.usbmodem8: [Errno 2] No such file or directory: ‘/dev/cu.usbmodem8’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/main/run.py”, line 88, in _get_projects
project = common_flags.make_project(args, desc, root_file)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/main/common_flags.py”, line 178, in make_project
return project.project(desc, project_flags, root_file=root_file)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/project/project.py”, line 151, in project
project = construct.construct(**desc)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/project/construct.py”, line 13, in construct
return datatype(*args, **kwds)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/project/project.py”, line 53, in init
self.drivers = [create(d, ‘drivers’) for d in drivers]
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/project/project.py”, line 53, in
self.drivers = [create(d, ‘drivers’) for d in drivers]
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/project/project.py”, line 47, in create
python_path=‘bibliopixel.’ + name)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/project/recurse.py”, line 73, in recurse
d = call(post, desc)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/project/recurse.py”, line 43, in call
return f and f(desc)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/project/project.py”, line 40, in post
return self.construct_child(name, **desc)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/project/project.py”, line 25, in construct_child
return construct(self, **kwds)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/drivers/driver_base.py”, line 37, in construct
return cls(maker=project.maker, **desc)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/drivers/serial/driver.py”, line 66, in init
resp = self._connect()
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/drivers/serial/driver.py”, line 99, in _connect
“\n”.join(ports))
TypeError: (‘Unable to create drivers’, ‘sequence item 0: expected str instance, tuple found’)

Unable to create drivers
sequence item 0: expected str instance, tuple found

Traceback (most recent call last):
File “/anaconda3/envs/bibliopixel/bin/bp”, line 15, in
main.main()
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/main/main.py”, line 78, in main
result = run(args) or 0
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/main/run.py”, line 185, in run
run_once(args)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/main/run.py”, line 161, in run_once
projects = _get_projects(args)
File “/anaconda3/envs/bibliopixel/lib/python3.6/site-packages/bibliopixel/main/run.py”, line 119, in _get_projects
raise ValueError(‘Run aborted’)

Not sure why it can’t find the port if they are both running (it finds it fine if it runs alone) but also a problem with getting a tuple instead of a string when creating the driver?

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/2ec45395-2ef9-48ad-954a-dfad3097a970%40googlegroups.com.

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

Ironically, right when you wrote this, they both started working just fine in two separate processes!

I’ll see how reliable it is or whether I can narrow down error conditions. If I have too, I’ll just throw one of them on a raspberry pi, just more work that way.

Oh wait… duh. This is literally the forum thread I was talking about :stuck_out_tongue:

···

On Sun, Jul 15, 2018 at 7:30 PM Eric Stiens estiens@gmail.com wrote:

Ironically, right when you wrote this, they both started working just fine in two separate processes!

I’ll see how reliable it is or whether I can narrow down error conditions. If I have too, I’ll just throw one of them on a raspberry pi, just more work that way.

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/0057a4ff-984d-4272-9351-51d02daa3a23%40googlegroups.com.

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