Using Python to interface with the PM

Post questions and issues with Concept2 PM3 SDK

Re: Using Python to interface with the PM

Postby tomazb » September 23rd, 2017, 5:21 pm

Hi,

I can see this thread was alive years ago, but I came to the same problem, and nobody of those finding the solution is available to contact.

Can someone please suggest what was a solution to this? I too, can't get the data from C2 due to some python related (usb) problems. Did read almost everthing i found... but still.

After some recognition from linux when attaching the PM3, and initial commands... where I noticed that pyrow did recognised PM3, I received this error
Code: Select all
##############
import pyrow

ergs = pyrow.find()
e = ergs.next()

erg = pyrow.pyrow(e)

# command above did throw the error below
DEBUG: usb kernel driver not on linux2

#################################


Please, can someone suggest what could be a solution??


Best
Tomaz
Last edited by Citroen on September 24th, 2017, 3:37 am, edited 1 time in total.
Reason: Added [CODE] tags round python piece
tomazb
Paddler
 
Posts: 1
Joined: September 23rd, 2017, 4:49 pm

Re: Using Python to interface with the PM

Postby Citroen » September 24th, 2017, 3:50 am

Since you're running Linux does your userid have access to /dev/hidraw0 and /dev/usb/hiddev0 (which default to root ONLY unless you add a udev rule).

So you either need to write a udev rule to give your userid rwx access or you need to run your program with sudo. [The udev rule is better]

Create a file with sudo nano /etc/udev/95-concept2.rules
Code: Select all
KERNEL=="hidraw*" SUBSYSTEM=="hidraw" MODE="666"
KERNEL=="hiddev*" SUBSYSTEM=="usbmisc" MODE="666"


Then load that with sudo udevadm control -R. That make allows any user to read/write the /dev/hidraw0 and /dev/usb/hiddev0 devices that appear when you plug in your Concept PM3, PM4 or PM5.

I've not tested this with pyrow. I have tested with my PM5 and a Raspberry Pi running Raspbian Stretch.
User avatar
Citroen
SpamTeam
 
Posts: 4979
Joined: March 16th, 2006, 3:28 pm
Location: Basingstoke, UK

Previous

Return to SDK Questions

Who is online

Users browsing this forum: No registered users and 2 guests