Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seeing 2 devices when there's only 1 connected on windows/linux+libusb #39

Open
qdot opened this issue Nov 1, 2012 · 5 comments
Open
Labels

Comments

@qdot
Copy link
Member

qdot commented Nov 1, 2012

Whenever we run hid_enumerate on windows or linux using libusb, we get a device count of 2 even when there's only one device available. This means that if we try to connect to device index 0 instead of device index 1, we don't actually read anything (epocd example hangs on "Starting read").

CURRENT WORKAROUND:

If you are seeing 2 devices in count when you only have 1 connected, try changing emokit_open's device index (the last argument of the function) to 1 instead of 0. Opening the 2nd device that we see tends to make emokit work. That said, we're still looking to fix this so that doesn't need to happen.

@ozancaglayan
Copy link

That is because there are two interfaces in the dongle (They appear as hidraw0, hidraw1 for example). Looking to your udev rule it seems that you are interested in the first one which is called "Emotiv RAW DATA". So we can filter out all other interfaces except that. Am I wrong?

@qdot
Copy link
Member Author

qdot commented Nov 30, 2012

The udev rule is broken in multiple ways right now. It's set up for the first python libraries we had, which assumed daemons and what not to exist on the system. Even so, we should be able to do something smarter now that we're on hidapi.

@wijjj
Copy link

wijjj commented Jul 4, 2013

I guess this is not 100% the same issue, but still...

Using ubuntu11 (installed all dependencies, mcrypt, cmake, hidapi w/o problems) I get two devices, but running e.g. contact I get CANNOT CONNECT: -3 (E_EMOKIT_NOT_OPENED). I added some output within emokit_open for now. This shows up when I run contact now:

Current epoc devices conneted: 2

opening dev: 1 (device_index)
path: /dev/hidraw0 (device_cur->path)
path: /dev/hidraw1

opening dev: 0
path: /dev/hidraw0
CANNOT CONNECT: -3

BTW: everything works fine in windows, using emokit-java.

@olorin
Copy link
Member

olorin commented Jul 7, 2013

I have a working version of the udev rules working with epocd on my other laptop; now that epocd's been incorporated into master I'll look into integrating my changes and getting device selection working (I'm at pyconau at the moment, so it'll be a couple of days).

@soltanmm
Copy link

soltanmm commented Aug 3, 2013

I realize that I'm perpetuating an off-topic discussion, but...

@wijjj: have you checked that you have read permissions on hidraw? I had the same problem, stepped through the debugger, and found I lacked permissions for a call to open() in the hid library. Try cat-ting on the /dev/hidraw file as a check or run with sudo... might help.

@ghost ghost assigned qdot Jun 22, 2016
@qdot qdot removed their assignment Apr 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants