Welcome to NeuroPilot

Use your Muse 2 to stream EEG to the backend; the app shows live brainwave data. Practice in the Lab (3D simulation), record training sessions, bind them to machine controls, then trigger webhooks from the machine page or with your brainwaves to fly a real DJI Tello (takeoff, land, move).

Step 1: Install and Start Muse Streamer

Install the platform-specific tool and start streaming EEG from your Muse 2. Keep it running for the next steps.

Muse 2 headband

Windows 10 - BlueMuse:

Installation:

  1. Download the BlueMuse installer and open the BlueMuse folder.
  2. Run the Windows installer (launch the installer as Administrator).
  3. If the installer fails, try the alternate installer included in the same folder.

Starting BlueMuse:

  1. Open BlueMuse from the Start menu or launch the installed app
  2. Ensure your Muse 2 headband is powered on and in pairing mode
  3. BlueMuse will automatically detect and connect to your Muse 2 device
  4. Verify the connection by checking that EEG data is streaming in BlueMuse

Mac (M1/M2) - muselsl:

Installation:

  1. Navigate to: Mac
  2. Install muselsl: python3 -m pip install -r requirements.txt
  3. Install LSL library: conda install -c conda-forge liblsl -y (for arm64 compatibility)

Starting muselsl:

  1. Start the muselsl streamer (follow the muselsl README for exact commands on your machine).
  2. Ensure your Muse headband is powered on and in pairing mode.
  3. muselsl will search for and connect to your Muse device via Bluetooth.
  4. Keep the streamer running while using the app so EEG data is available.
  5. See the Muselsl README for detailed setup instructions specific to your OS.

Both BlueMuse (Windows) and muselsl (Mac) stream data to LSL, which our app reads via WebSocket.
Platform support: Both BlueMuse (Windows) and muselsl (Mac M1/M2) are fully working and tested. The FastAPI backend automatically detects Mac and configures the LSL library for arm64 compatibility.

Step 2: Run NeuroPilot and Connect Muse 2

Start the NeuroPilot backend and frontend, then connect your Muse 2 so the app shows live EEG.

  1. Start the NeuroPilot backend (e.g. _backend, port 8000).
  2. Start the frontend (e.g. _frontned, npm run dev, port 3000).
  3. With the Muse streamer running (Step 1), put on your Muse 2 and connect it in BlueMuse or muselsl.
  4. Open EEG Device Calibration in the app to confirm live brainwave data from the backend.

If you use muselsl on Mac and the backend did not auto-connect to the stream, call POST /eeg/reconnect after the streamer is running.

Step 3: Practice and Train in Simulation, Then Bind Controls to DJI

Use Lab for 3D simulation, record Training sessions, then bind those sessions to machine controls for the DJI Tello.

  1. Open Lab, start listening, and practice controlling the 3D character with your brainwaves (simulation only).
  2. Open Training and record one or more sessions for the actions you want (e.g. takeoff, land, forward).
  3. Go to Machines, create or select a machine, and add control buttons (takeoff, land, forward, etc.).
  4. Bind each recorded Training session to the matching control (e.g. session “takeoff” → takeoff control). You will set each control’s webhook URL in Step 4.

Brainwave Controls (Lab):

  • Delta (deep focus): Move up (Power > 1M)
  • Theta: Move left (Power > 200k)
  • Alpha: Move right (Power > 200k)
  • Beta: Move down (Power > 100k)

Step 4: Run DJI Backend and Set Webhooks on Bind Controls

Start the DJI backend, connect to Tello Wi‑Fi, then set the webhook URL on each bound control.

DJI Tello drone
  1. Power on the Tello and connect your laptop to Tello Wi‑Fi (SSID e.g. "TELLO‑...").
  2. Start the DJI backend (e.g. python3 webhook_server.py in dji_backend). It listens at http://localhost:8888/command and forwards commands to the Tello via UDP.
  3. In Machines, open your machine and edit each control (takeoff, land, forward, etc.). Set the webhook URL to http://localhost:8888/command and save.
  4. Optional: on the machine page, click a control’s webhook button to test — the NeuroPilot backend POSTs to the DJI backend and the Tello should takeoff, land, or move.

The frontend never calls 8888 directly; the NeuroPilot backend (port 8000) proxies webhook calls to the DJI backend.

Step 5: Connect with DJI and Tello — Brainwave Triggers Webhook

Open Connect on the machine page with the DJI backend and Tello running; when your brainwave matches a bound control, the backend calls the webhook and the Tello responds.

  1. Ensure the DJI backend is running and the Tello is connected (Step 4), and that your Muse 2 and NeuroPilot backend are running (Steps 1–2).
  2. Go to your machine page and click Connect to open the Connect view (live status and optional Tello camera).
  3. Start listening so the backend uses your live EEG. When your brainwave pattern matches a control you bound in Step 3, the backend fires that control’s webhook.
  4. The NeuroPilot backend POSTs to http://localhost:8888/command; the DJI backend sends the command to the Tello. The real drone takes off, lands, or moves.

Safety: use small distances, keep line-of-sight, and be ready to land if the drone misbehaves.

Troubleshooting

Muse streamer not connecting? Check that your Muse is charged and in pairing mode. Restart BlueMuse (Windows) or muselsl (Mac) if needed.

No EEG data? Verify your streamer (BlueMuse or muselsl) is running and connected. Check console for error messages.

Machine not responding? Ensure your machine is properly configured in the Machines page and that training sessions are bound to controls.

WebSocket errors? Make sure the FastAPI backend is running on http://localhost:8000