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

Flash p0 via ui is not working #157

Closed
pascalzauberzeug opened this issue Jul 25, 2024 · 2 comments · Fixed by #158
Closed

Flash p0 via ui is not working #157

pascalzauberzeug opened this issue Jul 25, 2024 · 2 comments · Fixed by #158
Labels
bug Something isn't working
Milestone

Comments

@pascalzauberzeug
Copy link
Contributor

While working on #156 we noticed that flashing p0 via ui does not work correctly.
The boot sequence of p0 still showed the old version. However flashing p0 via monitor.py worked perfectly fine.

The whole waiting loop should be reworked, because it just waits for 3 seconds and then tells the user that it's finished.

A quick fix would be to wait for a longer duration (I measured 43 seconds to flash p0), but the better way would be to wait for I (100726) replicator: Replica complete. on the serial with an emergency timeout.

@pascalzauberzeug pascalzauberzeug added the bug Something isn't working label Jul 25, 2024
@pascalzauberzeug pascalzauberzeug added this to the 0.12.0 milestone Jul 25, 2024
@falkoschindler
Copy link
Contributor

@pascalzauberzeug If I recall correctly, the idea behind the waiting loop is to wait until hardware_time exceeds the start time plus 3 seconds - or until the timeout is reached. This should work, because hardware_time basically freezes during the flash process when no core message is received. Only after flashing and rebooting the ESP, new core messages lead to a time update and the loop exits.

while (self.robot_brain.hardware_time or 0) < start + 3.0:
if rosys.time() > start + 60.0:
rosys.notify('Failed.', 'negative')
return
await rosys.sleep(0.1)

But I can imagine that this logic is rather fragile. Waiting for "Replica complete" sounds like a more robust approach.

@falkoschindler falkoschindler linked a pull request Jul 25, 2024 that will close this issue
@pascalzauberzeug
Copy link
Contributor Author

@falkoschindler yes, you are correct. It does freeze. But then I don't understand why it doesn't work. We have to look into that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants