"device not supported" error, maybe because archlinux?

Supporting 2.6 and up
CatherineHolloway
Phidgetly
Posts: 20
Joined: Mon Mar 04, 2013 9:53 am
Contact:

"device not supported" error, maybe because archlinux?

Postby CatherineHolloway » Sat Sep 14, 2013 8:40 am

Running the following python sample code in Arch:

Code: Select all

>>> from ctypes import *
>>> import sys
>>> from Phidgets.PhidgetException import *
>>> from Phidgets.Events.Events import *
>>> from Phidgets.Manager import Manager
>>> from Phidgets.Devices import *
>>> manager = Manager()


I get the following error:

Code: Select all

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.3/site-packages/Phidgets/Manager.py", line 64, in __init__
    result = PhidgetLibrary.getDll().CPhidgetManager_create(byref(self.handle))
  File "/usr/lib/python3.3/site-packages/Phidgets/PhidgetLibrary.py", line 26, in getDll
    raise RuntimeError("Platform not supported")
RuntimeError: Platform not supported

Is this because I'm running archlinux?

CatherineHolloway
Phidgetly
Posts: 20
Joined: Mon Mar 04, 2013 9:53 am
Contact:

Re: "device not supported" error, maybe because archlinux?

Postby CatherineHolloway » Sat Sep 14, 2013 9:27 am

hmm, it seems to be because in PhidgetLibrary.py there is the following:

Code: Select all

    def getDll():
        if PhidgetLibrary.__dll is None:
            if sys.platform == 'win32':
                PhidgetLibrary.__dll = windll.LoadLibrary("phidget21.dll")
            elif sys.platform == 'darwin':
                PhidgetLibrary.__dll = cdll.LoadLibrary("/Library/Frameworks/Phidget21.framework/Versions/Current/Phidget21")
            elif sys.platform == 'linux2':
                PhidgetLibrary.__dll = cdll.LoadLibrary("libphidget21.so.0")
            else:
                raise RuntimeError("Platform not supported")


but on my arch sys.platform is linux... I modified my version of PhidgetsLibrary.py to be linux instead of linux2... continuing from here.

CatherineHolloway
Phidgetly
Posts: 20
Joined: Mon Mar 04, 2013 9:53 am
Contact:

Re: "device not supported" error, maybe because archlinux?

Postby CatherineHolloway » Sat Sep 14, 2013 9:36 am

oh, also in Manager.py, I had to change this line:

Code: Select all

 elif sys.platform == 'darwin' or sys.platform == 'linux2':


to

Code: Select all

 elif sys.platform == 'darwin' or sys.platform == 'linux2' or sys.platform == 'linux':


also, in HelloWorld.py, raw_input() is no longer used in python 3.3, so had to change to input()... but it works now.

Phidgets team if you're reading this might be something worth fixing...

CatherineHolloway
Phidgetly
Posts: 20
Joined: Mon Mar 04, 2013 9:53 am
Contact:

Re: "device not supported" error, maybe because archlinux?

Postby CatherineHolloway » Mon Mar 03, 2014 3:54 pm

This is mostly for myself, but the error:

Code: Select all

  File "/usr/local/lib/python2.7/dist-packages/Phidgets/Phidget.py", line 655, in setOnAttachHandler
    self.__onAttach = self.__ATTACHHANDLER(self.__nativeAttachEvent)
AttributeError: Stepper instance has no attribute '_Phidget__ATTACHHANDLER'


Is also due to this issue.

browny_amiga
Fresh meat
Posts: 3
Joined: Wed Nov 24, 2010 10:12 pm
Contact:

Re: "device not supported" error, maybe because archlinux?

Postby browny_amiga » Sat Sep 06, 2014 7:03 pm

For me, changing these things in the two files does not make the error go away and I'm stuck. I can't use phidgets anymore on my Linux platform and we have a project that is stuck because of this.

I'm using libphidget_2.1.8.20140319
PhidgetsPython_2.1.8.20140227
and python 2.7.3
on Debian Wheezy.

Please advise how to get the library to work again.

aleksander0m
Phidgetsian
Posts: 8
Joined: Fri Apr 10, 2015 2:19 am
Contact:

Re: "device not supported" error, maybe because archlinux?

Postby aleksander0m » Fri Apr 10, 2015 12:02 pm

CatherineHolloway wrote:Running the following python sample code in Arch:

Code: Select all

>>> from ctypes import *
>>> import sys
>>> from Phidgets.PhidgetException import *
>>> from Phidgets.Events.Events import *
>>> from Phidgets.Manager import Manager
>>> from Phidgets.Devices import *
>>> manager = Manager()


I get the following error:

Code: Select all

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.3/site-packages/Phidgets/Manager.py", line 64, in __init__
    result = PhidgetLibrary.getDll().CPhidgetManager_create(byref(self.handle))
  File "/usr/lib/python3.3/site-packages/Phidgets/PhidgetLibrary.py", line 26, in getDll
    raise RuntimeError("Platform not supported")
RuntimeError: Platform not supported

Is this because I'm running archlinux?


Actually, it is.

ArchLinux uses python3 as default:

Code: Select all

$ python --version
Python 3.4.3


While in most (all?) other distros use python2; e.g. an Ubuntu here:

Code: Select all

$ python --version
Python 2.7.6


And in python3, sys.platform maps to "linux"; while in python2, sys.platform maps to "linux2" (even for kernels >= 3.x).

aleksander0m
Phidgetsian
Posts: 8
Joined: Fri Apr 10, 2015 2:19 am
Contact:

Re: "device not supported" error, maybe because archlinux?

Postby aleksander0m » Fri Apr 10, 2015 12:03 pm

browny_amiga wrote:For me, changing these things in the two files does not make the error go away and I'm stuck. I can't use phidgets anymore on my Linux platform and we have a project that is stuck because of this.

I'm using libphidget_2.1.8.20140319
PhidgetsPython_2.1.8.20140227
and python 2.7.3
on Debian Wheezy.

Please advise how to get the library to work again.


This is not the same problem; you're already using python 2. Your sys.platform should already say "linux2". I'd suggest you post your specific issue to another topic post.


Return to “Linux”

Who is online

Users browsing this forum: No registered users and 1 guest