3 AllPixel Modules on one RaspberryPi / DeviceIDManager Serial

Hello everybody.
I have a question.
I use more than one AllPixelBoard in my structure and I have read on the following website

https://github.com/ManiacalLabs/BiblioPixel/wiki/Device-ID

that I can program each Allpixel a Device-ID, which I can later identify again.
Is that correct?

Now I need only the following code to call

Python DeviceIDManager.py

To program the only connected device with an ID.

But where is this Python script?

I am using the newer code for Python3. What is the solution to separate devices? Do you have a sample code or idea?

Kindly Regards from Germany, Daniel Wockel

Daniel,

Sorry for the oversight in documentation. I’ve updated the docs to detail this process in the new version: https://github.com/ManiacalLabs/BiblioPixel/wiki/Serial-Device-Commands

What type of display are you building… we’ve recently found a bug in the multi-driver handling for everything but matrices and it’s currently in the process of being fixed.

···

On Thu, Aug 17, 2017 at 3:37 PM, Daniel Wockel wockeldaniel78@gmail.com wrote:

Hello everybody.
I have a question.
I use more than one AllPixelBoard in my structure and I have read on the following website

https://github.com/ManiacalLabs/BiblioPixel/wiki/Device-ID

that I can program each Allpixel a Device-ID, which I can later identify again.
Is that correct?

Now I need only the following code to call

Python DeviceIDManager.py

To program the only connected device with an ID.

But where is this Python script?

I am using the newer code for Python3. What is the solution to separate devices? Do you have a sample code or idea?

Kindly Regards from Germany, Daniel Wockel

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/db29e596-3768-4c87-9b65-633cb1bcb3a6%40googlegroups.com.

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

Thanks for the very good new information and the quick reaction to my question. I am building a 40 meter LED light strip with WS2812B LEDs for a museum. I think these are neopixel compatible.
I program a tool on the Raspi, which reacts to control signals with Universe or WatchOut via UDP and can play binary movements and 25fps films for the strip. I will probably have to connect this strip 3 or 4 AllPixel modules to the Raspi to be able to control all the LEDs.

···

Am Donnerstag, 17. August 2017 21:44:53 UTC+2 schrieb Daniel Wockel:

Hello everybody.
I have a question.
I use more than one AllPixelBoard in my structure and I have read on the following website

https://github.com/ManiacalLabs/BiblioPixel/wiki/Device-ID

that I can program each Allpixel a Device-ID, which I can later identify again.
Is that correct?

Now I need only the following code to call

Python DeviceIDManager.py

To program the only connected device with an ID.

But where is this Python script?

I am using the newer code for Python3. What is the solution to separate devices? Do you have a sample code or idea?

Kindly Regards from Germany, Daniel Wockel

Daniel,
Sounds awesome! What museum is this going into?

So, can you answer a few questions about your planned setup so that I can ensure your success here? I know this is a lot of details I’m asking for, but having built many, many large displays, this is just the tip of the ice berg in terms of things you are going to need to consider. So please answer everything best you can.

  • What type of LEDs exactly are you using? WS2812B LEDs are VERY slow so if you can use something else like the APA102 then do that! Did you already purchase the LEDs?

  • How many total pixels exactly? LED update speeds scale down linearly with number of pixels. Which is why you need faster LEDs if you have a lot of pixels. If you have fast enough LEDs you may be able to get away with one long strip instead of 3-4.

  • Can you use something other then an RasPi to be the central controller? As in a “real” computer? Again, it depends on the total number of pixels, but a Pi will not be able to keep up with 4 AllPixel controllers. No possible way. I’ve tried. It just doesn’t have the peripheral throughput to handle that many LEDs at once.

  • 25fps films? On a 1D strip of LEDs? How does that work? Again, noting above questions… if you use as many WS2812B LEDs as 40m would imply there’s absolutely no way you’ll get 25fps. You’ll be lucky to get 5fps.

···

On Fri, Aug 18, 2017 at 3:54 AM, Daniel Wockel wockeldaniel78@gmail.com wrote:

Thanks for the very good new information and the quick reaction to my question. I am building a 40 meter LED light strip with WS2812B LEDs for a museum. I think these are neopixel compatible.
I program a tool on the Raspi, which reacts to control signals with Universe or WatchOut via UDP and can play binary movements and 25fps films for the strip. I will probably have to connect this strip 3 or 4 AllPixel modules to the Raspi to be able to control all the LEDs.

