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

Fixed issue where metadata would come with garbage #50

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Tjoms99
Copy link

@Tjoms99 Tjoms99 commented Dec 17, 2024

Investigated the PR/issue discussed here #49.

Turns out not properly exiting a program running the PPK2 influences the next PPK2 session. Setting up the metadata the first time will throw an exception due to the garbage data (from the previous session) that comes a long with it. Physically turning the PPK2 on and off using the switch resolves this issue, but that’s inconvenient to do every time; So I’ve added a software fix here :)

To reproduce the issue and showcase the fix

  1. Connect the PPK2 via USB

  2. Open a terminal and run the example

python3 examples/example_measure_mw.py
  1. Terminate the program (2x)
ctrl + c
  1. Run the example again and you'll probably see this in the terminal
Attempt 1/2 - Failed to get valid PPK2 metadata: Could not retrieve valid metadata from the device.
Attempt 2/2 - Got metadata from PPK2
Initialized Power Profiler

This is where the UnicodeDecodeError would previously be triggered

…2 session were not terminated properly due to garbage data coming along with the metadata. We now expect them and try to get metadata one more time, but this time without garbage from previous session
…ld also just work after connecting to a PPK2 via USB
@Tjoms99 Tjoms99 mentioned this pull request Dec 17, 2024
@RmThrt
Copy link

RmThrt commented Dec 27, 2024

Thanks for the fix, it helped to figure out the way my test work! Good fix for me :)

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.

2 participants