Skip to content

Commit 1e2e045

Browse files
author
AJ Keller
committed
ADD: 🚀
1 parent a056055 commit 1e2e045

File tree

8 files changed

+259
-30
lines changed

8 files changed

+259
-30
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,5 @@ target/
6767
.idea/*
6868
.idea/codeStyleSettings.xml
6969
.idea/vcs.xml
70+
71+
.DS_Store

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# v1.0.0
2+
3+
### New Features
4+
5+
* High speed mode for WiFi shield sends raw data - #51
6+
* Unit testing with Nosetests
7+
* Continuous Integration with Travis.ci
8+
9+
### Breaking Changes
10+
11+
* Refactored library for pip
12+
13+
# v0.1
114

215
## dev
316

CODE_OF_CONDUCT.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# OpenBCI Python Code of Conduct
2+
3+
## Purpose
4+
5+
It is our hope that any one is able to contribute to OpenBCI Python regardless of their background. Thus, we hope to provide a safe, welcoming, and warmly geeky environment for everybody, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion (or lack thereof).
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment
10+
include:
11+
12+
* Using welcoming and inclusive language
13+
* Being respectful of differing viewpoints and experiences
14+
* Gracefully accepting constructive criticism
15+
* Focusing on what is best for the community
16+
* Showing empathy towards other community members
17+
18+
Examples of unacceptable behavior by participants include:
19+
20+
* The use of sexualized language or imagery and unwelcome sexual attention or
21+
advances
22+
* Trolling, insulting/derogatory comments, and personal or political attacks
23+
* Public or private harassment
24+
* Publishing others' private information, such as a physical or electronic
25+
address, without explicit permission
26+
* Other conduct which could reasonably be considered inappropriate in a
27+
professional setting
28+
29+
## Our Responsibilities
30+
31+
Project maintainers are responsible for clarifying the standards of acceptable
32+
behavior and are expected to take appropriate and fair corrective action in
33+
response to any instances of unacceptable behavior.
34+
35+
Project maintainers have the right and responsibility to remove, edit, or
36+
reject comments, commits, code, wiki edits, issues, and other contributions
37+
that are not aligned to this Code of Conduct, or to ban temporarily or
38+
permanently any contributor for other behaviors that they deem inappropriate,
39+
threatening, offensive, or harmful.
40+
41+
## Scope
42+
43+
This Code of Conduct applies both within project spaces and in public spaces
44+
when an individual is representing the project or its community. Examples of
45+
representing a project or community include using an official project e-mail
46+
address, posting via an official social media account, or acting as an appointed
47+
representative at an online or offline event. Representation of a project may be
48+
further defined and clarified by project maintainers.
49+
50+
## Enforcement
51+
52+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
53+
reported by contacting the project team at [[email protected]](mailto:[email protected]). All
54+
complaints will be reviewed and investigated and will result in a response that
55+
is deemed necessary and appropriate to the circumstances. The project team is
56+
obligated to maintain confidentiality with regard to the reporter of an incident.
57+
Further details of specific enforcement policies may be posted separately.
58+
59+
Project maintainers who do not follow or enforce the Code of Conduct in good
60+
faith may face temporary or permanent repercussions as determined by other
61+
members of the project's leadership.
62+
63+
## Attribution
64+
65+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
66+
available at [http://contributor-covenant.org/version/1/4][version]
67+
68+
[homepage]: http://contributor-covenant.org
69+
[version]: http://contributor-covenant.org/version/1/4/

CONTRIBUTING.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Contributing
2+
3+
:tada::clinking_glasses: First off, thanks for taking the time to contribute! :tada::clinking_glasses:
4+
5+
Contributions are always welcome, no matter how small.
6+
7+
The following is a small set of guidelines for how to contribute to the project
8+
9+
## Where to start
10+
11+
### Code of Conduct
12+
This project adheres to the Contributor Covenant [Code of Conduct](CODE_OF_CONDUCT.md).
13+
By participating you are expected to adhere to these expectations. Please report unacceptable behaviour to [[email protected]](mailto:[email protected])
14+
15+
### Contributing on Github
16+
17+
If you're new to Git and want to learn how to fork this repo, make your own additions, and include those additions in the master version of this project, check out this [great tutorial](http://blog.davidecoppola.com/2016/11/howto-contribute-to-open-source-project-on-github/).
18+
19+
### Community
20+
21+
This project is maintained by the [OpenBCI](www.openbci.com) and [NeuroTechX](www.neurotechx.com) community. Join the NeuroTechX Slack to check out our #devices channel, where discussions about OpenBCI takes place.
22+
23+
## How can I contribute?
24+
25+
If there's a feature you'd be interested in building, go ahead and we'll support you as much as we can. When you're finished submit a pull request to the master branch referencing the specific issue you addressed.
26+
27+
If you find a bug, or have a suggestion on how to improve the project, just fill out a [Github issue](../../issues)

README.md

Lines changed: 133 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,110 @@
1-
OpenBCI_Python
2-
==============
1+
# OpenBCI Python
32

4-
The Python software library designed to work with OpenBCI hardware.
3+
<p align="center">
4+
<img alt="banner" src="/images/openbci_large.png/" width="400">
5+
</p>
6+
<p align="center" href="">
7+
Provide a stable Python driver for all OpenBCI Biosensors
8+
</p>
59

6-
Please direct any questions, suggestions and bug reports to the github repo at: https://github.com/OpenBCI/OpenBCI_Python
10+
[![Build Status](https://travis-ci.org/OpenBCI/OpenBCI_Python.svg?branch=master)](https://travis-ci.org/OpenBCI/OpenBCI_Python)
711

8-
## Dependancies:
12+
## Welcome!
13+
14+
First and foremost, Welcome! :tada: Willkommen! :confetti_ball: Bienvenue! :balloon::balloon::balloon:
15+
16+
Thank you for visiting the OpenBCI Python repository. his python code is meant to be used by people familiar with python and programming in general. It's purpose is to allow for programmers to interface with OpenBCI technology directly, both to acquire data and to write programs that can use that data on a live setting, using python.
17+
18+
This document (the README file) is a hub to give you some information about the project. Jump straight to one of the sections below, or just scroll down to find out more.
19+
20+
* [What are we doing? (And why?)](#what-are-we-doing)
21+
* [Who are we?](#who-are-we)
22+
* [What do we need?](#what-do-we-need)
23+
* [How can you get involved?](#get-involved)
24+
* [Get in touch](#contact-us)
25+
* [Find out more](#find-out-more)
26+
* [Glossary](#glossary)
27+
* [Dependencies](#dependencies)
28+
* [Install](#install)
29+
* [Functionality](#functionality)
30+
31+
## What are we doing?
32+
33+
### The problem
34+
35+
* OpenBCI is an incredible biosensor that can be challenging to work with
36+
* Data comes into the computer very quickly
37+
* Complex byte streams
38+
* Lot's of things can go wrong when dealing with a raw serial byte stream
39+
* The boards all use different physical technologies to move data to computers such as bluetooth or wifi
40+
* Developers want to integrate OpenBCI with other platforms and interfaces
41+
42+
So, if even the very best developers want to use Python with their OpenBCI boards, they are left scratching their heads with where to begin.
43+
44+
### The solution
45+
46+
The OpenBCI Python will:
47+
48+
* Allow Python users to install one module and use any board they choose
49+
* Provide examples of using Python to port data to other apps like lab streaming layer
50+
* Perform the heavy lifting when extracting and transforming raw binary byte streams
51+
* Use unit tests to ensure perfect quality of core code
52+
53+
Using this repo provides a building block for developing with Python. The goal for the Python library is to ***provide a stable Python driver for all OpenBCI Biosensors***
54+
55+
## Who are we?
56+
57+
The founder of the OpenBCI Python repository is Jermey Frey. The Python driver is one of the most popular repositories and has the most contributors!
58+
59+
The contributors to these repos are people using Python mainly for their data acquisition and analytics.
60+
61+
## What do we need?
62+
63+
**You**! In whatever way you can help.
64+
65+
We need expertise in programming, user experience, software sustainability, documentation and technical writing and project management.
66+
67+
We'd love your feedback along the way.
68+
69+
Our primary goal is to provide a stable Python driver for all OpenBCI Biosensors, and we're excited to support the professional development of any and all of our contributors. If you're looking to learn to code, try out working collaboratively, or translate you skills to the digital domain, we're here to help.
70+
71+
## Get involved
72+
73+
If you think you can help in any of the areas listed above (and we bet you can) or in any of the many areas that we haven't yet thought of (and here we're *sure* you can) then please check out our [contributors' guidelines](CONTRIBUTING.md) and our [roadmap](ROADMAP.md).
74+
75+
Please note that it's very important to us that we maintain a positive and supportive environment for everyone who wants to participate. When you join us we ask that you follow our [code of conduct](CODE_OF_CONDUCT.md) in all interactions both on and offline.
76+
77+
## Contact us
78+
79+
If you want to report a problem or suggest an enhancement we'd love for you to [open an issue](../../issues) at this github repository because then we can get right on it. But you can also contact [AJ][link_aj_keller] by email (pushtheworldllc AT gmail DOT com) or on [twitter](https://twitter.com/aj-ptw).
80+
81+
## Find out more
82+
83+
You might be interested in:
84+
85+
* Purchase a [Cyton][link_shop_cyton] | [Ganglion][link_shop_ganglion] | [WiFi Shield][link_shop_wifi_shield] from [OpenBCI][link_openbci]
86+
* Get taught how to use OpenBCI devices by [Push The World][link_ptw] BCI Consulting
87+
88+
And of course, you'll want to know our:
89+
90+
* [Contributors' guidelines](CONTRIBUTING.md)
91+
* [Roadmap](ROADMAP.md)
92+
93+
## Glossary
94+
95+
OpenBCI boards are commonly referred to as _biosensors_. A biosensor converts biological data into digital data.
96+
97+
The [Ganglion][link_shop_ganglion] has 4 channels, meaning the Ganglion can take four simultaneous voltage readings.
98+
99+
The [Cyton][link_shop_cyton] has 8 channels and [Cyton with Daisy][link_shop_cyton_daisy] has 16 channels.
100+
101+
Generally speaking, the Cyton records at a high quality with less noise. Noise is anything that is not signal.
102+
103+
## Thank you
104+
105+
Thank you so much (Danke schön! Merci beaucoup!) for visiting the project and we do hope that you'll join us on this amazing journey to make programming with OpenBCI fun and easy.
106+
107+
## Dependencies
9108

10109
* Python 2.7 or later (https://www.python.org/download/releases/2.7/)
11110
* Numpy 1.7 or later (http://www.numpy.org/)
@@ -31,12 +130,6 @@ On linux, assuming `hci0` is the name of your bluetooth adapter:
31130

32131
`sudo bash -c 'echo 10 > /sys/kernel/debug/bluetooth/hci0/conn_max_interval'`
33132

34-
# Audience:
35-
36-
This python code is meant to be used by people familiar with python and programming in general. It's purpose is to allow for programmers to interface with OpenBCI technology directly, both to acquire data and to write programs that can use that data on a live setting, using python.
37-
38-
If this is not what you are looking for, you can visit http://openbci.com/downloads and browse other OpenBCI software that will fit your needs.
39-
40133
## Install
41134

42135
### Using PyPI
@@ -65,7 +158,7 @@ python setup.py develop
65158

66159
### Basic usage
67160

68-
The startStreaming function of the Board object takes a callback function and begins streaming data from the board. Each packet it receives is then parsed as an OpenBCISample which is passed to the callback function as an argument.
161+
The startStreaming function of the Board object takes a callback function and begins streaming data from the board. Each packet it receives is then parsed as an OpenBCISample which is passed to the callback function as an argument.
69162

70163
OpenBCISample members:
71164
-id:
@@ -79,13 +172,13 @@ OpenBCISample members:
79172

80173
### user.py
81174

82-
This code provides a simple user interface (called user.py) to handle various plugins and communicate with the board. To use it, connect the board to your computer using the dongle (see http://docs.openbci.com/tutorials/01-GettingStarted for details).
175+
This code provides a simple user interface (called user.py) to handle various plugins and communicate with the board. To use it, connect the board to your computer using the dongle (see http://docs.openbci.com/tutorials/01-GettingStarted for details).
83176

84177
Then simply run the code given as an argument the port your board is connected to:
85178
Ex Linux:
86-
> $python user.py -p /dev/ttyUSB0
179+
> $python user.py -p /dev/ttyUSB0
87180
88-
The program should establish a serial connection and reset the board to default settings. When a '-->' appears, you can type a character (character map http://docs.openbci.com/software/01-OpenBCI_SDK) that will be sent to the board using ser.write. This allows you to change the settings on the board.
181+
The program should establish a serial connection and reset the board to default settings. When a '-->' appears, you can type a character (character map http://docs.openbci.com/software/01-OpenBCI_SDK) that will be sent to the board using ser.write. This allows you to change the settings on the board.
89182

90183
A good first test is to try is to type '?':
91184
>--> ?
@@ -112,15 +205,15 @@ Alternatively, there are 6 test signals pre configured:
112205
113206
The / is used in the interface to execute a pre-configured command. Writing anything without a preceding '/' will automatically write those characters, one by one, to the board.
114207

115-
For example, writing
116-
> -->x3020000X
208+
For example, writing
209+
> -->x3020000X
117210
will do the following:
118211

119212
‘x’ enters Channel Settings mode. Channel 3 is set up to be powered up, with gain of 2, normal input, removed from BIAS generation, removed from SRB2, removed from SRB1. The final ‘X’ latches the settings to the ADS1299 channel settings register.
120213

121214
Pre-configured commands that use the / prefix are:
122215

123-
test (As explained above)
216+
test (As explained above)
124217

125218
> --> /test4
126219
@@ -147,7 +240,7 @@ Serial established...
147240
View command map at http://docs.openbci.com.
148241
Type start to run. Type /exit to exit.
149242
150-
-->
243+
-->
151244
OpenBCI V3 8bit Board
152245
Setting ADS1299 Channel Values
153246
ADS1299 Device ID: 0x3E
@@ -200,17 +293,17 @@ Add new functionalities to user.py by creating new scripts inside the `plugins`
200293

201294
```python
202295
import plugin_interface as plugintypes
203-
296+
204297
class PluginPrint(plugintypes.IPluginExtended):
205298
def activate(self):
206299
print "Print activated"
207-
300+
208301
def deactivate(self):
209302
print "Goodbye"
210-
303+
211304
def show_help(self):
212305
print "I do not need any parameter, just printing stuff."
213-
306+
214307
# called with each new sample
215308
def __call__(self, sample):
216309
print "----------------"
@@ -243,7 +336,7 @@ You're done, your plugin should be automatically detected by `user.py`.
243336

244337
* `sample_rate`: Print effective sampling rate averaged over XX seconds (default: 10).
245338

246-
* `streamer_tcp`: Acts as a TCP server, using a "raw" protocol to send value.
339+
* `streamer_tcp`: Acts as a TCP server, using a "raw" protocol to send value.
247340
* The stream can be acquired with [OpenViBE](http://openvibe.inria.fr/) acquisition server, selecting telnet, big endian, float 32 bits, forcing 250 sampling rate (125 if daisy mode is used).
248341
* Default IP: localhost, default port: 12345
249342

@@ -269,3 +362,19 @@ Note: copy `open_bci_v3.py` there if you want to run the code -- no proper packa
269362
* `test.py`: minimal example, printing values.
270363
* `stream_data.py` a version of a TCP streaming server that somehow oversamples OpenBCI from 250 to 256Hz.
271364
* `upd_server.py` *DEPRECATED* (Use Plugin): see https://github.com/OpenBCI/OpenBCI_Node for implementation example.
365+
366+
## <a name="license"></a> License:
367+
368+
MIT
369+
370+
[link_aj_keller]: https://github.com/aj-ptw
371+
[link_shop_wifi_shield]: https://shop.openbci.com/collections/frontpage/products/wifi-shield?variant=44534009550
372+
[link_shop_ganglion]: https://shop.openbci.com/collections/frontpage/products/pre-order-ganglion-board
373+
[link_shop_cyton]: https://shop.openbci.com/collections/frontpage/products/cyton-biosensing-board-8-channel
374+
[link_shop_cyton_daisy]: https://shop.openbci.com/collections/frontpage/products/cyton-daisy-biosensing-boards-16-channel
375+
[link_nodejs_cyton]: https://github.com/openbci/openbci_nodejs_cyton
376+
[link_nodejs_ganglion]: https://github.com/openbci/openbci_nodejs_ganglion
377+
[link_nodejs_wifi]: https://github.com/openbci/openbci_nodejs_wifi
378+
[link_javascript_utilities]: https://github.com/OpenBCI/OpenBCI_JavaScript_Utilities
379+
[link_ptw]: https://www.pushtheworldllc.com
380+
[link_openbci]: http://www.openbci.com

ROADMAP.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Roadmap
2+
3+
## OpenBCI Python
4+
5+
Provide a stable Python driver for all OpenBCI Biosensors
6+
7+
## Short term - what we're working on now
8+
9+
- WiFi
10+
11+
## Medium term
12+
13+
- Emotion detection
14+
- Default set of instructions to send to the board on startup via command line
15+
- Time sync with Cyton

TODO.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

images/openbci_large.png

34.3 KB
Loading

0 commit comments

Comments
 (0)