Hey Alex,
I recieved your initial message via PM. I'll paste it here.
Hi Ryan, interesting problem, thanks for being so specific about
your debugging steps and config. Have flippers previously worked or is
this a last piece of integration that is still to-do?
Before getting into the weeds - the counterpart of sw_flip_events is sw_release_events :)
You
mention that only flippers do not work, and do mention that event-based
flipper activation works as well as misc coil firing, and it sounds
like the trough (so, ball_devices) works as well (though I don't know
anything about VPX or Sol objects) -- does this mean that MPF autofires
also work? I'm going to assume in the rest of this answer that they do,
and dig into the differences between configurations between autofire and
flipper - maybe the solution will be in the gaps there.
When
a flipper is configured, it registers different rules based on the
configuration options. Per your configs and MPF 0.80.0.dev9 ,
mpf/devices/flipper.py:110 in `enable` it seems like you would end up
running the private functions `_enable_main_coil_pulse_rule` and
`_enable_hold_coil_rule`. This would result in the following rules:
```
rule = self.machine.platform_controller.set_pulse_on_hit_and_release_rule(
SwitchRuleSettings(switch=self.config['activation_switch'], debounce=False, invert=False),
DriverRuleSettings(driver=self.config['main_coil'], recycle=False),
PulseRuleSettings(duration=self._get_pulse_ms(), power=self._get_pulse_power())
)
```
```
rule = self.machine.platform_controller.set_pulse_on_hit_and_enable_and_release_rule(
SwitchRuleSettings(switch=self.config['activation_switch'], debounce=False, invert=False),
DriverRuleSettings(driver=self.config['hold_coil'], recycle=False),
PulseRuleSettings(duration=self._get_hold_pulse_ms(), power=self._get_hold_pulse_power()),
HoldRuleSettings(power=self._get_hold_power())
)
```
For comparison, autofire.py:84#enable might have for a miscellaneous device (say, a pop bumper):
self._rule = self.machine.platform_
controller.set_pulse_on_hit_
rule(
SwitchRuleSettings(switch=
self.config['switch'], debounce=debounce, invert=self.config['reverse_
switch']),
DriverRuleSettings(driver=
self.config['coil'], recycle=recycle),
PulseRuleSettings(duration=
self.config['coil_overwrite'].
get('pulse_ms', None), power=self.config['
coil_overwrite'].get('pulse_
power', None))
)
The
rules themselves look pretty similar, and none of them seem to be doing
anything particularly complex to resolve or delay calculation of their
arguments. Maybe something in the details will jump out for you? I
haven't started any spelunking into the platform controller, but the
three rules we see here have three different registration functions (eg `set_pulse_on_hit_and_release_rule`),
maybe something is inconsistent in their implementations?
I'm
happy to keep discussing on here, but groups is a little awkward for
code - if you open an issue or PR on github I'll happily jump there as
well