Giter Site home page Giter Site logo

hemokit's Introduction

hemokit

Haskell library and tool suite for the Emotiv Epoc EEG, inspired by the Emokit code.

It currently only works on Linux and Windows - patches for other platforms are welcome, they should be trivial.

Download

You can download pre-built binaries here, or build it yourself via cabal install hemokit.

Library Features

  • device discovery via hidapi
  • decryption of the raw data (one-to-one port from from Emokit)
  • convenient access to sensor values, gyro, qualities, battery, and raw data

Programs

Hemokit comes with example programs to

  • hemokit-dump print out the current EEG data
  • hemokit-mouse move the cursor using the gyro

Note that we have to use sudo in most of the cases because the HIDAP-hidraw implementation reads directly from a device file.

hemokit-dump - Examples

hemokit-dump can print EEG data, format it as JSON, serve it via TCP or Websockets, and read from real devices and dump files.

  • Output EEG cumulative state for an automatically found device:

    sudo hemokit-dump
  • Select one of many connected EEGs by serial number:

    sudo hemokit-dump --serial SN...GM
  • Output only the data the device sends (no cumulative state), and format the output as JSON:

    sudo hemokit-dump --mode packets --format json

    The --format flag allows you to change the way the output is printed. The output of --mode state --format spaced is especially easy to work with.

  • Instead of from a real device, read data recorded to a file, and serve it via JSON over a TCP server on port 1234:

    sudo cat /dev/hidraw1 > encrypted.dump  # Dump data to a file
    sudo hemokit-dump --from-file encrypted.dump --serial SN...GM --serve 0.0.0.0:1234 --format json

    Here you have to specify the serial since HIDAPI is not used to obtain it automatically.

    If you prefer a Websockets server over a raw TCP server, use ws://0.0.0.0:1234 instead.

  • Output decrypted raw data to stdout:

    sudo hemokit-dump --mode raw
  • Both print the data from the EEG and store the original data for later use:

    sudo cat /dev/hidraw1 | tee >(hemokit-dump --from-file - --serial SN...GM --format json) > encrypted.dump

    We use tee and shell process substitution to duplicate the data stream, and tell hemokit-dump to read from - (stdin).

hemokit's People

Contributors

nh2 avatar chpatrick avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.