Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

emotiv.py getLinuxSetup - weaken requirement for manufacturer string #62

Open
wants to merge 6 commits into from

2 participants

@sanedragon

My headset's manufacturer string is "Emotiv Systems Pty Ltd"

This patch weakens the check to just look for "Emotiv Systems" instead of "Emotiv Systems Inc."

@lfk

Went with the same solution, as my device's manufacturer identifies as "Emotiv Systems Pty Ltd"

@bschumacher bschumacher referenced this pull request from a commit in bschumacher/emokit-old
@bschumacher bschumacher Update emotiv.py
Updated comments.

Added sleep to prevent high CPU usage from pull request #62.
16e1d00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 20, 2013
  1. Fix getLinuxSetup for new headset

    Dag Arneson authored
  2. @sanedragon

    debugging info

    sanedragon authored
Commits on Jan 21, 2013
  1. @sanedragon

    alter udev rule to allow write access

    sanedragon authored
    hidapi fails to open the device without write access.
  2. @sanedragon

    more debugging info

    sanedragon authored
  3. @sanedragon
  4. @sanedragon
This page is out of date. Refresh to see the latest.
View
5 examples/contact/contact.c
@@ -41,7 +41,8 @@ int main(int argc, char **argv)
printf("Connected to headset.\n");
if (emokit_read_data(d)<=0) {
- printf("Error reading from headset\n");
+ fprintf(stdout,"Error reading from headset\n");
+ fflush(stdout);
emokit_close(d);
emokit_delete(d);
return 1;
@@ -51,7 +52,7 @@ int main(int argc, char **argv)
while (!quit) {
if(emokit_read_data(d) > 0) {
c = emokit_get_next_frame(d);
- fprintf(stdout,"\033[H\033[2JPress CTRL+C to exit\n\nContact quality:\nF3 %4d\nFC6 %4d\nP7 %4d\nT8 %4d\nF7 %4d\nF8 %4d\nT7 %4d\nP8 %4d\nAF4 %4d\nF4 %4d\nAF3 %4d\nO2 %4d\nO1 %4d\nFC5 %4d",c.cq.F3, c.cq.FC6, c.cq.P7, c.cq.T8,c.cq.F7, c.cq.F8, c.cq.T7, c.cq.P8, c.cq.AF4, c.cq.F4, c.cq.AF3, c.cq.O2, c.cq.O1, c.cq.FC5);
+ fprintf(stdout,"\033[H\033[2JPress CTRL+C to exit\n\nContact quality:\nAF3 %4d\tAF4 %4d\n F3 %4d\t F4 %4d\n F7 %4d\t F8 %4d\nFC5 %4d\tFC6 %4d\n T7 %4d\t T8 %4d\n P7 %4d\t P8 %4d\n O1 %4d\t O2 %4d\n",c.cq.AF3, c.cq.AF4, c.cq.F3, c.cq.F4, c.cq.F7, c.cq.F8, c.cq.FC5, c.cq.FC6, c.cq.T7, c.cq.T8, c.cq.P7, c.cq.P8, c.cq.O1, c.cq.O2, c.cq.FC5);
fflush(stdout);
}
}
View
14 include/emokit/emokit.h
@@ -28,10 +28,16 @@
#define EMOKIT_DECLSPEC __declspec(dllexport)
#endif
-/// Vendor ID for all emotiv devices
-const static uint32_t EMOKIT_VID = 0x21a1;
-/// Product ID for all emotiv devices
-const static uint32_t EMOKIT_PID = 0x0001;
+
+// idVendor 0x1234 Unknown
+// idProduct 0xed02 Emotiv EPOC Developer Headset Wireless Dongle
+
+/// Vendor ID
+//const static uint32_t EMOKIT_VID = 0x21a1;
+const static uint32_t EMOKIT_VID = 0x1234;
+/// Product ID
+//const static uint32_t EMOKIT_PID = 0x0001;
+const static uint32_t EMOKIT_PID = 0xed02;
/// Out endpoint for all emotiv devices
const static uint32_t EMOKIT_OUT_ENDPT = 0x02;
View
2  linux/epoc.rules
@@ -13,5 +13,5 @@ ATTR{manufacturer}=="Emotiv Systems Pty Ltd", ATTRS{product}=="Receiver Dongle L
#SUBSYSTEM=="hidraw", ATTRS{idVendor}=="21a1", ATTRS{idProduct}=="0001", ATTRS{interface}=="Emotiv RAW DATA", NAME="eeg/encrypted%n", SYMLINK+="eeg/encrypted", MODE="0444", RUN +="decrypt_emotiv.sh consumer"
#Research headset
-SUBSYSTEM=="hidraw", ATTRS{interface}=="Emotiv RAW DATA", NAME="eeg/encrypted%n", SYMLINK+="eeg/encrypted", MODE="0444", RUN +="decrypt_emotiv.sh research"
+SUBSYSTEM=="hidraw", ATTRS{interface}=="Emotiv RAW DATA", NAME="eeg/encrypted%n", SYMLINK+="eeg/encrypted", MODE="0666"
View
2  python/emotiv.py
@@ -265,7 +265,7 @@ def getLinuxSetup(self):
with open(input[0] + "/manufacturer", 'r') as f:
manufacturer = f.readline()
f.close()
- if "Emotiv Systems Inc." in manufacturer:
+ if "Emotiv Systems" in manufacturer:
with open(input[0] + "/serial", 'r') as f:
serial = f.readline().strip()
f.close()
View
11 src/emokit.c
@@ -140,14 +140,25 @@ int emokit_open(struct emokit_device* s, int device_vid, int device_pid, unsigne
struct hid_device_info* device_cur;
if (!s->_is_inited)
{
+ printf("Not initted!\n");
return E_EMOKIT_NOT_INITED;
}
devices = hid_enumerate(device_vid, device_pid);
+
+ if (!devices) {
+ printf("No devices! vid: %x pid: %x index: %d\n", device_vid, device_pid, device_index);
+ }
device_cur = devices;
while(device_cur) {
if(count == device_index) {
+ printf("Opening %s\n",device_cur->path);
s->_dev = hid_open_path(device_cur->path);
+ if(!s->_dev) {
+ printf("Failed.\n");
+ } else {
+ printf("Success!");
+ }
break;
}
++count;
Something went wrong with that request. Please try again.