Am Donnerstag, 17. August 2017 21:44:53 UTC+2 schrieb Daniel Wockel:

Hello everybody.
I have a question.
I use more than one AllPixelBoard in my structure and I have read on the following website

https://github.com/ManiacalLabs/BiblioPixel/wiki/Device-ID

that I can program each Allpixel a Device-ID, which I can later identify again.
Is that correct?

Now I need only the following code to call

Python DeviceIDManager.py

To program the only connected device with an ID.

But where is this Python script?

I am using the newer code for Python3. What is the solution to separate devices? Do you have a sample code or idea?

Kindly Regards from Germany, Daniel Wockel

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/79445561-4c66-49ce-b975-d1c0b63d5b22%40googlegroups.com.

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

Hello Adam,

I bought my Strips here:

https://www.elv.de/diamex-5-m-led-streifen-mit-ws281-leds-30-leds-m-schwarze-platine.html

So I calculate again:

It is a LED-Strip with 40 Meters and Parallel two Lines with the same input to get more Light.

There are 30 LED per meter in the Strip, so i get in one Line 1200 LEDs.

I have bought the LEDs but if these are to bad for this solution, I can buy others (depending on the price).
If I read the Manual there is a value of 800kp/s (there are 24 Bits for each LED so I got 33kb/sPer LED -> and for 1200 LEDs I can write 27 times in a Secound)

If I drive these as one Big line, so I expect to get 27 fpm.

If I divide it to two AllPixel controllers I can be faster than this.

How many LEDs can a Singel AllPixel-Controler drive? And the BiblioPixel … what is there a limit within my RaspberryPi3 ?

I was looking for the Function “MultipleDriverSupport”

–> https://github.com/ManiacalLabs/BiblioPixel/wiki/Multiple-Driver-Support

I got an error while here:

driverA = Serial(LEDTYPE.LPD8806, 100, deviceID = 1)
Can you help me?

Kindly regards, Daniel

Hello Adam,

I bought my Strips here:

https://www.elv.de/diamex-5-m-led-streifen-mit-ws281-leds-
30-leds-m-schwarze-platine.html

Yeah.. those are fine. WS2812.

So I calculate again:
It is a LED-Strip with 40 Meters and Parallel two Lines with the same
input to get more Light.
There are 30 LED per meter in the Strip, so i get in one Line 1200 LEDs.
I have bought the LEDs but if these are to bad for this solution, I can
buy others (depending on the price).
If I read the Manual there is a value of 800kp/s (there are 24 Bits for
each LED so I got 33kb/sPer LED -> and for 1200 LEDs I can write 27 times
in a Secound)

Note... 27fps is an absolute MAX. You will not get that using a Pi. You
will not get that using multiple drivers. There's a lot of overhead
involved with each.

If I drive these as one Big line, so I expect to get 27 fpm.

Probably more like 20 at best.

If I divide it to two AllPixel controllers I can be faster than this.

Yeah....2 would be fine. Use threadedUpdate and it should get around
20fps... maybe more.

How many LEDs can a Singel AllPixel-Controler drive? And the BiblioPixel
... what is there a limit within my RaspberryPi3 ?

AllPixel can do 700... BiblioPixel is theoretically unlimited for WS2812.

I was looking for the Function "MultipleDriverSupport"

--> https://github.com/ManiacalLabs/BiblioPixel/wiki/
Multiple-Driver-Support
I got an error while here:

driverA = Serial(LEDTYPE.LPD8806, 100, deviceID = 1)

LPD8806? Gotta change the type there.

Also... please include the error. Can't help you without that.

···

On Fri, Aug 18, 2017 at 12:13 PM, Daniel Wockel <wockeldaniel78@gmail.com> wrote:

Can you help me?

Kindly regards, Daniel

--
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/5e00275e-e4dc-4ca6-b6e7-
bc25e9482aba%40googlegroups.com
<https://groups.google.com/d/msgid/maniacal-labs-users/5e00275e-e4dc-4ca6-b6e7-bc25e9482aba%40googlegroups.com?utm_medium=email&utm_source=footer>
.

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

