Serial LED Slowness

99 views
Skip to first unread message

Greg Sealby

unread,
Sep 14, 2019, 10:57:26 PM9/14/19
to MPF Users
We are installing serial LEDs in our game and having a few issues.  I have configured my two serial LED strips in the config.yaml like this:

p_roc:
    pd_led_boards
:
       
0:
            use_ws281x_0
: TRUE
            use_ws281x_1
: TRUE
            ws281x_0_first_address
: 100
            ws281x_0_last_address
: 249
            ws281x_1_first_address
: 250
            ws281x_1_last_address
: 399

In my light device config file, I have addressed them like this:

    l_serial_left_0:
        number
: 0-100-101-102
        default_on_color
: white
        subtype
: led
    l_serial_left_1
:
        number
: 0-103-104-105
        default_on_color
: white
        subtype
: led    
    l_serial_left_2
:
        number
: 0-106-107-108
        default_on_color
: white
        subtype
: led
.
.
.
    l_serial_left_48
:
        number
: 0-244-245-246
        default_on_color
: white
        subtype
: led
# Right
    l_serial_right_0
:
        number
: 0-250-251-252
        default_on_color
: white
        subtype
: led
    l_serial_right_1
:
        number
: 0-253-254-255
        default_on_color
: white
        subtype
: led    
    l_serial_right_2
:
        number
: 0-256-257-258
        default_on_color
: white
        subtype
: led
.
.
.
    l_serial_right_48
:
        number
: 0-394-395-396
        default_on_color
: white
        subtype
: led
 
We have the following issues;
  1. The first channel of serial LEDs (left) lights up fine, the second (right) does not turn on.  This might be a hardware/wiring issue, but thought there might be a bug in my config that someone might be able to see.
  2. The Serial channel that does light up runs far slower than expected.  I have a light show in my attract mode that is supposed to change colour on each LED every 1 second.  It lights them up in different colours (so I can see that the show is firing) but it runs very slowly and only changes every 3-4 seconds.
  3. I've also noticed that the standard single LEDs that are connected to the same PD-LED board as the serial LEDs are also running extremely slowly.  Single LEDs on the other board are running without any latency.
I notice in the doco that there are the following optional properties that can be set:
ws281x_end_bit_time

ws281x_high_bit_time

ws281x_low_bit_time

ws281x_reset_bit_time


It mentions that they should rarely need to be changed, but am wondering if I need to - and if so, what is the recommendation to modifying these properties in increase speed.

Thanks,
Greg

Greg Sealby

unread,
Sep 15, 2019, 1:59:50 AM9/15/19
to MPF Users
OK, so I have done some more analysis on this issue.  I stripped everything back and started from the basics - firstly went back to buzzing wiring for connection and tested each component right through to running shows.  

Issue number 1 looks like some dodgy soldering on my LED strip as there didn't seem to be a connection in the power channel.

The trigger for issue number 3 was when I started my show that contained the serial LEDs.  When I turn that show off, the standard LEDs work fine. My show code is:

#show_version=5
- duration: 1s
  lights
:
# Left
    l_serial_left_0
: WHITE
    l_serial_left_1
: WHITE
    l_serial_left_2
: WHITE
    l_serial_left_3
: WHITE
.
.
.
    l_serial_right_48: WHITE
- duration: 1s 

My show player code is like this:

show_player:
    shot_ball_plunged_hit
:
        serials_always_on
:
            loops
: -1
            priority
: 10

As I want these to be always on ... do I need to put them into a repeating show?



jabdoa

unread,
Sep 15, 2019, 6:46:15 AM9/15/19
to MPF Users
Set "duration: -1" to your show and it will run until stopped (and will not loop). This will save you a few updates per second which might cause your issues.

Jan

mike wiz

unread,
Sep 15, 2019, 10:10:12 AM9/15/19
to MPF Users


Are these for GI lights?

You could just tag all of them.

    l_serial_left_0:
        number
: 0-100-101-102
        default_on_color
: white
        subtype
