Skip to content

Commit b85e714

Browse files
committed
add docs about CLI behaviour when amp is already running.
1 parent 423e2b8 commit b85e714

1 file changed

Lines changed: 35 additions & 2 deletions

File tree

README.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,39 @@ The CLI provides a lightweight alternative to the GUI:
5959
./EGIAmpServerCLI --address 10.10.10.51 --sample-rate 1000 --align-timestamps
6060
```
6161

62+
## Connecting to an Already-Running Amplifier
63+
64+
When another application (e.g., Net Station Acquisition) has already started the amplifier, the CLI's behavior depends on whether you pass any rate or mode flags.
65+
66+
### Default: Non-Destructive Attach
67+
68+
With no rate flags, the CLI detects the running amplifier, measures its current sample rate from the data stream, and attaches without disrupting the existing session:
69+
70+
```bash
71+
# Attaches to whatever rate/mode the amp is already using
72+
./EGIAmpServerCLI --address 10.10.10.51
73+
```
74+
75+
This is safe to use alongside Net Station — it will not stop or reconfigure the amplifier.
76+
77+
### Forcing a Rate or Mode
78+
79+
The following flags cause the CLI to stop, reconfigure, and restart the amplifier — even if it was started by another application:
80+
81+
- `--sample-rate <hz>` — reinitializes if the detected rate differs from the requested rate
82+
- `--fast-recovery` — reinitializes to ensure native (unfiltered) mode
83+
- `--align-timestamps` — reinitializes at 500/1000 Hz to ensure decimated (filtered) mode, since the operating mode cannot be distinguished from the data stream alone
84+
85+
**Warning**: Reinitialization will interrupt any active Net Station recording. If you need to coexist with Net Station, omit these flags and let the CLI match the existing configuration.
86+
87+
### Recovery During Streaming
88+
89+
If the amplifier is stopped or restarted externally while the CLI is streaming:
90+
91+
- **Amp powered off by another app** (e.g., Net Station clicks "Off"): The CLI detects stream loss and attempts to reinitialize the amplifier with its original settings.
92+
- **Amp restarted by another app** (e.g., Net Station reconnects): The CLI detects the new stream, adapts to whatever rate the other app configured, and recreates its LSL outlets if the rate changed.
93+
- **Amp power-cycled or shutdown**: The CLI waits up to 120 seconds for recovery before giving up.
94+
6295
## Sample Rate Modes
6396

6497
The NA400/NA410 amplifiers support two operating modes that affect anti-aliasing and latency:
@@ -357,7 +390,7 @@ The mock server generates synthetic sine waves (10-50 Hz) with noise for the EEG
357390

358391
## Net Station Acquisition Compatibility
359392

360-
When the user
393+
See also [Connecting to an Already-Running Amplifier](#connecting-to-an-already-running-amplifier) for details on how the CLI behaves when attaching to an amp started by Net Station.
361394

362395
### Behavior When EGIAmpServer is Streaming First
363396

@@ -399,7 +432,7 @@ When using this application alongside Net Station Acquisition:
399432
- **Recommended workflow**:
400433
1. Start Net Station Acquisition
401434
2. Initialize the amplifier at your desired sample rate (click "On")
402-
3. Start EGIAmpServer and click "Link" - it will detect the running amp and match its sample rate
435+
3. Start EGIAmpServer (GUI: click "Link", or CLI: run with no rate flags) — it will detect the running amp and match its sample rate
403436
4. Both applications will now receive data at the correct rate
404437

405438
## Dropped Packets After Device Shutdown

0 commit comments

Comments
 (0)