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] City Hub does not turn itself off after timeout. #1195

Closed
laurensvalk opened this issue Aug 4, 2023 · 2 comments
Closed

[Bug] City Hub does not turn itself off after timeout. #1195

laurensvalk opened this issue Aug 4, 2023 · 2 comments
Labels
bug Something isn't working hub: cityhub Issues related to the LEGO Powered Up Smart hub (Hub No. 4) software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime)

Comments

@laurensvalk
Copy link
Member

Describe the bug
It is supposed to turn off after a few minutes if not connected.

Or maybe it does, but it turns itself back on?

Could be related to the recent ioport changes.

@laurensvalk laurensvalk added bug Something isn't working hub: cityhub Issues related to the LEGO Powered Up Smart hub (Hub No. 4) labels Aug 4, 2023
@dlech
Copy link
Member

dlech commented Aug 4, 2023

This was fixed most recently by pybricks/pybricks-micropython@019d95c.

It is probably broken again by pbdrv_ioport_init(); in

void pbdrv_ioport_deinit(void) {
    pbdrv_ioport_init();

    // Turn off power on pin 4 on all ports. This is set to input instead of
    // low to avoid city/move hubs turning back on when button released.
    // as soon as the user releases the power button
    pbdrv_gpio_input(&pbdrv_ioport_pup_platform_data.port_vcc);
}

pbdrv_ioport_deinit() is called multiple times by the pbsys_io_ports_poll() so the VCC keeps getting set to out low instead of input which is what was identified as the issue previously. Also the pbdrv_init_busy_up/down() triggered by this could keep the hub from shutting down.

@dlech dlech added the software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime) label Aug 4, 2023
@laurensvalk
Copy link
Member Author

laurensvalk commented Oct 26, 2023

Suggested fixes above implemented in by pybricks/pybricks-micropython@f5d0d81, and now the hub times out and shuts down normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hub: cityhub Issues related to the LEGO Powered Up Smart hub (Hub No. 4) software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime)
Projects
None yet
Development

No branches or pull requests

2 participants