: led
        tags: gi


show_player:
 
shot_ball_plunged_hit:
    gi_on:
      action: play

shows:
  gi_on:
    - lights:
        gi:
          color: white


The way you are doing you might need to key the shows?

Greg Sealby

unread,
Sep 16, 2019, 9:01:50 AM9/16/19
to MPF Users


On Sunday, 15 September 2019 20:46:15 UTC+10, jabdoa wrote:
Set "duration: -1" to your show and it will run until stopped (and will not loop). This will save you a few updates per second which might cause your issues.

Jan

Unfortunately, this didn't make any difference.  The Serial on one side show up perfectly, but all other single LEDs on the same board are affected (ie. frozen). 

jabdoa

unread,
Sep 16, 2019, 5:09:23 PM9/16/19
to MPF Users
Hi Greg,

Can you try mpf dev? We did some improvements there. If you set debug: True inside the p3_roc section you should also see what mpf sends to the P3-Roc. That should allow us to understand your problem. Unfortunately, that debug is only available in dev.

Jan

Greg Sealby

unread,
Sep 22, 2019, 12:30:15 AM9/22/19
to MPF Users
OK, so some further information on this issue.

We've tested both serial strips (left and right) and they both function when run off channel 0 (J8 pin 19 on PD-LED) independently ... so no hardware issues with the strips.

Looking at the CPU performance, we've not seen either MPF or MC raise over 18% when running shows on the serials...so not pointing to a performance issue with the processor.

What we have noticed is that the light shows that are supposed to show on the playfield single LEDs are showing on the second serial LED once it is activated in a show (eg. an always on show).  This seems to suggest that there is some sort of addressing overlap.

I am using addresses 0-71 for the single LEDs (eg. 0-0-1-2 through 0-69-70-71) and starting the second serial string at 250 (eg. 0-250-251-252 through 0-394-395-396).

Is there something missing from my config that would cause this?  

jabdoa

unread,
Sep 22, 2019, 5:35:47 AM9/22/19
to MPF Users
Can you tell which number maps to which? Maybe something like 305 -> 50, 306 -> 51 and so on? That would indicate that we somewhere loose the first bit of the second byte.


Jan

Greg Sealby

unread,
Sep 23, 2019, 9:06:14 AM9/23/19
to MPF Users
Here you go Jan:

Single LED address

Serial LED they come up as when Serial is on

0-0-1-2

0-256-257-258

0-3-4-5

0-259-260-261

0-6-7-8

0-262-263-264

0-9-10-11

0-265-266-267

0-12-13-14

0-268-269-270

0-15-16-17

0-271-272-273

0-18-19-20 (not used)

0-274-275-276 (assumed)

0-21-22-23

0-277-278-279

0-24-25-26

0-280-281-282

0-27-28-29

0-283-284-285

0-30-31-32

0-286-287-288

0-33-34-35

0-289-290-291

0-36-37-38

0-292-293-294

0-39-40-41

0-295-296-297

0-42-43-44

0-298-299-300

0-45-46-47

0-301-302-303

0-48-49-50

0-304-305-306

0-51-52-53

0-307-308-309

0-54-55-56

0-310-311-312

0-57-58-59

0-313-314-315

0-60-61-62

0-316-317-318

0-63-64-65

0-319-320-321

0-66-67-68

0-322-323-324

0-69-70-71

0-325-326-327

jabdoa

unread,
Sep 23, 2019, 11:19:50 AM9/23/19
to MPF Users
Hi Greg,

I talked to Gerry and it turns out that you probably need a feature for LEDs above 256 which is only in MPF dev. Can you give dev a try?


Jan

Greg Sealby

unread,
Sep 29, 2019, 6:24:24 AM9/29/19
to MPF Users
Jan, I tried the latest dev version (53.59 I think) and it worked a treat.  Whatever the feature is that is in there it worked perfectly.  All serial LEDS on both strips come on and I can control them (turned the off/on and ran a few shows on them).

Thanks so much for that tip!

The only issue I have now is the colours are off in the Serial LEDs.  Looks like the greens and reds are backwards.  I tried to reverse the polarity (I need to do this for the Single LEDs) but the colours come out different again when I do this.  Do you know if this is a known issue?  I'm pretty sure we have wired up the correct RGB channels, but will check them again. 

jabdoa

unread,
Sep 29, 2019, 12:38:30 PM9/29/19
to MPF Users
You might have had some kind of offset because of the missing ninth but before. Maybe all numbers are off by one or two?

Jan

Greg Sealby

unread,
Sep 29, 2019, 6:31:25 PM9/29/19
to MPF Users
So, you mean instead of starting at 0-100-101-102 I should start at 0-101-102-103?

Chris D

unread,
Sep 29, 2019, 6:49:16 PM9/29/19
to MPF Users
Don't stress about it Greg.

Soon you'll be moving to a new hardware platform that makes it all easier to code :P

jabdoa

unread,
Sep 30, 2019, 2:45:34 AM9/30/19
to MPF Users
100 should be red of your first LED. 101 green and 102 blue. If you just turn the first LED to red which color will turn on?


Jan

Greg Sealby

unread,
Sep 30, 2019, 5:22:01 AM9/30/19
to MPF Users
Hi Jan,

I did a few tests tonight...

MPF Command          Serial Light Colour
GREEN                RED
BLUE                 BLUE
RED                  GREEN
YELLOW               YELLOW
PURPLE               LIGHT BLUE
or CYAN maybe
WHITE                WHITE


Curious that yellow came out OK.  Considering purple was incorrect as well, makes me think that the RED channel is off in some way.  How are these channels set?  We are not wiring RGB channels like in standard LEDs ... they are just one data feed.

tri...@gmail.com

unread,
Sep 30, 2019, 5:31:51 AM9/30/19
to mpf-...@googlegroups.com
Since it's swapping red and green, it makes sense that ywllow is fine, since that's just red + green.



Sent from my iPad
--
You received this message because you are subscribed to the Google Groups "MPF Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mpf-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpf-users/12c2deb5-03c0-4883-8c66-b931eccf16bf%40googlegroups.com.

mike wiz

unread,
Sep 30, 2019, 8:28:37 AM9/30/19
to MPF Users
I run fast and serial rgbs ....here is my config for 1 led:

  l_rook_x:
    number: 0-9
    type: grb
    label: led9
    tags: playfield

not sure if you need to put type:grb for proc.

Greg Sealby

unread,
Sep 30, 2019, 8:36:24 AM9/30/19
to MPF Users
Thanks Kevin, yeah that makes sense.  

Looks like the Red and Green channels are being reversed in MPF when sending the colour codes to the serial output.  I checked an RGB colour code table for purple with the red and green codes reversed and I got light blue.

Is there something in the config I need to do to get these to reverse.  In the light device config, should I set the type to GRB?

type: grb

instead of what I have currently


  subtype: led



Greg Sealby

unread,
Sep 30, 2019, 8:40:26 AM9/30/19
to MPF Users
Thanks Mike.  I think that might be it.

I just noticed this line in the MPF doco:
When using serial LEDs (e.g. with FAST or Fadecandy), use rgb for WS2812 and grb for WS2811 LEDs.

I'm guessing our LEDs are WS2811...

Greg Sealby

unread,
Sep 30, 2019, 11:37:16 AM9/30/19
to MPF Users
Confirmed.  We have WS2811's - so GRB is required.  Colours are fine now.

However, noticed that there is some pauses in Serial shows.  Has anybody had any experience with this?  Should I play around with configs like:

mpf:
   default_light_hw_update_hz: 50


jabdoa

unread,
Sep 30, 2019, 1:27:58 PM9/30/19
to MPF Users
You could also change the order of your numbers. Instead of "0-394-395-396" use "0-395-394-396". Changing the type obviously also works. I guess we should add a section about this on the PD-LED page too.

Jan

Reply all
Reply to author
Forward
0 new messages