-
Notifications
You must be signed in to change notification settings - Fork 177
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
kostal: more debug output to get better understanding of temporal behaviour #644
Merged
dalathegreat
merged 2 commits into
dalathegreat:main
from
lewurm:kostal-rs485-more-debug
Jan 12, 2025
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we should just drop
DEBUG_KOSTAL_RS485_DATA
and useDEBUG_VIA_USB
for everything.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we have still heavy debugging going on, i prefer keeping DEBUG_KOSTAL_RS485_DATA and DEBUG_VIA_USB separated.
But that drop dropped is good, as i just figured out, that we must replace zero bytes of RX frame before rx processing, as otherwise we don't process eg. this: if (RS485_RXFRAME[6] == 0x5E) when RXFRAME[7] is 0x00
Also rx frame length may be more than 10 bytes, as there is sent EPOCH timestamp on one frame (actually never seen that, but seen on BYD code that)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm handling that in my WIP branch: https://github.com/lewurm/Battery-Emulator/blob/1df27f4444ec0cfac8822256208db3e5ff780c06/Software/src/inverter/KOSTAL-RS485.cpp#L244-L249 and https://github.com/lewurm/Battery-Emulator/blob/1df27f4444ec0cfac8822256208db3e5ff780c06/Software/src/inverter/KOSTAL-RS485.cpp#L492-L497
But I don't want to submit that change just yet, because apparently some people have success with the current state and I want to understand why by adding additional logging. I suspect that it works by chance, because we send the right answer after a timeout:
Battery-Emulator/Software/src/inverter/KOSTAL-RS485.cpp
Lines 266 to 268 in 4232da8
That should be covered by the
dump_rs485_data_rx(" (!RX_allow)");
case, at least it would print it in several steps then. But indeed, I haven't seen it in any traces yet.