Pan-Tilt Hat Problem

Trying to get a new Pan-Tilt Hat with servos to work but having program errors.
I have buster installed on a RPI 3 B and call Thonny with the timeout.py program and I get the following errors displayed --Whats going wrong?

Python 3.7.3 (/usr/bin/python3)

%cd /home/pi/Pimoroni/pantilthat/examples
%Run timeout.py
Traceback (most recent call last):
File “/home/pi/Pimoroni/pantilthat/examples/timeout.py”, line 10, in
pantilthat.pan(-90)
File “/usr/lib/python3/dist-packages/pantilthat/pantilt.py”, line 466, in servo_one
self.setup()
File “/usr/lib/python3/dist-packages/pantilthat/pantilt.py”, line 80, in setup
self._set_config()
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

I’m not sure exactly what’s going wrong, but double check how you have the servo’s plugged in.
Make sure the yellow wire is going to the PWM pin on the Pan Tilt Hat.

And I just want to confirm you have run the installer
curl https://get.pimoroni.com/pantilthat | bash

Greetings

Wiring is fine and I used that same curl script to obtain Pimoroni software

Tom

Ok, that rules that out. Hat firmly pressed down on the Pi’s GPIO header?
I think I would remove it and reseat it.

Did you buy the full kit that includes the servo’s, or are you using your own servo’s?

Greetings

I bought both the pan-tilt head and servos from Pimoroni. None of the examples seen to work and display error messages.
Tom

Double check that i2c is enabled.
Do you have anything esle connected to i2c?

Try running sudo i2cdetect -y 1 from terminal.
All you should see is 0x15.

Greetings
Your suggestion helped greatly.
The pantilthat board was reseated and i2c showed up.

I have another question - included in pantilthat examples is a Pantiltweb.py program which appears to call a Flask - I type in my RPI web address and see a graphic on the screen with four directions but it doesn’t appear to do anything.
Are you familiar with this example?

No, I have never used Flask. I’m running my Pan Tilts with Motion Eye OS. And I did up my own python file for testing them from Raspbian / Pi OS.
I setup Action Buttons in Motion Eye OS to control my Pan Tilts from Motion Eyes Web GUI, via a browser window. I can see what they see and control them from the one interface.