Skip to content

Commit

Permalink
record.py: send a keep alive message every minute.
Browse files Browse the repository at this point in the history
  • Loading branch information
zero committed Apr 16, 2024
1 parent f899ba3 commit 6d837e6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions muselsl/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,15 @@ def save_eeg(new_samples, new_timestamps):
t_init = time()
print('Start recording at time t=%.3f' % t_init)

last_update = t_init
while (time() - t_init) < duration:
try:
backends.sleep(1)

# Send a keep alive every minute
if time() - last_update > 60:
last_update = time()
muse.keep_alive()
except KeyboardInterrupt:
break

Expand Down

0 comments on commit 6d837e6

Please sign in to comment.