Petal Docs
  • Introduction
  • Connect to muse (Free)
    • Connect muse & Stream Raw Data
      • Connect muse to Mac
      • Connect muse to Windows
  • Receive Data Streams (Free)
    • Receive an LSL Stream
      • Python Examples
      • Node Examples
    • Receive an OSC Stream
      • Python Examples
      • Node Examples
    • Receive Webhooks
      • Python Examples
      • Node Examples
  • Log Data (Free)
    • Logging Data
  • Metrics API (Maker Plan)
    • API Integration
    • Make Metrics API calls
      • Python Examples
      • Node.js Examples
  • Receive Data Streams (Maker Plan)
    • Receive an LSL Stream
      • Python Examples
      • Node Examples
    • Receive an OSC Stream
      • Python Examples
      • Node Examples
    • Receive Webhooks
      • Python Examples
      • Node Examples
  • Glossary of Terms
    • Glossary of Terms
  • 🧪Markers
    • 🧪Markers User Guide
Powered by GitBook
On this page
  • Node Installation
  • Script Examples

Was this helpful?

  1. Receive Data Streams (Free)
  2. Receive an LSL Stream

Node Examples

PreviousPython ExamplesNextReceive an OSC Stream

Last updated 3 years ago

Was this helpful?

Node Installation

See the for full scripts. We used Node.js 10.15.3 for these examples. If you don't use LSL, you can probably use versions 14.15.1+.

Install the dependencies:

npm install

Script Examples

This script receives an LSL EEG stream and prints it to console.

node lsl_receive.js -n SimulatedEEGStream
node lsl_receive.js -n PetalStream_gyroscope
node lsl_receive.js -n PetalStream_ppg
node lsl_receive.js -n PetalStream_telemetry
node lsl_receive.js -n PetalStream_eeg
node lsl_receive.js -n PetalStream_acceleration
node lsl_receive.js -n PetalStream_connection_status

This script streams 4 channels of EEG data at a selected sample rate. It can stream randomly generated data, or from a CSV file with any header where the first 4 columns represent channels 1-4.

  • Random EEG data at 256Hz:

node lsl_stream.js -s 256
  • From a CSV file at 256Hz:

node lsl_stream.js -s 256 -f ../example_data.csv
getting started repo
lsl_receive.js
lsl_stream.js