WeatherHat: Failed to add edge protection

I have just received the Weather Hat from Pimoroni.
I have been battling to get the or any other code to run. I have started with a fresh install and tried on various Raspberry Pi 3’s. I keep getting the following error:

RuntimeError: Failed to add edge detection.

I am starting to think that the Hat is faulty, any help please?

Are you using Pi OS Lite? If so, you might need to sudo apt install python3-pip git libatlas-base-dev to grab the extra dependencies.

(and then possibly run our installer again - I can’t remember if that was necessary)

Nope not using Pi OS Lite, using the full version.

Hmm, did you get any errors when you ran the installer?

None at all. I have done a few fresh installs, each time the same?

I am having the same issue. Cant seem to find assistance anyhwere

A year and no help with this?
Fresh install of latest Raspbian and getting this error.
Any help gratefully received.

Traceback (most recent call last):
  File "/home/pi/", line 4, in <module>
    sensor = weatherhat.WeatherHAT()
  File "/home/pi/.local/lib/python3.11/site-packages/weatherhat/", line 80, in __init__
  File "/home/pi/.local/lib/python3.11/site-packages/ioexpander/", line 411, in on_interrupt
    self._gpio.add_event_detect(self._interrupt_pin, self._gpio.FALLING, callback=callback, bouncetime=1)
RuntimeError: Failed to add edge detection


import weatherhat
import time

sensor = weatherhat.WeatherHAT()

while True:
        sensor.update(interval = 0.5)

You can contact tech support by e-mail.
Contact Us for Raspberry Pi Technical Support - Pimoroni

Thanks. Just seems a shame that more than one person has this issue and the conversation suddenly stopped.
I’ll email and post back here with what emerges.

So sorry that this one fell off my radar!

This sounds somewhat like your error - might be worth checking that you don’t have anything else trying to use BCM 4 (or 1 wire enabled in sudo raspi-config)?: