Skip to main content

Python module to stream BITalino data though the Lab Streaming Layer (LSL)

Project description


A python module called bitalino_lsl to stream BITalino data though the Lab Streaming Layer (LSL). This module gets data from the BITalino device through the bitalino python api and uses the Lab Stream Layer to stream the data.

The module should work with python versions >= 2.7 although it has only been tested for:

  • Python 2.7.15
  • Python 3.6.5

Getting started


pip install bitalino_lsl


import bitalino_lsl
from pylsl import StreamInlet, resolve_stream
import time

# MAC address of the BITalino device

# List with channels of the BITalino device to be streamed to the LSL
# This channels can be specified as a list or as a dictionary with their
# position in the 10-20 system. BITalino uses bipolar electrodes so the
# position will be defined by two points
# CHANNELS = {0: 'Fp1-Fp2', 1: 'P3-T5'}
CHANNELS = [0,1]

# Connect with the BITalino device
device = bitalino_lsl.BitalinoLSL(MAC_ADDRESS_BITALINO_DEVICE)

# Create the Stream with the channels information

# Start the stream getting data from the BITalino device

# Get the Stream to read the data from
inlet = StreamInlet(resolve_stream('type', 'EEG')[0])

# Read the BITalino data for 5 seconds
t_end = time.time() + 5
while time.time() < t_end:
  sample, timestamp = inlet.pull_sample()

# Stop the device

# Close the connection with the BITalino device


Documentation is available here


This project is licensed under the GNU GPL v3

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bitalino_lsl-0.0.3.tar.gz (6.2 kB view hashes)

Uploaded source

Built Distribution

bitalino_lsl-0.0.3-py3-none-any.whl (20.3 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page