Bug in switch debounce settings being sent to FAST.

25 views
Skip to first unread message

Brian Cox

unread,
Sep 4, 2016, 10:40:36 PM9/4/16
to MPF Users
Hi guys,

First, I have my config number setting set to HEX, like so...

config_number_format: hex


Here's the error I get when setting debounce times in the FAST controller:

ValueError: invalid literal for int() with base 10: '1A'


When the config looks like this:

  rightsling:
    number: 5
    tags: 5points, playfield_active
    debounce_open: 99
    debounce_close: '1A'

...or this:

  rightsling:
    number: 5
    tags: 5points, playfield_active
    debounce_open: 99
    debounce_close: 1A

But this works:

  rightsling:
    number: 5
    tags: 5points, playfield_active
    debounce_open: 99
    debounce_close: 10

And the values returned for debounce settings match *in hex*, eg from the terminal window direct to the FAST controller:

SN:05  True    99 10


...BUT...

I get this error here:

ValueError: Hex string is too long.


When I use this config setting for the switch:

  rightsling:
    number: 5
    tags: 5points, playfield_active
    debounce_open: 99
    debounce_close: 100


...so seem like a bug here that *HEX* values are being passed, but the MPF thinks they are supposed to be *INT*, and is thus not allowing the full range of debounce settings,

Any ideas?

BC



Mark Incitti

unread,
Sep 4, 2016, 11:30:18 PM9/4/16
to MPF Users
sure seems like a bug.

workaround:
Bit of work, but you could switch number format to INT and change all the debounce values from HEX to their INT equivalents

Brian Cox

unread,
Sep 5, 2016, 12:04:22 AM9/5/16
to MPF Users
Yeah, I'm actually at that point where I might break down and do that...

Unfortunately, I think the same bug might be on the LED side, and I've got something like 250 LEDs configured already. Which means going through the slog of editing all 250 by hand and hopefully don't make a mistake,

Thanks again for your help!

BC

jabdoa

unread,
Sep 5, 2016, 4:40:47 AM9/5/16
to MPF Users
Hi Brian,

there seems to be a bug. We parse the config to int first in the validator. I will fix that tonight.

Are you sure you want to set debounce to 100ms? That seems extremely high for me.


Jan

Brian Cox

unread,
Sep 5, 2016, 1:07:32 PM9/5/16
to MPF Users
I set the values high for trouble-shooting purposes, since it's difficult to distinguish between 10ms debounce and no debounce at all,

BC


On Sunday, September 4, 2016 at 7:40:36 PM UTC-7, Brian Cox wrote:
Reply all
Reply to author
Forward
0 new messages