@hackage hemokit0.6.4
Haskell port of the Emokit EEG project
Categories
License
MIT
Maintainer
Niklas Hambüchen <mail@nh2.me>
Links
Versions
Installation
Dependencies (15)
- aeson >=0.6.1.0
- base >=4 && <5
- base64-bytestring >=1.0.0.1
- bytestring >=0.9.2.1
- cipher-aes >=0.2.0
- conduit >=1 Show all…
Dependents (1)
@hackage/acme-everything
Package Flags
fft
(on by default)
Enable apps that use FFT. Needs fftw installed.
headmap
(on by default)
Build the headmap. Needs GUI libraries installed.
mouse
(on by default)
Build the app that controls the mouse with the gyroscope. Needs Xorg and related libraries installed (so it only works on Linux for now).
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-dumpprint out the current EEG datahemokit-mousemove 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 jsonThe
--formatflag allows you to change the way the output is printed. The output of--mode state --format spacedis 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 jsonHere 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:1234instead. -
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.dumpWe use
teeand shell process substitution to duplicate the data stream, and tell hemokit-dump to read from-(stdin).