DeepPiCar icon indicating copy to clipboard operation
DeepPiCar copied to clipboard

issue on deep_pi_car code

Open hareshel opened this issue 5 years ago • 4 comments

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)

hareshel avatar Jan 08 '20 22:01 hareshel

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!

dctian avatar Mar 19 '20 07:03 dctian

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?

knight3000 avatar Mar 29 '20 18:03 knight3000

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!

rb05751 avatar Jun 18 '20 01:06 rb05751

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.

knight3000 avatar Jun 18 '20 03:06 knight3000