jlefkoff / GridBoard

a project to use an LED matrix for grid based games for the '21 Interactive art installations winterm
MIT License
0 stars 1 forks source link

MQTT Button processing #19

Closed gsalaman closed 3 years ago

gsalaman commented 3 years ago

When running with both MQTT and serial buttons, the "button_client" test (just text) works fine...but button_test_blocking with images doesn't see MQTT.

Note I think this may be related to serial...when I'm playing with the launcher, disconnected from serial, I get MQTT presses just fine...

gsalaman commented 3 years ago

...except now it's not getting any presses, even without serial. Sniffer sees the presses, but GridBoard does not.

gsalaman commented 3 years ago

Okay, progress. I think that the blocking issue was because of missing sleeps in the driver. I think I've got that one nailed.

But then I think the issue is that by including "get_buttons" in each sub-module, we make multple MQTT clients with the same name. By only doing one "app" (and therefore one client), life is good.

Gonna do some more testing, but I think we'll need to initialize our button handler once in the top level (like "matrix"), and then pass it down to the subsequent apps.

gsalaman commented 3 years ago

Okay, weird. Running it again, and now It's happy...multiple times...without passing the button presser.

Gonna check in a "checkpoint" here...

gsalaman commented 3 years ago

More playing...the multiple "get_buttons" doesn't seem to be the issue. I think it was a weird side effect of doing image initalizations in global space in an app...we'll need to trigger them from the class. Tweaking my way through the rest of the TTT driver...

gsalaman commented 3 years ago

Yup...this looks happy now. I've got it checked in on my glenn_ttt_launch branch...gonna leave this issue open until I try it on the jumbotron to be sure...

gsalaman commented 3 years ago

...and, tried it on the jumbotron, and all is good.