Auto-reconnect BLE feature request

mil's Avatar

mil

02 Mar, 2020 06:13 PM

Hey Chris,
We are still unsure what is causing the bluetooth disconnection issues. Until then, would it be possible to add in a behavior that stops the task when a Bluetooth firmata IO device disconnects; constantly attempts to reconnect (e.g. with exponential backoff); and if successfully reconnects, resumes the task from where it was?

It would be useful if these events threw warnings/errors messages on the client console, and if these events were loggable in the .mwk2 file.

  1. Support Staff 1 Posted by Christopher Sta... on 02 Mar, 2020 07:58 PM

    Christopher Stawarz's Avatar

    Hi Michael,

    Until then, would it be possible to add in a behavior that stops the task when a Bluetooth firmata IO device disconnects; constantly attempts to reconnect (e.g. with exponential backoff); and if successfully reconnects, resumes the task from where it was?

    I've added two new parameters, connected and reconnect_interval, which enable this behavior.

    connected should be set to the name of a variable. The variable will be set to true when the device is connected, false when it disconnects. By monitoring the value of the variable (e.g. at the beginning of each trial or via attached actions), your experiment can take appropriate action (e.g. pause or resume the experiment) when the connection state changes.

    It would be useful if these events threw warnings/errors messages on the client console, and if these events were loggable in the .mwk2 file.

    The device does log messages upon disconnection and reconnection, and these messages (like all MWorks messages) will be saved in the event file. Also, the value of the connected variable (like all variables) will be stored in the event file.

    I can update your iPad(s) whenever you like.

    Cheers,
    Chris

  2. Christopher Stawarz closed this discussion on 17 Mar, 2020 12:44 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

17 May, 2022 02:12 PM
16 May, 2022 03:12 PM
04 May, 2022 06:02 PM
03 May, 2022 01:30 PM
02 May, 2022 10:47 PM