OSError: [Errno 19] ENODEV] on City Hub (60197) after Motor Initialization (Motor Works via Remote) #2403
Unanswered
BlueGuyOfficial
asked this question in
Q&A
Replies: 2 comments 5 replies
-
|
Is it an original Lego motor, and if so, which one? Pro tip: Please do not use AI to ask humans for help. |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Hi, Not sure if the remote has to do with motor initialization. Do you have a short program with the definitions you use? from pybricks.hubs import CityHub
from pybricks.pupdevices import DCMotor
from pybricks.parameters import Port
from pybricks.tools import wait
train_motor = DCMotor(Port.A)
train_motor.dc(50)
wait(1000)Does this program help you? Bert |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The Problem:
I am consistently encountering an OSError: [Errno 19] ENODEV] when trying to initialize a motor on the LEGO City Hub (part number 60197) using the Pybricks MicroPython firmware.
The error occurs on the line: motor = Motor(Port.A) or motor = Motor(Port.B).
Confirmed Facts (Troubleshooting Performed):
Hardware is NOT faulty: The train motor and City Hub work perfectly when controlled using the official LEGO Powered Up Remote Control.
Ultimate Software Reset Performed: I have fully reset the hub by flashing the Official LEGO Firmware (via the Powered Up App) and then reinstalling the latest Pybricks firmware.
Port-Independent: The error occurs on both Port A and Port B when testing in the Pybricks REPL terminal.
Connection Independent: The error persists even when attempting to run the script standalone (saved permanently to the hub and run without an active Bluetooth connection to the Editor).
Conclusion:
This points to a specific, deep-seated initialization bug within the Pybricks firmware itself that prevents the software from properly detecting a motor connected to the City Hub's ports, despite the hardware functioning correctly.
Beta Was this translation helpful? Give feedback.
All reactions