Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

servo setup problem #52

Open
Bahauldien opened this issue Jan 8, 2024 · 3 comments
Open

servo setup problem #52

Bahauldien opened this issue Jan 8, 2024 · 3 comments

Comments

@Bahauldien
Copy link

while assembling the car, when i connect the servos and open the server file on terminal & run the servo.py to set them up to 90 i get this message + error:
Now servos will rotate to 90°.
If they have already been at 90°, nothing will be observed.
Please keep the program running when installing the servos.
After that, you can press ctrl-C to end the program.
Traceback (most recent call last):
File "/home/baha/Freenove_4WD_Smart_Car_Kit_for_Raspberry_Pi/Code/Server/servo.py", line 34, in
pwm=Servo()
^^^^^^^
File "/home/baha/Freenove_4WD_Smart_Car_Kit_for_Raspberry_Pi/Code/Server/servo.py", line 5, in init
self.PwmServo = PCA9685(0x40, debug=True)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baha/Freenove_4WD_Smart_Car_Kit_for_Raspberry_Pi/Code/Server/PCA9685.py", line 29, in init
self.bus = smbus.SMBus(1)
^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory

im kinda noob with python and linux but im pretty sure i have the right directory open and i connected everything correctly so far

@Shaynee-MO
Copy link
Member

Please run the command to install smbus and try again.
sudo apt-get install python3-smbus

@HockeyD8
Copy link

I have the same problem, and it’s not solved by reinstalling python3-smbus.

@fire-eggs
Copy link

@HockeyD8 , @Shaynee-MO :
Just to confirm: is the I2C interface enabled on your Raspberry Pi? The FileNotFoundError message may occur if the I2C interface is not enabled.

How to enable I2C is discussed in "Step 2 Configuration" on page 37 of the PDF tutorial. Or,
here's one tutorial that walks through the process of enabling it via the command line utility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants