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

issue on deep_pi_car code #6

Open
hareshel opened this issue Jan 8, 2020 · 4 comments
Open

issue on deep_pi_car code #6

hareshel opened this issue Jan 8, 2020 · 4 comments

Comments

@hareshel
Copy link

hareshel commented Jan 8, 2020

INFO :2020-01-08 14:56:22,072: Creating a DeepPiCar...
DEBUG:2020-01-08 14:56:22,095: Set up camera
Traceback (most recent call last):
File "deep_pi_car.py", line 136, in
main()
File "deep_pi_car.py", line 129, in main
with DeepPiCar() as car:
File "deep_pi_car.py", line 28, in init
self.pan_servo = picar.Servo.Servo(1)
File "/usr/local/lib/python3.7/dist-packages/SunFounder_PiCar-1.0.1-py3.7.egg/picar/SunFounder_PCA9685/Servo.py", line 36, in init
self.pwm = PCA9685.PWM(bus_number=bus_number, address=address)
File "/usr/local/lib/python3.7/dist-packages/SunFounder_PiCar-1.0.1-py3.7.egg/picar/SunFounder_PCA9685/PCA9685.py", line 47, in init
self.bus = smbus.SMBus(self.bus_number)
TypeError: an integer is required (got type NoneType)

@dctian
Copy link
Owner

dctian commented Mar 19, 2020

Please double check your car's electrical connection and make sure batteries are freshly charged. Otherwise, you may get weird low level hardware errors. Hope this helps!

@knight3000
Copy link

Hello, thank you for this amazing walk through! I have the latest Pi 4 and i get the following error when running the deep_pi_car.py

pi@raspberrypi:~/DeepPiCar/driver/code $ python3 deep_pi_car.py
INFO :2020-03-29 11:05:49,178: Creating a DeepPiCar...
[Errno 121] Remote I/O error
Error. Pi revision didn't recognize, module number: b03111
Exiting...

Do i need to edit the code somewhere to include the newer Pi 4 module?

@rb05751
Copy link

rb05751 commented Jun 18, 2020

knight, did you ever figure out how to solve this? I'm have the same exact issue except without the [Errno 121] error. Kind of desperate for an answer!

@knight3000
Copy link

rb05751, yeah i got it to work!

You have to edit PCA9685.py
add this after line 49:
RPI_REVISION_4_MODULE_B = ["b03111"]

Then you need to add this after line 72:
elif pi_revision == '4 Module B':
return 1

Then add this after line 100:
elif line[11:-1] in self.RPI_REVISION_4_MODULE_B:
return '4 Module B'

If i remember correctly, that was the only place you had to edit. Hope it works for you.

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