Hi Adam, thanks for your suggestions. I’ll test it and try to find a solution to get more speed.

The error I get when I load the driver and give it the ID is the following.

return Serial(LEDTYPE.NEOPIXEL,100, deviceID = ID)

File “/usr/local/lib/python3.4/dist-packages/bibliopixel/drivers/serial/driver.py”, line 27, in init

super().init(num, c_order=c_order, gamma=gamma, **kwds)

File “/usr/local/lib/python3.4/dist-packages/bibliopixel/drivers/driver_base.py”, line 19, in init

project.raise_if_unknown_attributes(kwds, ‘driver’, self)

File “/usr/local/lib/python3.4/dist-packages/bibliopixel/project/project.py”, line 48, in raise_if_unknown_attributes

raise_if_unknown(items, ‘attribute’, value)

File “/usr/local/lib/python3.4/dist-packages/bibliopixel/project/project.py”, line 43, in raise_if_unknown

raise ValueError(‘Unknown %s%s for %s: %s’ % (name, s, value, msg))

ValueError: Unknown attribute for driver Serial: “deviceID”

I guess the Function don’t know the attribute for “deviceID”

Regards, Daniel

Daniel,

What Tom said, but you also found an error in our Wiki docs for Serial. It has now been corrected and you should be good to go.

···

On Mon, Aug 21, 2017 at 6:35 AM, Tom Swirly tom@swirly.com wrote:

That one, I can fix - the name has changed to be device_id.

This is my doing. :smiley: Basically, 75% of the names in BP2 used underscores_like_this and 25% used camelCaseLikeThis. Because we had a chance to change with 2->3 I changed, well, nearly all the camelCase to be underscores.

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/CAOuQWfWUt73ZwT4b0hz6cNcdO-y34SNSRvyW%3DUfwAanFmMCpZQ%40mail.gmail.com.

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

On Mon, Aug 21, 2017 at 12:13 PM, Daniel Wockel wockeldaniel78@gmail.com wrote:

Hi Adam, thanks for your suggestions. I’ll test it and try to find a solution to get more speed.

The error I get when I load the driver and give it the ID is the following.

return Serial(LEDTYPE.NEOPIXEL,100, deviceID = ID)

File “/usr/local/lib/python3.4/dist-packages/bibliopixel/drivers/serial/driver.py”, line 27, in init

super().init(num, c_order=c_order, gamma=gamma, **kwds)

File “/usr/local/lib/python3.4/dist-packages/bibliopixel/drivers/driver_base.py”, line 19, in init

project.raise_if_unknown_attributes(kwds, ‘driver’, self)

File “/usr/local/lib/python3.4/dist-packages/bibliopixel/project/project.py”, line 48, in raise_if_unknown_attributes

raise_if_unknown(items, ‘attribute’, value)

File “/usr/local/lib/python3.4/dist-packages/bibliopixel/project/project.py”, line 43, in raise_if_unknown

raise ValueError(‘Unknown %s%s for %s: %s’ % (name, s, value, msg))

ValueError: Unknown attribute for driver Serial: “deviceID”

I guess the Function don’t know the attribute for “deviceID”

Regards, Daniel

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/5958a3c6-92c7-428f-806d-8beb0c4198c1%40googlegroups.com.

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


/t

https://tom.ritchford.com

https://tom.swirly.com

Okay, thank you Adam and Tom.

it seens to work, if i change

led = Strip(200, [driverA, driverB])

to

···

led = Strip([driverA, driverB])

Hi Together,

After a few tests now I know something more. I tried it with an Intel XOTAC mini PC

