OS error :Failed to write byte

I am running in to this error almost every time i use the pan-tilt hat and the servo’s doesnt even move.
Anyone know any solutions to this?

Traceback (most recent call last):
File “/home/pi/track/facetracker.py”, line 37, in
File “/usr/lib/python3/dist-packages/pantilthat/pantilt.py”, line 466, in servo_one
File “/usr/lib/python3/dist-packages/pantilthat/pantilt.py”, line 80, in setup
File “/usr/lib/python3/dist-packages/pantilthat/pantilt.py”, line 118, in _set_config
self._i2c_write_byte(self.REG_CONFIG, config)
File “/usr/lib/python3/dist-packages/pantilthat/pantilt.py”, line 209, in _i2c_write_byte
raise IOError(“Failed to write byte”)
OSError: Failed to write byte

You aren’t Sreehar, are you?

It sounds like you’re getting intermittent failure of the I2C bus. Is this a program you’ve written yourself? If so, do any of the default examples work? If not, how have you connected the pan-tilt to the Pi?

Yes same person.
I did not write the code.
Default examples shows same error.
like this

That doesn’t look like Pimoroni’s Pan Tilt Hat?
And if it isn’t, that’s why their code doesn’t work on it.

Yeah, that looks like a Waveshare Pan Tilt (although it also looks like a product shot, so maybe they just grabbed the first vaguely similar thing off google to illustrate?)