I’ve found a few threads talking about this same issue over the years, but unfortunately none of them seem to have found a solution. When I try to import the explorerhat library I get the following error:
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/explorerhat/__init__.py", line 756, in <module>
touch._add(one=CapTouchInput(4, 1))
File "/usr/lib/python3/dist-packages/explorerhat/__init__.py", line 595, in __init__
_cap1208.on(channel=self.channel, event=event, handler=self._handle_state)
File "/usr/lib/python3/dist-packages/cap1xxx.py", line 386, in on
self.start_watching()
File "/usr/lib/python3/dist-packages/cap1xxx.py", line 400, in start_watching
self.async_poll.start()
File "/usr/lib/python3/dist-packages/cap1xxx.py", line 208, in start
if self.isAlive() == False:
AttributeError: 'AsyncWorker' object has no attribute 'isAlive'
So far I’ve done / tried the following:
- sudo apt-get update
- Turned on i2C in the configuration settings
- sudo apt-get install python-smbus python3-smbus python-dev python3-dev i2c-tools
- curl https://get.pimoroni.com/explorerhat | bash
I2C appears to be working fine, because if I run the following:
sudo i2cdetect -y 1
I get these results:
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- 28 -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
The contents of the I2C folder also seem to be what I’m guessing they should be, as this:
ls /dev/i2c*
Gives me this:
/dev/i2c-1 /dev/i2c-20 /dev/i2c-21
This is my first attempts at working with Pi’s, or really electronics in general, so I’m not sure where to go from here. I’m running the latest version of the default Pi OS (I think it’s bullseye?) on a brand new Pi4, and I’m about to do a fresh OS install just to rule that out.
Update:
I’ve just got the same error on a completely fresh, fully updated copy of the same OS.
When I run the curl script it says everything is installed and enabled, so I’m pretty lost at this point.