(https://www.computeruniverse.net/products/90691184/zotac-zbox-ci327-nano-barebone.asp) and the Raspberry Pi.

Both have in “threadedUpdate” mode with 1200 LEDs (600 + 600) about 20fps. (I want to get 25 or more)

The Raspberry Pi has crashed in the threaded-mode from time to time. (about every two Minutes, when i send changing Rainbow-Colors in my 1200Pixel-Strip)

This Message I got there:

ERROR - return_codes - 1: Data packet size incorrect.

Exception in thread Thread-5:

Traceback (most recent call last):

File “/usr/lib/python3.4/threading.py”, line 920, in _bootstrap_inner

self.run()

File “/usr/local/lib/python3.4/dist-packages/bibliopixel/threads/threads.py”, line 12, in run

self.loop()

File “/usr/local/lib/python3.4/dist-packages/bibliopixel/threads/update_threading.py”, line 32, in loop

self._driver.update_colors()

File “/usr/local/lib/python3.4/dist-packages/bibliopixel/drivers/driver_base.py”, line 101, in update_colors

self._send_packet()

File “/usr/local/lib/python3.4/dist-packages/bibliopixel/drivers/serial/driver.py”, line 133, in _send_packet

print_error(ord(resp))

File “/usr/local/lib/python3.4/dist-packages/bibliopixel/drivers/return_codes.py”, line 33, in print_error

raise exception_class(msg)

bibliopixel.drivers.return_codes.BiblioSerialError: Data packet size incorrect.

When I switch off the threaded Mode, everything is slow but fine.

Is there a way to intercept the communication between Allpixel and the bibliopixel to get not always a renew of all LED statuses to save time?

Can you help me?

Kindly regards

*Summary*

I'm going to make a quick fix to prevent your program from crashing and
work on a longer fix that prevents the root case.

Note... BP is on code freeze at the moment. No new releases will go out
till mid September. But you can always use the dev branch.

I see three questions in your email:

*Question 1: the exception!*

Fascinating! First time I have personally seen this error message, but
it's there for a reason...

What it means is that (you could have guessed this part) the computer sent
the AllPixel a packet of the wrong length.

The fact that you never see this in unthreaded mode, and only occasionally
in threaded mode, means that it's almost certainly a race condition
<https://stackoverflow.com/questions/34510/what-is-a-race-condition> due
to threading.

Threads allow you to do "two things at once". A race condition means that
two threads are trying to change the same variable at almost exactly the
same time.

In this case, I believe that BP is probably starting to send the next
packet before the previous one has completed - but only occasionally. :-/

Actually... no. What's happening here is that BP doesn't finish sending the
first packet fast enough because it got context switched off to something
else in the middle of the send. The AllPixel will wait up to 100 cycles
with no data before hard failing, but after that (around 200ms) it will
simply hard fail with that error because it never received all the data.
Now, with regards to your fix, Tom, ([PR #414](
https://github.com/ManiacalLabs/BiblioPixel/pull/414)) that actually will
probably fix this particular issue.

Daniel, as stated above, we are in master branch code freeze, but I'd be
happy to cut a beta release to PyPi so you could install that without
having to pull the code manually.

Race conditions are notoriously hard to figure out, though this is
something I have a lot of experience with. Still, I think we're going to
have to fix this in two ways - a lame bandaid first, and then a proper fix
later.

The "lame bandaid" is necessary anyway - we should just report that
problem and go on, not crash. It's likely the result will be a partial
frame, or even a missing frame, but it's better than dying.

Again... AllPixel is everything or nothing. There's no partial frame. If it
doesn't get the whole frame it throws it out and waits for another.

The proper fix is to figure out where the race condition is, and make sure
it cannot happen. Figuring it out might take a second or a month,
unfortunately.

Sadly, this is on the BP side, not the AllPixel side.
Also, Daniel, when you used a full computer instead of the Raspberry Pi,
what OS are you running. I hate to say this as I love open source and even
work for Red Hat but the Serial stack on Linux is kinda crap. On Windows,
if you send a serial packet instead of making the software wait for each
sub-packet to be sent, windows buffers it and takes care of it on it's own.
So this issue is largely fixed.

I'll immediately prepare the lame bandaid solution and get it out in both
master and dev sometime today (I'm going to wait until Adam wakes up to get
his approval for the results), so that will at least get you going, and
I'll also start to look at the race condition.

Again, note above. This is not going into master for a few weeks. Sorry,
but I just can't have it right now.

*Question 2: is there a way to do only partial updates to an AllPixel?*

I am not an expert on the AllPixel but I don't know of any way to do
that. Adam will answer this authoritatively.

No. The way FastLED works (which is what the firmware uses) I could
certainly only update part of the display but then you'd get half one
frame and half another. I mean, yes I could do this, but the firmware does
not support it now.

···

On Tue, Aug 29, 2017 at 4:22 AM, Tom Swirly <tom@swirly.com> wrote: