Lab Streaming Layer
Push raw EEG samples to the LSL network. Discoverable by OpenViBE, MNE-LSL, BCI2000, NeuroPype, LabRecorder.
pieeg-server --lsl # enable on startup
pieeg-server --lsl --lsl-name MyEEG # custom stream nameToggle at runtime via dashboard or WebSocket (lsl_start / lsl_stop).
Receive in Python
from pylsl import StreamInlet, resolve_stream
streams = resolve_stream('name', 'PiEEG')
inlet = StreamInlet(streams[0])
sample, timestamp = inlet.pull_sample()WebSocket Control
{"cmd": "lsl_start"}
{"cmd": "lsl_stop"}
{"cmd": "lsl_status"}
{"cmd": "lsl_groups_get"}
{"cmd": "lsl_groups_set", "groups": [
{"name": "EEG", "channels": [0, 1, 2, 3, 4, 5, 6]},
{"name": "EOG", "channels": [7]}
]}Channel Groups
Configure multiple LSL outlets, each streaming a subset of channels. Useful for separating EEG from EOG/EMG channels.
Interactive Setup
Use the regions setup wizard to define channel groups interactively:
pieeg-server --osc-regions-setupThis creates ~/.pieeg/lsl_groups.json that both OSC and LSL integrations use.
WebSocket Configuration
Example: Split 8-channel stream into EEG (Ch0–6) and EOG (Ch7):
{"cmd": "lsl_groups_set", "groups": [
{"name": "EEG", "channels": [0, 1, 2, 3, 4, 5, 6]},
{"name": "EOG", "channels": [7]}
]}Each group creates a separate LSL stream named {GroupName}_{StreamName} (e.g., EEG_PiEEG, EOG_PiEEG).
If no groups are configured, a single default outlet streams all channels.
Stream Properties
| Property | Value |
|---|---|
| Name | PiEEG (configurable via --lsl-name) |
| Type | EEG |
| Channels | 8 (pieeg8 / ironbci8), 16 (pieeg16), or 32 (ironbci32) |
| Sample rate | 250 Hz (PiEEG/IronBCI-8) or 500 Hz (IronBCI-32) |
| Format | float32 |
Install the LSL extra: pip install pieeg-server[lsl] — requires pylsl>=1.16.
Compatible Software
- OpenViBE — BCI design & experimentation
- MNE-Python — MEG/EEG analysis
- BCI2000 — general-purpose BCI system
- NeuroPype — neural data processing pipelines
- LabRecorder — LSL stream recording