autorope / donkeydocs

Docs for donkeycar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Errors running the calibrate step

dmccreary opened this issue · comments

Hi - I have several new Raspberry Pi 4 (with 4GB) and when I run the calibrate command

$ donkey calibrate --channel 0 --bus=1

I get an error:

using donkey v4.2.1 ...
sombrero enabled
init PCA9685 on channel 0 address 0x40 bus 1
Using PWM freq: 60
Traceback (most recent call last):
File "/home/pi/env/bin/donkey", line 33, in
sys.exit(load_entry_point('donkeycar', 'console_scripts', 'donkey')())
File "/home/pi/projects/donkeycar/donkeycar/management/base.py", line 500, in execute_from_command_line
c.run(args[2:])
File "/home/pi/projects/donkeycar/donkeycar/management/base.py", line 219, in run
c = PCA9685(channel, address=address, busnum=busnum, frequency=freq)
File "/home/pi/projects/donkeycar/donkeycar/parts/actuator.py", line 30, in init
self.pwm = Adafruit_PCA9685.PCA9685(address=address)
File "/home/pi/env/lib/python3.7/site-packages/Adafruit_PCA9685/PCA9685.py", line 75, in init
self.set_all_pwm(0, 0)
File "/home/pi/env/lib/python3.7/site-packages/Adafruit_PCA9685/PCA9685.py", line 111, in set_all_pwm
self._device.write8(ALL_LED_ON_L, on & 0xFF)
File "/home/pi/env/lib/python3.7/site-packages/Adafruit_GPIO/I2C.py", line 114, in write8
self._bus.write_byte_data(self._address, register, value)
File "/home/pi/env/lib/python3.7/site-packages/Adafruit_PureIO/smbus.py", line 327, in write_byte_data
self._device.write(data)
OSError: [Errno 121] Remote I/O error
sombrero disabled

Has anyone seen this before or have hints on how to get it working?

I have verified that the i2c is working:

$ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --

$ i2cdetect -F 1

Functionalities implemented by /dev/i2c-1:
I2C yes
SMBus Quick Command yes
SMBus Send Byte yes
SMBus Receive Byte yes
SMBus Write Byte yes
SMBus Read Byte yes
SMBus Write Word yes
SMBus Read Word yes
SMBus Process Call yes
SMBus Block Write yes
SMBus Block Read no
SMBus Block Process Call no
SMBus PEC yes
I2C Block Write yes
I2C Block Read yes

my name -a
Linux danpi 5.10.17-v7l+ #1421 SMP Thu May 27 14:00:13 BST 2021 armv7l GNU/Linux

Thanks! - Dan

I isolated the problem to interaction with a prior virtual environment that was Python 3.6. I reimaged and got consistent Python 3.7 and then everything worked.

Should have known to check the Python --version at 3.7 after setting up the virtual env.