forked from missionpinball/mpf
-
Notifications
You must be signed in to change notification settings - Fork 0
Kyle hp extensions #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
bosh
wants to merge
16
commits into
hp_extensions
Choose a base branch
from
kyle_hp_extensions
base: hp_extensions
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… not yet supported and rgb and rgbw (ws2812 and sk6812) can be mixed in on a single port without any ordering issue (if configured correctly) so there is no need to distinguish at the header level for them
… led device addressing
…shot handling previously only delay_switch was allowed. Note that the format of these delay events is event_handler:ms, but unlike the usual where ms means the delay before acting, this ms represents the duration of the delay (which is applied immediately)
… behavior around device properties named _events
…D: goes to a board and for some reason it is unresponsive. Added logging to see the current iteration of board from config, and what serial commands are being sent, as well as logging the response received. Fix an issue where send_and_wait_for_response_processed wasn't properly timing out and retry. When board initially doesn't respond to ID: and timeout/retry is succesful, a valid response is received but with bad data preceeding the expected ID: and would cause a crash. Improve the parser to search for potential headers in returned data.
Fix an error where send_and_wait_for_response would hang if sending "ID:"" goes to a board and for some reason it is unresponsive.
Added logging to see the current iteration of board from config, and what serial commands are being sent, as well as logging the response received.
Fix an issue where send_and_wait_for_response_processed wasn't properly timing out and retry.
When board initially doesn't respond to ID: and timeout/retry is succesful, a valid response is received but with bad data preceeding the expected ID: and would cause a crash.
Improve the parser to search for potential headers in returned data.
mpf/platforms/fast/communicators/base.py
Implemented real request/response timeouts & retries:
Rewrote send_and_wait_for_response() to actually await the arrival event.
Added send_and_wait_for_response_processed(...) with bounded waits for arrival and processing complete, proper retry loop (supports max_retries = -1), and safe gate release.
Ensured done_processing_msg_response() releases both gates to avoid deadlocks.
Hardened serial parsing:
Replaced naïve msg.decode() with a CR-framed loop that tolerates noise, logs raw bytes, decodes with errors="ignore", strips control chars, and finds valid headers inside a line (so leading junk won’t drop frames).
Keeps parsing even if a line handler raises (no reader crash).
Added targeted logging for TX attempts, timeouts, retries, and processing phases.
mpf/platforms/fast/communicators/exp.py
Discovery & verification:
Normalized model strings, chose explicit or default addresses, and logged board_name, model, and board_address for each board.
Logged registration steps and active_board transitions.
After each registration, issued ID@<addr>: for the EXP and all breakouts with the new processed wait (bounded).
Message processors:
_process_id() and _process_br() now signal arrival immediately and call done_processing_msg_response() when done, preventing hangs.
Added optional debug dump of self.exp_boards_by_address to console for quick inspection.
mpf/platforms/fast/fast_exp_board.py
LED config quality-of-life:
Reworked create_led_ports() to build grouped configurations (per 4-header block), auto-fill unassigned ports up to 128 LEDs per group, and emit ER@ programming messages deterministically.
Added detailed logs per group: overrides, prepared sets, offsets/counts, and ER:P acks.
Hardware verification:
Clear logs for EXP vs. breakout verification, min-fw checks, and hw_verified flags.
Reset flow:
Explicit BR@ reset, then LED programming, then optional fade setup; logs include correlation IDs.
… keys. SA, SL, /L, -L were being filtered out because they were not in the static list
The parse_incoming_raw_bytes function was rigid in the type of serial headers that it was looking for. Alter code to make dynamic.
… kyle_hp_extensions. This includes a fix for parse_incoming_raw_bytes to add SA, /L, -L, etc... as well as making it dynamic to look for all message_processors.keys
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.