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] Shutdown not working on TechnicHub #1438

Closed
Debenben opened this issue Feb 10, 2024 · 5 comments
Closed

[Bug] Shutdown not working on TechnicHub #1438

Debenben opened this issue Feb 10, 2024 · 5 comments
Labels
bug Something isn't working software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime)

Comments

@Debenben
Copy link

Describe the bug
The hub is blinking blue very fast instead of shutting down. The problem appeared when updating my TechnicHub to the last Beta version:

('technichub', '3.4.0b1', 'v1.20.0-23-g6c633a8dd on 2024-02-01')

The previous version and Inventorhub do not have this problem. There are two ways to reproduce:

First way to reproduce

from pybricks.hubs import TechnicHub
from pybricks.tools import wait
from pybricks import version

print(version)
hub = TechnicHub()
wait(100)
hub.system.shutdown()

Second way to reproduce

from pybricks.hubs import TechnicHub
from pybricks.tools import wait
from pybricks import version

print(version)
hub = TechnicHub()
hub.system.set_stop_button(None)
wait(100000)

run the program and long-press the button while it is running.

@Debenben Debenben added the triage Issues that have not been triaged yet label Feb 10, 2024
@laurensvalk
Copy link
Member

Thanks for reporting!

We've got a next beta released scheduled for this week, but I think this issue is a high priority one to fix directly after.

@laurensvalk laurensvalk added bug Something isn't working software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime) and removed triage Issues that have not been triaged yet labels Feb 11, 2024
@laurensvalk
Copy link
Member

laurensvalk commented Feb 11, 2024

This appears to be introduced in pybricks/pybricks-micropython@04fd2e7

@BertLindeman
Copy link

Just for the record:

The both scenario's also hit this problem on a technichub at

('technichub', '3.3.0', 'ci-build-3232-v3.3.0-20-ge836b04f on 2024-01-25')

Not only the technichub though. Seen on movehub and cityhub.

laurensvalk added a commit to pybricks/pybricks-micropython that referenced this issue Feb 11, 2024
We have an old hack that shuts down the bluetooth process. When starting a new task after that in a cleanup routine such as added in 04fd2e7, the hub will never finish the task, which prevents the user program from stopping.

We have several proper fixes in place now, and we are about to merge some updates that will make all Bluetooth task objects static, so we should remove this hack.

Fixes pybricks/support#1438
@laurensvalk
Copy link
Member

laurensvalk commented Feb 11, 2024

Found the likely culprit! If this fix looks okay we can include it in this week's beta.

This appears to be introduced in pybricks/pybricks-micropython@04fd2e7

While technically true (the symptoms stated there), the above commit is in fact one part of a series of proper fixes that allow us to remove an old hack that I think it a root cause of various Bluetooth-related shutdown issues.

laurensvalk added a commit to pybricks/pybricks-micropython that referenced this issue Feb 16, 2024
We have an old hack that shuts down the bluetooth process. When starting a new task after that in a cleanup routine such as added in 04fd2e7, the hub will never finish the task, which prevents the user program from stopping.

We have several proper fixes in place now, and we are about to merge some updates that will make all Bluetooth task objects static, so we should remove this hack.

Fixes pybricks/support#1438
laurensvalk added a commit to pybricks/pybricks-micropython that referenced this issue Feb 16, 2024
We have an old hack that shuts down the bluetooth process. When starting a new task after that in a cleanup routine such as added in 04fd2e7, the hub will never finish the task, which prevents the user program from stopping.

We have several proper fixes in place now, and we are about to merge some updates that will make all Bluetooth task objects static, so we should remove this hack.

Fixes pybricks/support#1438
@BertLindeman
Copy link

Confirmed fixed on

('primehub', '3.4.0b2', 'v1.20.0-23-g6c633a8dd on 2024-02-14')
('cityhub', '3.4.0b2', 'v1.20.0-23-g6c633a8dd on 2024-02-14')

First scenario stops the hub.
Second scenario keeps running until timeout (as programmed 100 seconds) or a long press on the hub button,
and then does the shutdown.

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-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants