# 4WD HAT Module - input output model

**URL:** <https://forum.sunfounder.com/t/4wd-hat-module-input-output-model/1710>\
**Category:** Robotic kit for Raspberry Pi\
**Created:** [September 20, 2024, 8:02pm UTC](https://forum.sunfounder.com/t/4wd-hat-module-input-output-model/1710 "2024-09-20T20:02:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![barqawicloud](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.sunfounder.com/barqawicloud/32/882_2.png) [@barqawicloud](https://forum.sunfounder.com/u/barqawicloud)\
**Post date:** [September 20, 2024, 8:02pm UTC](https://forum.sunfounder.com/t/4wd-hat-module-input-output-model/1710/1 "2024-09-20T20:02:22Z")

</div>

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:

```auto
  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.

 ![PI with 4WD Hat](https://canada1.discourse-cdn.com/flex029/uploads/sunfounder/original/1X/a2e4ad6ef2d9d84fd8e0a132f61d4ed3afa23fff.jpeg)

---

<div class="post-metadata">

**Author:** ![Spf650](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@Spf650](https://forum.sunfounder.com/u/Spf650)\
**Post date:** [September 21, 2024, 8:56am UTC](https://forum.sunfounder.com/t/4wd-hat-module-input-output-model/1710/2 "2024-09-21T08:56:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![barqawicloud](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.sunfounder.com/barqawicloud/32/882_2.png) [@barqawicloud](https://forum.sunfounder.com/u/barqawicloud)\
**Post date:** [September 21, 2024, 11:39am UTC](https://forum.sunfounder.com/t/4wd-hat-module-input-output-model/1710/3 "2024-09-21T11:39:38Z")

</div>

> [@Spf650](#):
>
> raspi-config

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

```auto
  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

```

---

<div class="post-metadata">

**Author:** ![Spf650](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@Spf650](https://forum.sunfounder.com/u/Spf650)\
**Post date:** [September 21, 2024, 1:24pm UTC](https://forum.sunfounder.com/t/4wd-hat-module-input-output-model/1710/4 "2024-09-21T13:24:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [September 23, 2024, 3:55am UTC](https://forum.sunfounder.com/t/4wd-hat-module-input-output-model/1710/5 "2024-09-23T03:55:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![barqawicloud](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.sunfounder.com/barqawicloud/32/882_2.png) [@barqawicloud](https://forum.sunfounder.com/u/barqawicloud)\
**Post date:** [September 23, 2024, 12:44pm UTC](https://forum.sunfounder.com/t/4wd-hat-module-input-output-model/1710/6 "2024-09-23T12:44:44Z")

</div>

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.
