You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] City Hub Locks Up with Bluetooth and Peripheral Combinations (Firmware 4.0.1, Windows) #2793
Describe the bug
After shutting down the City Hub, it enters an unresponsive state. Holding the power button causes the status light to strobe at around 10hz. After that, the only way to exit out of this state is to remove and reinsert the batteries.
As far as I know, this can only be reproduced if the PU Train Motor is plugged into Port A, and the PU Light is plugged into Port B.
To reproduce
Steps to reproduce the behavior:
Firmware Version: 4.0.1 (Flashed from Pybricks Code website), Hub Type: City Hub
Plug the Powered Up Train Motor (Part #88011) into Port A
Plug the Powered Up Light (Part #88005) into Port B
Run a program (I used a simplified version of the program that was triggering the lockup, which had all of these components in it):
# MAKE SURE THE MOTOR IS IN PORT "A" AND THE LIGHT IS IN PORT "B" frompybricks.hubsimportCityHubfrompybricks.pupdevicesimportRemotefrompybricks.toolsimportwaithub=CityHub()
remote=Remote()
hub.system.set_stop_button(None)
wait(1000)
remote.disconnect()
wait(1000)
raiseSystemExit
Power off the hub by holding the power button for 3 seconds
The hub should now have no light on. It should not respond to button presses. Long press the button on the hub, and it will now start strobing blue and it will be completely unresponsive.
Remove the batteries from the hub, and reinsert them. The hub should now work normally.
I have also tested this exact procedure on the Technic Hub and everything seemed to work fine. There was no strobing or unresponsiveness.
Expected behavior
I'd expect the hub to shut down and power back on normally without locking up and requiring a battery swap.
There is no Powered Up Train Motor in my inventory, so cannot exactly follow your scenario.
Running cityhub on firmware v4.1.0b2 (flashed from beta.pybricks.com)
On port A: part 26913 Motor, Medium Linear, Powered Up 4 x 6 x 3
On port B: the Powered Up Light
run your program
Power off the hub by long press
hub goes off
press hub button
hub goes on
No idea if the train motor triggers your problem.
The program does not setup the motor nor the light, Not sure that the firmware cares if they are connected?
Have tried this scenario 10 times with PC connection and 10 without PC connection.
No problem found in my case.
But as said I have no Train motor.
I wasn't able to trigger the issue on 4.1.0b2. I also tried 10 times with the correct train motor, and I also initialized the pupdevices in the code just in case if that was the underlying problem.
I looked at the 4.1.0b2 release notes, and did not find a fix for this, but could well be that a small timing difference in the firmware in 4.1.0b2 is better than in 4.0.1. The cityhub had sometimes poweroff/on problems like this in older releases.
You're welcome. I'll continue doing a few tests over the course of the next week and I'll comment here in case I find a concrete trigger to this issue.
Activity
BertLindeman commentedon Aug 23, 2026
There is no Powered Up Train Motor in my inventory, so cannot exactly follow your scenario.
No idea if the train motor triggers your problem.
The program does not setup the motor nor the light, Not sure that the firmware cares if they are connected?
Have tried this scenario 10 times with PC connection and 10 without PC connection.
No problem found in my case.
But as said I have no Train motor.
Did you try firmware v4.1.0b2 ?
SML365 commentedon Aug 23, 2026
I wasn't able to trigger the issue on 4.1.0b2. I also tried 10 times with the correct train motor, and I also initialized the pupdevices in the code just in case if that was the underlying problem.
BertLindeman commentedon Aug 23, 2026
I looked at the 4.1.0b2 release notes, and did not find a fix for this, but could well be that a small timing difference in the firmware in 4.1.0b2 is better than in 4.0.1. The cityhub had sometimes poweroff/on problems like this in older releases.
Thanks for reporting back.
SML365 commentedon Aug 23, 2026
You're welcome. I'll continue doing a few tests over the course of the next week and I'll comment here in case I find a concrete trigger to this issue.
laurensvalk commentedon Oct 8, 2026
We've fixed a lot in this driver lately. Would you like to test it with today's https://beta.pybricks.com/? Thanks!
(Pybricks Beta v3.1.0-beta.8 with firmware v4.1.0b6)