support icon indicating copy to clipboard operation
support copied to clipboard

[Bug] Pressing stop button during long print reboots Technic Hub.

Open laurensvalk opened this issue 2 years ago • 1 comments

Describe the bug I was debugging sensors and came across something that was ultimately not related to sensors at all. But since it can happen with sensors, it is somewhat likely for users to encounter it.

To reproduce

Install this program on the hub and stay connected to Pybricks Code.

Press the hub button repeatedly. Eventually you will press it while the green light is on. Then it stays on and the hub reboots with PBDRV_RESET_REASON_WATCHDOG

from pybricks.hubs import ThisHub
from pybricks.parameters import Color

hub = ThisHub()
hub.light.on(Color.GREEN)
print("""
Traceback (most recent call last):
  File "sensorinit.py", line 10, in <module>
OSError: [Errno 19] ENODEV: 

A sensor or motor is not connected to the specified port:
--> Check the cables to each motor and sensor.
--> Check the port settings in your script.
--> Check the line in your script that matches
    the line number given in the 'Traceback' above.
""")

Expected behavior No crash.

Addional notes I think I was able to reproduce this on Prime Hub at least once, but it is much less likely to occur.

laurensvalk avatar Jul 10 '23 08:07 laurensvalk

This is still happening in V3.4.0b2.

laurensvalk avatar Feb 27 '24 18:02 laurensvalk