[Solved] Explorerphat + pi3 + archlinux -> Product ID -5 not supported!


#1

Hi there!

I have problems getting started with the explorerphat.

This is what i get:

import explorerhat
Traceback (most recent call last):
File “”, line 1, in
File “/usr/lib/python3.5/site-packages/explorerhat/init.py”, line 692, in
_cap1208 = Cap1208()
File “/usr/lib/python3.5/site-packages/cap1xxx.py”, line 275, in init
raise Exception(“Product ID {} not supported!”.format(self.product_id))
Exception: Product ID -5 not supported!

it looks like i2c is fine …

[root@bender matto]# i2cdetect -l
i2c-1 i2c 3f804000.i2c I2C adapter
[root@bender matto]# i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n] Y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- 48 – -- – -- – -- –
50: – -- – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --
[root@bender matto]#

Technical-reference.md says explorerphat s i2c address is 0x48 … ok
.
looking into “cap1xxx.py”:

here we have
DEFAULT_ADDR = 0x28

And it is checking for this
SMBus(1).read_byte_data(0x28, 0xFD)

which is not present… (Technical-reference.md --> touch-buttons ?!?)

Am i doing something completly wrong here?

Greetings
matto

[edit]
i just replaced lines 691-695

try:
    _cap1208 = Cap1208()
    has_captouch = True
except IOError:
    has_captouch = False

with

has_captouch = False

to bypass that check …
i still wonder why “except IOError:” does not catch the error …

[edit 2]:
The explorer-hat library tries to catch an IOError, with seems not to existi in python 3.5, so i changed it to a plain “Exception” which workes fine.

Greetings and thanks for this great pi-add-on!
matto


#2

Python 3.5 is currently unsupported I’m afraid, mostly due to the fact that all our development occurs on the Pi.

That said, if you have a minute, raise an issue in the github repo, I’m sure @gadgetoid will be happy to note potential issues ahead of time (Python 3.5 becoming the thing on Pi).


#3

actually, looking more closely it seems to be a bus error. Can’t see anything in the code that could produce that, regardless of what Python version is involved… very strange.


#4

Hi,

I created a pull request when a got it fixed

I think this is a type problem. In python 3.3 IOError was merged into IOError, but the exception thrown by cap1xxx.py is not of that type.

See line 275 in cap1xxx.py

Strange behavior… :)


#5

hum, yes, possibly… I just find it strange that product_id is getting populated with nothing on the bus. either way, we’ll check into it, cheers for raising the issue!