seengreat / Motor-And-Servo-Driver-HAT

1 stars 1 forks source link

Error on Raspberry PI 4 after install your setup guide #1

Open ChR-iSz opened 1 year ago

ChR-iSz commented 1 year ago

With your demo code example, i get follow error: (All jumper aure OFF)

root@raspberrypi:/tmp/Motor-And-Servo-Driver-HAT/raspberry pi/python# python3 pca9685.py 
Traceback (most recent call last):
  File "/tmp/Motor-And-Servo-Driver-HAT/raspberry pi/python/pca9685.py", line 95, in <module>
    pwm = PCA9685()
  File "/tmp/Motor-And-Servo-Driver-HAT/raspberry pi/python/pca9685.py", line 41, in __init__
    self.write_reg(MODE1, 0x00)
  File "/tmp/Motor-And-Servo-Driver-HAT/raspberry pi/python/pca9685.py", line 44, in write_reg
    self.i2c.write_byte_data(self.dev_addr, reg, value)
OSError: [Errno 121] Remote I/O error

i2cdetect:

root@raspberrypi:/home/pi# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: 70 -- -- -- -- -- -- -- 

gpio

root@raspberrypi:/home/pi# gpio -v
gpio version: 2.52
Copyright (c) 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
  Type: Pi 4B, Revision: 02, Memory: 4096MB, Maker: Sony 
  * Device tree is enabled.
  *--> Raspberry Pi 4 Model B Rev 1.2
  * This Raspberry Pi supports user-level GPIO access.
darkharasho commented 4 months ago

Any chance you solved this issue? I am running into the same thing.

seengreat commented 1 month ago
  1. Please turn all the bits on the I2C address setting switch to the "1" position, and then use the "i2cdetect -y -a 1" command to detect the address of the PCA9685 chip, and the result will be "7f";
  2. Change the address of line 40 of the pca9685.py file to "self.dev_addr = 0x7f"; I am very sorry that this version of the code was used for testing at the time and was not modified.