Skip to content

[Bug] Strange poweroff issue on City Hub with one motor and remote #2606

@laurensvalk

Description

@laurensvalk

This seems to be different from #692 or #385 .

Describe the bug
In specific circumstances, the hub does not turn back on until you pull the battery.

To reproduce (preparation)

  • Install CI build v4.0.0b7 on City Hub
  • Create a program called Poppen.py with the code given below.
  • Connect a motor to port A.
  • Run the program normally
  • Shut the hub down.

To reproduce

  • Turn the hub on, run the program
  • let it find the remote, press some buttons to turn the motor
  • turn the he hub off
  • this seems to be critical release the button as soon as the blink begins

Now the hub appears off but it is not. You cannot turn it back on with the button. If you long press, you immediately go to the shutoff animation again. It is unclear to me that this means it enters shutdown again, or made a full boot cycle and got stuck a second time. (And any firmware change like debugging makes the issue go away)

You have to pull the battery, then attempt to turn it on, and only then reinsert the battery. Then you can turn it on again.

This seems to happen consistently once you get the pattern right. But this happens only with this particular build and with this particular program. It does not happen when I build the firmware locally and it does not happen if I change the motor and program to use port B.

# long comment
from pybricks.parameters import Button, Color, Direction, Port, Stop
from pybricks.pupdevices import Motor, Remote
from pybricks.tools import wait

# Set up.
remote = Remote(timeout=None)
motor = Motor(Port.A, Direction.CLOCKWISE)
Color.BENEDEN = Color(202, 100, 100)
Color.BOVEN = Color(0, 100, 100)
Color.STOP = Color(320, 100, 100)


# The main program starts here.
while True:
    if Button.RIGHT_MINUS in remote.buttons.pressed():
        motor.run(300)
        remote.light.on(Color.BENEDEN)
    elif Button.RIGHT_PLUS in remote.buttons.pressed():
        remote.light.on(Color.BOVEN)
        motor.run(-300)
    else:
        remote.light.on(Color.STOP)
        motor.stop()
    wait(10)

Metadata

Metadata

Assignees

No one assigned

    Labels

    hub: cityhubIssues related to the LEGO Powered Up Smart hub (Hub No. 4)software: pybricks-micropythonIssues with Pybricks MicroPython firmware (or EV3 runtime)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions