Getting a hardware strip to operate like a matrix

The problem I’m having is that my two-strip-matrix doesn’t operate like the SimPixel driver that I’ve been developing against. I ran the MatrixCalibrationTest against both drivers and from that test I see the same result on both drivers. However, when I try to run my own animations they do not behave the same way at all-- the second row seems to be flipped (it should be mapped as serpentine but isn’t). The weird thing is that I can change the layout on the SimPixel driver, but can’t seem to get those changes to be reflected by the behavior of the hardware driver.

It almost seems like the WS281X driver is ignoring the coordinate map, but that doesn’t make sense because the calibration test has the expected behavior. Am I writing my animations wrong? Using deprecated animation methods? Is it a bug? Any information would be helpful.

I’m using the handy dandy AllPixel, if that’s relevant. And here’s the code I’m running, if that’s useful: https://github.com/rblakemesser/beam/blob/master/beam.py#L238

Hi Blake,

You mentioned serpentine, are the LEDs physically wired that way? Have you tried using the ‘serpentine’ option when defining the driver (https://github.com/ManiacalLabs/BiblioPixel/wiki/Matrix) instead of the coord_map? If not, maybe try not specifying a coord_map, but instead use ‘serpentine=True’. That may not be it, but I’d be interested to see if that has a different result on the hardware display vs SimPixel.

Thanks!

-Dan

···

On Saturday, November 4, 2017 at 1:07:19 PM UTC-4, Blake Messer wrote:

The problem I’m having is that my two-strip-matrix doesn’t operate like the SimPixel driver that I’ve been developing against. I ran the MatrixCalibrationTest against both drivers and from that test I see the same result on both drivers. However, when I try to run my own animations they do not behave the same way at all-- the second row seems to be flipped (it should be mapped as serpentine but isn’t). The weird thing is that I can change the layout on the SimPixel driver, but can’t seem to get those changes to be reflected by the behavior of the hardware driver.

It almost seems like the WS281X driver is ignoring the coordinate map, but that doesn’t make sense because the calibration test has the expected behavior. Am I writing my animations wrong? Using deprecated animation methods? Is it a bug? Any information would be helpful.

I’m using the handy dandy AllPixel, if that’s relevant. And here’s the code I’m running, if that’s useful: https://github.com/rblakemesser/beam/blob/master/beam.py#L238

@Tom Swirly Thank you! I was hoping it was something like that. I had found a couple places where the documentation was wrong, so I assumed that I should prefer the code to the documentation. I also found the bibliopixel library very cleanly written, overall. I was a little suspicious at calling an underscored-setter, but I saw that .setRGB() uses it here, so figured it was all the same. Is setRGB() deprecated?

The lack of a defined set() method in the layout class definition is somewhat confusing-- but now that I understand what’s happening it makes sense.

Thanks for the assist!

···

On Saturday, 4 November 2017 15:07:30 UTC-5, Tom Swirly wrote:

I can see the issue right from here! :smiley:

The issue is that you’re calling Layout._set_base, which doesn’t take serpentine into account - you should be calling Layout.

My theory is that you’re like me and you read the code in preference to the documentation, saw Layout._set_base but not Layout.set

and used the first one. But we “monkey-patch” in Layout.set depending on the settings to avoid having to test all these conditions on each frame.

This is mentioned in the documentation but it needs to be *reinforced. * I also was confused when I first read that class.

You have written good code, btw, nice and clear - I could spot the problem in an instant because of that.

On Sat, Nov 4, 2017 at 6:22 PM, Maniacal Labs Users maniacal-...@googlegroups.com wrote:

Hi Blake,

You mentioned serpentine, are the LEDs physically wired that way? Have you tried using the ‘serpentine’ option when defining the driver (https://github.com/ManiacalLabs/BiblioPixel/wiki/Matrix) instead of the coord_map? If not, maybe try not specifying a coord_map, but instead use ‘serpentine=True’. That may not be it, but I’d be interested to see if that has a different result on the hardware display vs SimPixel.

Thanks!

-Dan

On Saturday, November 4, 2017 at 1:07:19 PM UTC-4, Blake Messer wrote:

The problem I’m having is that my two-strip-matrix doesn’t operate like the SimPixel driver that I’ve been developing against. I ran the MatrixCalibrationTest against both drivers and from that test I see the same result on both drivers. However, when I try to run my own animations they do not behave the same way at all-- the second row seems to be flipped (it should be mapped as serpentine but isn’t). The weird thing is that I can change the layout on the SimPixel driver, but can’t seem to get those changes to be reflected by the behavior of the hardware driver.

It almost seems like the WS281X driver is ignoring the coordinate map, but that doesn’t make sense because the calibration test has the expected behavior. Am I writing my animations wrong? Using deprecated animation methods? Is it a bug? Any information would be helpful.

I’m using the handy dandy AllPixel, if that’s relevant. And here’s the code I’m running, if that’s useful: https://github.com/rblakemesser/beam/blob/master/beam.py#L238

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/8c0d14d8-21c6-4a07-9be7-6f89c0525f7b%40googlegroups.com.

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


/t

https://tom.ritchford.com

https://tom.swirly.com

set() is there, it’s just defined in the init() method as it’s dynamically configured to use one of a couple different types of set.
You are right to not want to use an _ method. There be dragons! They truly are only meant for internal use where we have full control.

···

On Mon, Nov 6, 2017 at 10:42 AM, Blake Messer rblakemesser@gmail.com wrote:

@Tom Swirly Thank you! I was hoping it was something like that. I had found a couple places where the documentation was wrong, so I assumed that I should prefer the code to the documentation. I also found the bibliopixel library very cleanly written, overall. I was a little suspicious at calling an underscored-setter, but I saw that .setRGB() uses it here, so figured it was all the same. Is setRGB() deprecated?

The lack of a defined set() method in the layout class definition is somewhat confusing-- but now that I understand what’s happening it makes sense.

Thanks for the assist!

On Saturday, 4 November 2017 15:07:30 UTC-5, Tom Swirly wrote:

I can see the issue right from here! :smiley:

The issue is that you’re calling Layout._set_base, which doesn’t take serpentine into account - you should be calling Layout.

My theory is that you’re like me and you read the code in preference to the documentation, saw Layout._set_base but not Layout.set

and used the first one. But we “monkey-patch” in Layout.set depending on the settings to avoid having to test all these conditions on each frame.

This is mentioned in the documentation but it needs to be *reinforced. * I also was confused when I first read that class.

You have written good code, btw, nice and clear - I could spot the problem in an instant because of that.

On Sat, Nov 4, 2017 at 6:22 PM, Maniacal Labs Users maniacal-...@googlegroups.com wrote:

Hi Blake,

You mentioned serpentine, are the LEDs physically wired that way? Have you tried using the ‘serpentine’ option when defining the driver (https://github.com/ManiacalLabs/BiblioPixel/wiki/Matrix) instead of the coord_map? If not, maybe try not specifying a coord_map, but instead use ‘serpentine=True’. That may not be it, but I’d be interested to see if that has a different result on the hardware display vs SimPixel.

Thanks!

-Dan

On Saturday, November 4, 2017 at 1:07:19 PM UTC-4, Blake Messer wrote:

The problem I’m having is that my two-strip-matrix doesn’t operate like the SimPixel driver that I’ve been developing against. I ran the MatrixCalibrationTest against both drivers and from that test I see the same result on both drivers. However, when I try to run my own animations they do not behave the same way at all-- the second row seems to be flipped (it should be mapped as serpentine but isn’t). The weird thing is that I can change the layout on the SimPixel driver, but can’t seem to get those changes to be reflected by the behavior of the hardware driver.

It almost seems like the WS281X driver is ignoring the coordinate map, but that doesn’t make sense because the calibration test has the expected behavior. Am I writing my animations wrong? Using deprecated animation methods? Is it a bug? Any information would be helpful.

I’m using the handy dandy AllPixel, if that’s relevant. And here’s the code I’m running, if that’s useful: https://github.com/rblakemesser/beam/blob/master/beam.py#L238

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/8c0d14d8-21c6-4a07-9be7-6f89c0525f7b%40googlegroups.com.

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


/t

https://tom.ritchford.com

https://tom.swirly.com

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

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

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

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/a1979edf-36b8-4df3-b324-71d14ace8cad%40googlegroups.com.

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

+1 Tom. That was making auto-docs really hard.

···

On Mon, Nov 6, 2017 at 10:47 AM, Tom Swirly tom@swirly.com wrote:

Every rational person prefers the code to the documentation. :smiley:

This is a trap and I’m quickly going to prepare a commit that will put this trap out of commission, so you’ll be the last person to put their foot into it.

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/CAOuQWfXT%3D7W1fyxr5TUR3Uy-78%3DOrm_yq0sEfAQ6kvQoppQYKA%40mail.gmail.com.

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

On Mon, Nov 6, 2017 at 4:42 PM, Blake Messer rblakemesser@gmail.com wrote:

@Tom Swirly Thank you! I was hoping it was something like that. I had found a couple places where the documentation was wrong, so I assumed that I should prefer the code to the documentation. I also found the bibliopixel library very cleanly written, overall. I was a little suspicious at calling an underscored-setter, but I saw that .setRGB() uses it here, so figured it was all the same. Is setRGB() deprecated?

The lack of a defined set() method in the layout class definition is somewhat confusing-- but now that I understand what’s happening it makes sense.

Thanks for the assist!

On Saturday, 4 November 2017 15:07:30 UTC-5, Tom Swirly wrote:

I can see the issue right from here! :smiley:

The issue is that you’re calling Layout._set_base, which doesn’t take serpentine into account - you should be calling Layout.

My theory is that you’re like me and you read the code in preference to the documentation, saw Layout._set_base but not Layout.set

and used the first one. But we “monkey-patch” in Layout.set depending on the settings to avoid having to test all these conditions on each frame.

This is mentioned in the documentation but it needs to be *reinforced. * I also was confused when I first read that class.

You have written good code, btw, nice and clear - I could spot the problem in an instant because of that.

On Sat, Nov 4, 2017 at 6:22 PM, Maniacal Labs Users maniacal-...@googlegroups.com wrote:

Hi Blake,

You mentioned serpentine, are the LEDs physically wired that way? Have you tried using the ‘serpentine’ option when defining the driver (https://github.com/ManiacalLabs/BiblioPixel/wiki/Matrix) instead of the coord_map? If not, maybe try not specifying a coord_map, but instead use ‘serpentine=True’. That may not be it, but I’d be interested to see if that has a different result on the hardware display vs SimPixel.

Thanks!

-Dan

On Saturday, November 4, 2017 at 1:07:19 PM UTC-4, Blake Messer wrote:

The problem I’m having is that my two-strip-matrix doesn’t operate like the SimPixel driver that I’ve been developing against. I ran the MatrixCalibrationTest against both drivers and from that test I see the same result on both drivers. However, when I try to run my own animations they do not behave the same way at all-- the second row seems to be flipped (it should be mapped as serpentine but isn’t). The weird thing is that I can change the layout on the SimPixel driver, but can’t seem to get those changes to be reflected by the behavior of the hardware driver.

It almost seems like the WS281X driver is ignoring the coordinate map, but that doesn’t make sense because the calibration test has the expected behavior. Am I writing my animations wrong? Using deprecated animation methods? Is it a bug? Any information would be helpful.

I’m using the handy dandy AllPixel, if that’s relevant. And here’s the code I’m running, if that’s useful: https://github.com/rblakemesser/beam/blob/master/beam.py#L238

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/8c0d14d8-21c6-4a07-9be7-6f89c0525f7b%40googlegroups.com.

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


/t

https://tom.ritchford.com

https://tom.swirly.com

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

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

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

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/a1979edf-36b8-4df3-b324-71d14ace8cad%40googlegroups.com.

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


/t

https://tom.ritchford.com

https://tom.swirly.com

https://github.com/ManiacalLabs/BiblioPixel/blob/fedae2e5f4cf4177c3baca26050acb5807b5203f/bibliopixel/layout/layout.py#L7

Where is the set method defined in the init? I seriously can’t find it.

Yeah, I know that underscored methods are generally good for lay-people to avoid-- I just couldn’t find an alternative!

···

On Saturday, 4 November 2017 12:07:19 UTC-5, Blake Messer wrote:

The problem I’m having is that my two-strip-matrix doesn’t operate like the SimPixel driver that I’ve been developing against. I ran the MatrixCalibrationTest against both drivers and from that test I see the same result on both drivers. However, when I try to run my own animations they do not behave the same way at all-- the second row seems to be flipped (it should be mapped as serpentine but isn’t). The weird thing is that I can change the layout on the SimPixel driver, but can’t seem to get those changes to be reflected by the behavior of the hardware driver.

It almost seems like the WS281X driver is ignoring the coordinate map, but that doesn’t make sense because the calibration test has the expected behavior. Am I writing my animations wrong? Using deprecated animation methods? Is it a bug? Any information would be helpful.

I’m using the handy dandy AllPixel, if that’s relevant. And here’s the code I’m running, if that’s useful: https://github.com/rblakemesser/beam/blob/master/beam.py#L238