Skip to content

[Bug] DCMotor does not function with CityHub in PortA after no device attached warning #500

Closed
@s-drahcir

Description

@s-drahcir

Describe the bug
DCMotor (in my case train motor) does not work with CityHub when plugged in to Port A AFTER warning regarding no device attached/detected etc (OSError: [Errno 19] ENODEV)

To reproduce
Use https://beta.pybricks.com/ v3.1 with CityHub and train motor. CityHub reports: ('cityhub', '3.1.0b1', 'v3.1.0b1 on 2021-09-21').

  1. In beta.pybricks.com, use the example "Making a train drive forever".
  2. With no DCMotor attached, run example. At this point, the script will stop and the console will show:

Traceback (most recent call last):
File "main.py", line 7, in
OSError: [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.

ValueError: incompatible .mpy file

  1. Plug DCMotor into Port A.
  2. Run the script again. At this point, the script runs with no errors on the console until it is stopped. However, the DCMotor does nothing.

Expected behavior
For it to work :)

Notes
It's possible it is not just limited to DCMotor. However, as this is the only device I have, that's all I can confirm.
Does not appear to have the same issue with Port B when specified in the script. It will warn, but plugging DCMotor into Port B and then running the script again works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingplatform: Powered UpIssues related to LEGO Powered Uptopic: motorsIssues involving motors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions