InterfaceKit 1019 and Raspberry Pi

Supporting 2.6 and up
amacdonald
Phidgetsian
Posts: 6
Joined: Wed Nov 30, 2011 10:02 am
Contact:

InterfaceKit 1019 and Raspberry Pi

Postby amacdonald » Wed Apr 09, 2014 12:53 pm

Hello,

I am having some trouble with the 1019_1 interface kit and a Raspberry Pi.

I have multiple Raspberry Pi's working with the Phidgets, but for some odd reason can't get it working now. I have the 1019_1 connected and when I run the InterfaceKit-simple.py sample program I get the following error message.

Traceback (most recent call last):
File "./InterfaceKit-simple.py", line 70, in <module>
interfaceKit.setOnAttachHandler(interfaceKitAttached)
File "/usr/local/lib/python2.7/dist-packages/Phidgets/Phidget.py", line 655, in setOnAttachHandler
self.__onAttach = self.__ATTACHHANDLER(self.__nativeAttachEvent)
AttributeError: InterfaceKit instance has no attribute '_Phidget__ATTACHHANDLER'

If I comment out line 70 (which holds the offending line) the error moves down one to the detach handler and I get the same error, and it goes right down the line the last handler. It doesn't matter if I am running as root or as a regular user, I get the same error message. So I ask anyone that may know - what is going on?

Also, the 1019 works just fine when connected to my main system (os x 10.9), so at least I know the board is good.

Finally, HelloWorld.py detects the Board without issue, so attachment (as in the Pi can see the board) isn't an problem.

vanschelven
Fresh meat
Posts: 1
Joined: Sun Apr 27, 2014 3:44 am
Contact:

Re: InterfaceKit 1019 and Raspberry Pi

Postby vanschelven » Sun Apr 27, 2014 3:54 am

Hi,

I ran into the exact same problem, though on a different system (Ubuntu 13.10 on an old laptop). Leaving some notes here for the kind people from the future:

It appears that the problem is that the value for sys.platform is "linux2" for me. (not "linux")
This leads to no values being set in lines 277 - 282 of Phidget.py.

I've simply updated the if-statement above, though generally the "else" branch with some sort of exception (platform unsupported) should be advisable.

(In fact I've also grepped through the code for /sys.platform.*linux/ ; turns out that "linux2" is the value everywhere else, so it appears to simply have been a missed search & replace at some point.

The actual on-screen error seems to be triggered by some kind of attribute-resolution magic that I do not fully understand. Anyhow...

I couldn't find the code repo for a proper pull request / bug report.

Klaas

shahjee1
Fresh meat
Posts: 1
Joined: Thu Sep 25, 2014 3:13 am
Contact:

Re: InterfaceKit 1019 and Raspberry Pi

Postby shahjee1 » Thu Sep 25, 2014 3:17 am

The link you provided points to incredibly old version of the Phidget library - if this is really the version you're using, then that would very likely be the problem - this version doesn't even support PhidgetSpatial as it wasn't released yet.



______
Subscribe for Testking 117-202 training and pass your Southwestern College exam in first attempt. Get guaranteed success using ISC and other resources.
Last edited by shahjee1 on Tue Oct 14, 2014 4:23 am, edited 1 time in total.

waseem123
Fresh meat
Posts: 1
Joined: Tue Sep 30, 2014 1:48 am
Contact:

WELL POST

Postby waseem123 » Tue Sep 30, 2014 1:51 am

Hello,

I am having some trouble with the 1019_1 interface kit and a Raspberry Pi.

I have multiple Raspberry Pi's working with the Phidgets, but for some odd reason can't get it working now. I have the 1019_1 connected and when I run the InterfaceKit-simple.py sample program I get the following error message.

Traceback (most recent call last):
File "./InterfaceKit-simple.py", line 70, in <module>
interfaceKit.setOnAttachHandler(interfaceKitAttached)
File "/usr/local/lib/python2.7/dist-packages/Phidgets/Phidget.py", line 655, in setOnAttachHandler


_______
gill sab


Return to “Linux”

Who is online

Users browsing this forum: No registered users and 1 guest