Closed BertLindeman closed 3 years ago
Does the same thing happen on other hubs or only the TechnicHub?
Does the same thing happen on other hubs or only the TechnicHub?
David, I only have the TechnicHub, MoveHub, PrimeHub and InventorHub. The results of those are above in the console log.
I do not know for the other hubs.
Sorry, I was just looking at the title of the issue.
Thanks for reporting this and for taking the time to test this on all hubs.
Possibly related: I recently noticed that it was possible to initialize DCMotor
when in fact a regular Motor
was attached. I don't remember for sure, but it could have been the Technic Hub indeed.
Funny, may be related, but not on a technichub: The example for DCMotor does work on the movehub. This program:
from pybricks.pupdevices import DCMotor
from pybricks.parameters import Port
from pybricks.tools import wait
# Initialize a motor without rotation sensors on port A.
example_motor = DCMotor(Port.A)
# Make the motor go clockwise (forward) at 70% duty cycle ("70% power").
example_motor.dc(70)
# Wait for three seconds.
wait(3000)
# Make the motor go counterclockwise (backward) at 70% duty cycle.
example_motor.dc(-70)
# Wait for three seconds.
wait(3000)
But also on the TechnicHub... And the motor on port A is correctly reported as id=75 the inventor medium motor.
So maybe it's a different issue then. Thanks!
raise BaseException("Unknown hub " + hw_type)
(off topic) Python tip: Always use Exception
instead of BaseException
or even better, a more specific exception like RuntimeError
.
Measurement shows that something is pulling down the ID2 pin on Technic Hub.
Top line is ID2, second line is ID1. Measurements taken with no sensor connected, showing device detection sequence repeating.
BaseException
(off topic) Python tip: Always use Exception instead of BaseException or even better, a more specific exception like RuntimeError.
Thank you, David. I really like these little nudges in the direction of writing better python.
(more on topic) I now have a "powered-up leds" device that should be reported as "8". Will test it the next firmware distribution.
Found build artifact and this issue is fixed.
trimmed extra ENODEV
messages
('technichub', '3.0.0b1', 'v3.0.0b1-15-ga4b616f7 on 2021-02-03')
technichub loaded
Battery voltage: 7839 mV
On: Port.A OSError [Errno 19] ENODEV:
On: Port.B OSError [Errno 19] ENODEV:
On: Port.C OSError [Errno 19] ENODEV:
On: Port.D OSError [Errno 19] ENODEV:
And with leds attached to port C and D:
On Port.C device.ID= 8 {'id': 8}
On Port.D device.ID= 8 {'id': 8}
To reproduce Steps to reproduce the behavior:
Expected behavior Would have expected the hubs all to response the same or similar at least. . Either return an OSError ENODEV or . return a device ID of '0' zero
Priority LOW
Screenshots None now
Source used
Console log