Replies: 5 comments 10 replies
-
Hi Ben, Not sure if this is even possible on your current model, but here goes: hardware:The obvious things:
A step deeper:
firmware:
from pybricks import version
print(version) program:Is your program large? Just some thoughts, Bert |
Beta Was this translation helpful? Give feedback.
-
What version of the firmware are you on? It's hard to say what 'latest' means. To find out, you can just open the REPL. (Click >>> next to the stop button). It starts by printing the version. |
Beta Was this translation helpful? Give feedback.
-
Well after following Bert's suggestion, I changed for fresh batteries, tried a different hub then put the original configuration back together and am no longer able to recreate the problem. So apologies for wasting both of your time! Seems like it was in the end a hardware issue of some sort. Your help is much appreciated |
Beta Was this translation helpful? Give feedback.
-
Hi Ben, Thanks for reporting back. We really like reports like yours (Hm, I should perhaps say "I") So, Ben, no time wasted. Happy pybricking, Bert |
Beta Was this translation helpful? Give feedback.
-
Well the plot thickens a bit here guys... I'm now more confused than I was before. So I've been using my setup all day and it came time to change the batteries so I replaced them with some freshly re-charged Energizer batteries (these ones: https://www.amazon.co.uk/dp/B004HUYOQ0). I fire up the hub again and no matter how many times I restart it I'm getting either this: The requested operation is not valid in the current state: On this line: motor.run(1000) OR I'm getting the original error in this thread about the motor not being connected. I restart the thing, replug in the motor and nothing works. Either one of these two errors. Then I decide to just run a really cutdown program: from pybricks.hubs import CityHub
from pybricks.pupdevices import Motor, Light
from pybricks.parameters import Button, Color, Direction, Port, Side, Stop
from pybricks.robotics import DriveBase
from pybricks.tools import wait, StopWatch
hub = CityHub()
motor = Motor(port=Port.A)
while True:
motor.run(1000) THIS WORKS! I then reinstall my original program and it's working again. I've got no idea what's going on here but figured it was worth adding to this conversation. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm on the latest version of the Pybricks firmware and around 1/3 times I start up my City Hub I have the following:
Traceback (most recent call last):
File "Train_AllInOne.py", line 17, 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.
I restart the hub and 9 times out of 10 it works then. Sometimes I have to restart a third time. The error appears random and I'm convinced it's not a loose connection.
Any ideas?
Cheers,
Ben
Beta Was this translation helpful? Give feedback.
All reactions