Skip to content

freehaha/myo4l

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Myo for Linux

This module is implemented using noble to connect to Myo, providing a general interface for accessing Myo. You do not need the Myo dongle to use this but you do need a working BT 4.0 dongle/device to work. I tested it using my laptop(Lenovo X230) which comes with BT 4.0 and it works fine.

A Websocket interface is also implemented trying to mimic the behavior of Myo Connect.

Installation

First, because noble is used please look at it's build requirement. Mainly, you'll need to install bluetooth, bluez-utils and libbluetooth-dev packages in your system.

I haven't publish this on npm yet so after making sure you have the necessary libraries and header files, just clone this project and install the modules:

git clone https://github.com/freehaha/myo4l.git
cd myo4l
npm install
npm run build # to generate the js files

Normally the scanning requires root privileges but you can grant the hci-ble binary with permission by using this command in the project root or in node_modules:

find -path '*noble*Release/hci-ble' -exec sudo setcap cap_net_raw+eip '{}' \;

Otherwise you'll have to run your scripts as root all the time.

How to use

Websocket Interface

to setup websocket interface, run the ws.js script with your myo device name as argument. It currently supporting only one device.

node ws.js <Myo name>

# for example
node ws.js Myo1

the WS interface specification can be found on Myo Developer Forum. I've tested this using Myo.js and it works fine but this is still an PoC-level implementation so feel free to fire bug reports or send PRs.

API

A simple example to use the library without WS interface can be found in the example folder but you can find almost all possible usage in ws.coffee so it'd be a good place to dig into.

Disclaimer

I studied the myo-raw project and dig around the Android-SDK to find out most of the constants and steps to setup a connection with Myo and I hold no responsibility if using this library damages your devices in any way.

About

node module to access myo without the myo dongle

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published