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

[Bug] Undefined Pybricks Code state after hub.system.reset(1) #378

Closed
laurensvalk opened this issue Jul 1, 2021 · 2 comments
Closed

[Bug] Undefined Pybricks Code state after hub.system.reset(1) #378

laurensvalk opened this issue Jul 1, 2021 · 2 comments
Labels
bug Something isn't working software: pybricks-code Issues with https://code.pybricks.com application

Comments

@laurensvalk
Copy link
Member

laurensvalk commented Jul 1, 2021

Describe the bug
The run button can get stuck, after hub.system.reset(1), and stay that way even if you reconnect.

This test was done on the Technic Hub

Pybricks Code (Beta) v1.1.0-beta.1
Version 91.0.4472.101 (Official Build) Built on Ubuntu , running on Ubuntu 18.04 (64-bit)

To reproduce

image

First run the script, then click play again.

from pybricks.hubs import ThisHub
from pybricks.tools import wait

hub = ThisHub()

print(hub.system.reset_reason())

hub.system.reset(1)

And this isn't too bad.

But it remains stuck after you reconnect, so a hard refresh is required.

image

Expected behavior
Disconnect as during a regular power-off.

@laurensvalk laurensvalk added bug Something isn't working software: pybricks-code Issues with https://code.pybricks.com application labels Jul 1, 2021
@laurensvalk
Copy link
Member Author

Actually, the real cause is one step back. Even though the Bluetooth button correctly shows the disconnected state, the run button becomes enabled again.

image

So if this button were not enabled, the problem documented in the first post couldn't even occur.

dlech added a commit to pybricks/pybricks-code that referenced this issue Jul 1, 2021
This fixes a bad hub runtime state when the hub disconnects during a
download. This caused the run button in the UI to be enabled when the
hub was disconnected.

Issue: pybricks/support#378
@dlech
Copy link
Member

dlech commented Jul 1, 2021

Fix is committed.

@dlech dlech closed this as completed Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working software: pybricks-code Issues with https://code.pybricks.com application
Projects
None yet
Development

No branches or pull requests

2 participants