-
-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Closed
Copy link
Labels
software: pybricks-micropythonIssues with Pybricks MicroPython firmware (or EV3 runtime)Issues with Pybricks MicroPython firmware (or EV3 runtime)
Description
Describe the bug
Program is a tight loop printing f-strings. Within seconds the hub does a shutdown (somehow)
The display animation is no longer smooth but has large hickups.
Might this be related to #436 ?
To reproduce
Steps to reproduce the behavior:
- connect the hub to USB for power
- Running in code.pybricks.com or beta
- Current setup is RobotInventor at 3.5.0 and SpikePrime at build 3380 (BT-button change)
- connect to the hub
- start the program (see below) via the app or website
- stop the program via the app and disconnect the hub
- stop the program by long-press on the hub button
- start the hub and run the program again (button press) but do not connect to the app
- a bit of patience (seconds) and see the hub goes OFF
Aditional info
Connected the hub before the test to USB to keep the power on.
After the crash connect to the hub and go to the REPL.
Showed:
>>> hub.system.reset_reason()
2
>>>
Expected behavior
You'd expect the program to just keep running and not to power-off.
Screenshots
There is a saying that a picture is worth a 1000 words. Screenshots really help to identify and solve problems.
test program for this issue
# issues try_movehub_on_prime_6
# start this and while running disconnect with the app
# stop the hub to save the current program
# restart the hub (if build 3380 installed press the BT button -> red)
# start the program with the button, and
# within seconds the running square stops and the hub shutsdown
from pybricks.hubs import PrimeHub
from pybricks.tools import wait
HUB = PrimeHub()
# Initialize variables.
color_list = ["", "", "", "", "", "", ""]
_rand = HUB.battery.current() + HUB.battery.voltage()
# _rand = 123
INDEX = 4
A = 0
B = 5
def main2():
while True:
print(f'pre _rand {_rand:>5} A {A:>2} B {B:>2}', end=" ")
print(f'_rand {_rand:>5} A {A:>2} B {B:>2}')
print(f'INDEX {INDEX:>3} color_list[{INDEX}] {color_list[INDEX]}')
# wait(1) # with 1ms second wait: no problem
wait(0.75) # this wait is not enough to prevent the error
main2()Metadata
Metadata
Assignees
Labels
software: pybricks-micropythonIssues with Pybricks MicroPython firmware (or EV3 runtime)Issues with Pybricks MicroPython firmware (or EV3 runtime)