Skip to content
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

feat: View Raw Messages #91

Merged
merged 6 commits into from
Jun 11, 2024
Merged

Conversation

AarjavJain101
Copy link
Contributor

@AarjavJain101 AarjavJain101 commented Jun 10, 2024

Purpose:

  • Instead of having the tables with the raw hex fly by on your terminal you can now use the --raw or --rawest option to simply print the raw data coming over serial as a hex string. This helps greatly with debugging firmware issues because it shows how your data is packed and helps with identifying patterns in data.
  • From the README.md:
    image

Changes:

  • Added --raw option to the argument list and its associated print hex statement. This option is meant to print the message field that will be sent to the parser.
    image

  • Added the --rawest option to the argument list and its associated print hex statement. This option prints the exact hex chunk received over radio without any post-processing with the process_message function (this just cuts up the chunk into valid message pieces).
    image

  • Added try and catch check for fromhex error when converting hex message to latin-1 string in process_message function. This previously would crash the problem (the reason for this problem existing it unknown), now it will print what it tried to convert and will DISCARD THE ENTIRE CHUNK COLLECTED.

  • Added README.md for the memorator upload script so people know to change the log folder path to where the SD card is before uploading.

FIXES:

  • Previous fix_concat_msg branch missed changing parse_response['message'] to msg in the no-write endpoint on the parser. This meant that any concatenated messages would not be split up and parse fails would still occur.
  • Variable fail_msg accessed in the INFLUX_WRITE_FAIL check, however, was only initialized in the PARSE_FAIL check outside of scope.
  • This emphasizes the important of running all types of tests rather than low-message-rate tests where no stress is applied. A test suite will automate this but the underlying issue of missing tests is crucial.

@@ -705,9 +718,15 @@ def main():
# read in bytes from COM port
chunk = ser.read(CHUNK_SIZE)
chunk = chunk.hex()

if args.rawest:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to make it very clear that the args.rawest prints can have incomplete messages. Can you please add their usage (as well as this warning) in the README

Copy link
Contributor

@ishanjoshi23 ishanjoshi23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will merge after README updates

@ishanjoshi23 ishanjoshi23 merged commit 492695f into main Jun 11, 2024
1 check passed
@ishanjoshi23 ishanjoshi23 deleted the user/Aarjavjain101/view_raw_msg_opt branch June 11, 2024 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants