Skip to content

Large Angular Motor 45602 causes Technic Hub (88012) to disconnect or crash when initialized on Pybricks 3.6.1 #2395

Open

Description

@kpennock

When attempting to initialize or run a SPIKE Large Angular Motor (45602) on a Technic Hub (88012) running Pybricks firmware v3.6.1, the hub immediately drops the Bluetooth connection and becomes unresponsive. I have tried 2 different motors on all 4 ports.
The same 2 motors work normally on a SPIKE Prime Hub with the same Pybricks version. Additionally, other sensors such as the color and distance sensor, work as expected on the Technic Hub, so it seems that only the motors are having difficulties with Pybricks.

With the following program, the hub connects to Bluetooth, prints "Initializing motor...", then pauses, disconnects from bluetooth, and stalls.

from pybricks.hubs import TechnicHub
from pybricks.pupdevices import Motor
from pybricks.parameters import Port

# Initialize the hub
hub = TechnicHub()

# Initialize the Large Angular Motor (45602) on Port D
motor = Motor(Port.D)
print("Motor initialized successfully.")

# Run the motor forward for 3 seconds
motor.run_time(500, 3000, then=Stop.HOLD)

# Now run it backward for 3 seconds
motor.run_time(-500, 3000, then=Stop.HOLD)

# Print to show it is done
print("Motor run successfully.")

I expected the motor to turn forward and backward and print messages, but the program froze during motor initialization and dropped the Bluetooth connection so no print statements were reached. I have tried all 4 ports on the technic hub with no success. I have also tried multiple programs that operate with the motor initialization line commented out, but fail as soon as I uncomment the motor initialization line. I have verified that the motors work normally on Spike Prime hub and that sensors (distance, color) work on the technic hub. The only problem seems to be the large angular motors.

Image

Activity

  1. added
    triage
    on Oct 13, 2025
  2. dlech commented on Oct 13, 2025

    @dlech
    Member

    This sounds like something is causing the hub to crash. I'm not sure what it could be though since most of the firmware code is shared between hubs.

    You could try running the nightly build of the firmware to see if the issue has already been fixed.

    https://nightly.link/pybricks/pybricks-micropython/workflows/build/master

  3. kpennock commented on Oct 13, 2025

    @kpennock
    Author

    Will do. Thank you.
    Just did. Even worse results. Now the motors are not even recognized by the firmware in the latest nightly build, with an error message stating that no device was connected to the target port.

  4. BertLindeman commented on Oct 13, 2025

    @BertLindeman

    Did you also try to define Stop like this:

    from pybricks.parameters import Port, Stop

    I get this error without it:

    Motor initialized successfully.
    Traceback (most recent call last):
      File "issue_2395_orig.py", line 13, in <module>
    NameError: name 'Stop' isn't defined
    

    [EDIT}
    Tested with
    ('technichub', '4.0.0a0', 'ci-build-4272-v3.6.1-523-g4cc72417 on 2025-10-07')
    and
    ('technichub', '3.6.1', 'ci-build-3937-v3.6.1-231-gd76f61ae on 2025-07-11')

  5. dlech commented on Oct 13, 2025

    @dlech
    Member

    Even worse results

    I would say that printing an error message is better than losing the Bluetooth connection because the hub crashed. 😄

    Other than using a logic analyzer to spy on the signal or building a special debug build of the firmware, I'm not sure how we could debug the motors any more though. Since you said that they work fine on other hubs and other sensors work fine on this hub, it kind of rules out any hardware issues.

  6. kpennock commented on Oct 13, 2025

    @kpennock
    Author

    I included Stop this time:

    from pybricks.hubs import TechnicHub
    from pybricks.pupdevices import Motor
    from pybricks.parameters import Color, Port, Stop
    from pybricks.tools import wait
    
    hub = TechnicHub()
    
    print("Beginning...")
    hub.light.on(Color.GREEN)
    wait(2000)
    motor = Motor(Port.B)
    hub.light.on(Color.WHITE)
    wait(2000)
    motor.run(500)  # runs motor at 500 deg/s
    hub.light.on(Color.RED)
    wait(2000)
    hub.light.off()
    motor.stop(Stop.HOLD)

    The code never gets to the Color.White. It just freezes on Green, never making it past the motor instantiation.

  7. kpennock commented on Oct 13, 2025

    @kpennock
    Author
  8. BertLindeman commented on Oct 13, 2025

    @BertLindeman

    I ran your program on my Technichub and it runs fine until the syntax error on the last line

    motor.stop(Stop.HOLD)

    motor.stop() has no arguments.

    But the program shows GREEN, WHITE and RED with a large Spike motor on Port B.

    Do you see any messages in the log area below the python code?
    I got:

    Beginning...
    Traceback (most recent call last):
      File "issue_2395_test2.py", line 18, in <module>
    TypeError: function takes 1 positional arguments but 2 were given
    
  9. kpennock commented on Oct 13, 2025

    @kpennock
    Author
  10. BertLindeman commented on Oct 13, 2025

    @BertLindeman

    Thanks for your response.

    My tests ran with stable 3.6.1 and a 4.0 pre-alpa firmware with out problem.
    Tried two different hubs too.

    In no way am I a hardware technician.
    But could this have to do with a bad contact or cable problem?
    Hard to proove though.

  11. kpennock commented on Oct 13, 2025

    @kpennock
    Author
  12. kpennock commented on Oct 13, 2025

    @kpennock
    Author
  13. BertLindeman commented on Oct 13, 2025

    @BertLindeman

    And the probability that both new motors have a similar hardware problem
    seems pretty small.

    I agree and have no more hints at the moment.

  14. kpennock commented on Oct 13, 2025

    @kpennock
    Author
  15. BertLindeman commented on Oct 14, 2025

    @BertLindeman

    Just a hunch: what if the batteries are at the end of their live?

    A motor needs more power than a sensor.

    Adjusted your program to show the battery voltage:

    from pybricks.hubs import TechnicHub
    from pybricks.pupdevices import Motor
    from pybricks.parameters import Color, Port, Stop
    from pybricks.tools import wait
    
    hub = TechnicHub()
    
    print(f"{'Beginning...':<16}\t {hub.battery.voltage()/1000:>4.2f} V")
    hub.light.on(Color.GREEN)
    print(f"\t{'Green':<16} {hub.battery.voltage()/1000:>4.2f} V")
    wait(2000)
    print(f"\t{'Define motor':<16} {hub.battery.voltage()/1000:>4.2f} V")
    motor = Motor(Port.B)
    print(f"\t{'White':<16} {hub.battery.voltage()/1000:>4.2f} V")
    hub.light.on(Color.WHITE)
    wait(2000)
    print(f"\t{'Run motor':<16} {hub.battery.voltage()/1000:>4.2f} V")
    motor.run(500) # runs motor at 500 deg/s
    print(f"\t{'Red':<16} {hub.battery.voltage()/1000:>4.2f} V")
    hub.light.on(Color.RED)
    wait(2000)
    hub.light.off()
    # motor.stop(Stop.HOLD)
    motor.stop()
    print(f"\t{'motor stopped':<16} {hub.battery.voltage()/1000:>4.2f} V")

    My output looks like this at the moment:

    Beginning...             7.43 V
            Green            7.43 V
            Define motor     7.45 V
            White            7.45 V
            Run motor        7.44 V
            Red              7.44 V
            motor stopped    6.90 V
    

    You see that the voltage after 2 seconds motor run drops by half a volt.
    Quite a lot.
    Maybe this shows us something?

    What if you turn the motor slower e.g. 100 in stead of 500?

  16. 6 remaining items

  17. added
    software: pybricks-micropython
    on Oct 14, 2025
  18. added theissue type on Oct 14, 2025
  19. TechnicBRICKs commented on Oct 14, 2025

    @TechnicBRICKs

    It is here Laurens!
    See the second line from the end (a comment indeed).
    Hence I was wondering...
    Feel free to delete my posts if you feel so. Sorry to deviate from the topic.

    Image
  20. kpennock commented on Oct 14, 2025

    @kpennock
    Author

    There isn't a piezo in the Technic Hub or anywhere in this thread, either. Can we keep it on topic, please? 😄

    Sorry. The beep wasn't actually encoded, just included it as a mistaken comment. Used a print instead to show completion/lack thereof.

  21. laurensvalk commented on Oct 14, 2025

    @laurensvalk
    Member

    No worries, it's all good. Hopefully we can figure out what's up with these motors 😄

    It's possible that slight manufacturing variations/changes could cause this, and maybe we can update the code to account for it.

  22. kpennock commented on Oct 14, 2025

    @kpennock
    Author

    Thanks for reporting this issue. We've prepared a test build that lets you collect some extra information about your sensor.

    Could you please follow these instructions:

    • for your Technic Hub
    • for your SPIKE Prime Hub

    Comparing the results might help us determine the difference and possibly fix what is going on.

    Thanks.

    I tried loading the new build (technichub-firmware-build-4293-git73e88dd9.zip) on the Technic. I began loading it 3 times, and all 3 times it failed at about the 68% mark with the same message: "The hub said something went wrong".

    I don't have access to the Spike Prime Hub at the moment, so cannot the build to that one.

  23. laurensvalk commented on Oct 14, 2025

    @laurensvalk
    Member

    That's quite an unusual one, since the firmware update process hasn't changed in any way. Is it possible that the hub batteries are very low?

  24. kpennock commented on Oct 14, 2025

    @kpennock
    Author
  25. joshhiggins22 commented on Dec 16, 2025

    @joshhiggins22

    Can I help provide any logs or debugging? I have the same problem with the large motor and it's causing issues for our school teams. We have technic hubs and Prime Essential hubs. Both hubs freeze when trying to use the large angular motor. Running the same motors with official Lego firmware works OK. I have 4 different motors and multiple hubs, and all show same issue.

  26. laurensvalk commented on Dec 16, 2025

    @laurensvalk
    Member

    Thank you. When it freezes, does the square running animation on the display keep going or does it turn off altogether?

    Assuming the animation keeps spinning --- if you pull the motor cable out in this state, does it then raise the expected error about cabled being not connected? Does the line number of the error correspond to the Motor(Port.....) line?

    Yes, I think we can make a firmware variant that will print out helpful information. Thank you for offering to help. With the questions above I'm hoping to close in on what we should be logging exactly.

  27. joshhiggins22 commented on Dec 16, 2025

    @joshhiggins22

    Thank you. When it freezes, does the square running animation on the display keep going or does it turn off altogether?

    For display, there is no animation on the essential hubs, just the blinking led, which in this case goes to pulsating blue, which is not normal.

    Assuming the animation keeps spinning --- if you pull the motor cable out in this state, does it then raise the expected error about cabled being not connected? Does the line number of the error correspond to the Motor(Port.....) line?
    My test file will hang when trying to initialize, with pulsing blue light on the hub. If I pull the cable while it's in this state, it does throw an error

    pybricksdev run ble ./test-large-angular-motor-spike-essential.py
    Searching for any hub with Pybricks service...
    100%|████████████████████████████████████████████████████████████████████| 430/430 [00:00<00:00, 1.88kB/s]
    Initializing motor
    exception: [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.
    

    The test file is like:

    from pybricks.hubs import EssentialHub
    from pybricks.parameters import Axis, Direction, Port, Stop
    from pybricks.pupdevices import Motor
    
    hub = EssentialHub()
    print('Initializing motor')
    big_motor = Motor(Port.B)
    print('Motor initialized')
    big_motor.run_angle(100, 45)
    big_motor.run_angle(100, -45)
    
  28. laurensvalk commented on Dec 16, 2025

    @laurensvalk
    Member

    Thank you. That means the hub is OK. It sounds like this motor variant is sending some information that the hub is not expecting. I'll try to put together some test code to log the differences.

    Since you're using Technic Hubs and Essential Hubs, are you using the dark grey Large Angular Motor from a Technic set or are the motors from elsewhere?

  29. joshhiggins22 commented on Dec 16, 2025

    @joshhiggins22

    The motors I'm using are AliExpress versions of this LEGO Technic Large Angular Motor 45602

    I realize AliExpress may be a non-standard motor, but they seem to work fine with Lego firmware.

  30. laurensvalk commented on Dec 16, 2025

    @laurensvalk
    Member

    Ah. Off brand manufacturers tend to not implement the full device protocol. There are a few requests for supporting this. We may get around to this eventually but our priority lies with the original devices.

    I think this thread was indicating a different issue for original motors.

  31. dlech commented on Dec 16, 2025

    @dlech
    Member

    AliExpress

    We also have #2305 for tracking that. So if you do some logging, please share it there to help us keep things organized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    hub: technichubsoftware: pybricks-micropythontopic: motors

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions