4WD HAT Module - input output model

I purchased the SunFounder Robot Car Kit for Raspberry Pi, which includes a 4WD HAT Module. However, I’m having issues running the picar-4wd commands.

I installed the recommended Raspberry Pi OS, connected the 4WD HAT to my Raspberry Pi 4 B, and then attempted to run the test commands:
picar-4wd test motor

I received the following error:

  File "/usr/lib/python3/dist-packages/smbus2/smbus2.py", line 496, in write_word_data
    ioctl(self.fd, I2C_SMBUS, msg)
OSError: [Errno 5] Input/output error.

Event when I run picar-4wd I get the same error.

Have you enabled the i2c on the rpi4 via raspi-config?

yes I already enabled the i2c from raspi-config. but the same error is printed:

  File "/usr/local/lib/python3.11/dist-packages/picar_4wd-1.1.1-py3.11.egg/picar_4wd/i2c.py", line 37, in _i2c_write_word_data
    return self._smbus.write_word_data(addr, reg, data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/smbus2/smbus2.py", line 496, in write_word_data
    ioctl(self.fd, I2C_SMBUS, msg)
OSError: [Errno 5] Input/output error

Ah ok. I thought that the Sunfounder team maybe don’t work at the weekend, so I was hoping just to get you going before Monday.

It’s possibly worth disabling i2c, rebooting and reenabling it? Or using i2c-detect to check if it’s being found

Sorry I could not help.

1.What version of the system are you currently using? The Bookworm version is currently not compatible with Picar-4WD; we recommend using the Legacy version instead.
2.Did you encounter any errors while installing the Picar-4WD software code? If so, please provide a screenshot of the error.
3.Please run the command sudo i2cdetect -y 1 and send us a screenshot of the printed information.
Before that, please ensure that I2C is enabled by running the command sudo raspi-config to enable I2C.

Thanks for response, no errors when installing 4WD software and I2C is enabled .

It might be because of the first reason, as I installed Bookworm version. will test the legacy version.