Using Python to interface with the PM

Post questions and issues with Concept2 PM3 SDK
tomazb
Paddler
Posts: 1
Joined: September 23rd, 2017, 4:49 pm

Re: Using Python to interface with the PM

Post by 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

User avatar
Citroen
SpamTeam
Posts: 8075
Joined: March 16th, 2006, 3:28 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Using Python to interface with the PM

Post by 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.

Locked