# Auto-reconnect Firmata (bluetooth) I/O device

**URL:** <https://mworks.discourse.group/t/auto-reconnect-firmata-bluetooth-i-o-device/197>\
**Category:** Support\
**Created:** [December 13, 2019, 8:37pm UTC](https://mworks.discourse.group/t/auto-reconnect-firmata-bluetooth-i-o-device/197 "2019-12-13T20:37:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 13, 2019, 8:37pm UTC](https://mworks.discourse.group/t/auto-reconnect-firmata-bluetooth-i-o-device/197/1 "2019-12-13T20:37:52Z")

</div>

Hey Chris,

We sometimes need to de-power a Firmata I/O Bluetooth device during an experiment (e.g., to change a battery). We currently have an .mwel file that connects to the Bluetooth device at the beginning of the task. We would like the experiment to be able to reconnect to the device automatically when this happens (as well as logging when the device was connected / reconnected), instead of having to restart the experiment altogether (our current solution).

Do you have a recommended way to implement this Firmata I/O auto-reconnect behavior (e.g. in .mwel code), and if not, would it be possible to add this in to Mworks?

Thanks,  
Michael

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 16, 2019, 8:49pm UTC](https://mworks.discourse.group/t/auto-reconnect-firmata-bluetooth-i-o-device/197/2 "2019-12-16T20:49:54Z")

</div>

Hi Michael,

At present, if the Firmata device disconnects, the only way to reconnect is to unload and re-load the experiment (as you’re currently doing).

On-the-fly reconnecting is something we could probably support. The fact that you’re de-powering the device complicates things, as MWorks would have to both reconnect to it _and_ reconfigure it. Let me think about it.

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [March 2, 2020, 8:00pm UTC](https://mworks.discourse.group/t/auto-reconnect-firmata-bluetooth-i-o-device/197/3 "2020-03-02T20:00:47Z")

</div>

Hi Michael,

> On-the-fly reconnecting is something we could probably support.

As [noted elsewhere](https://mworks.tenderapp.com/discussions/suggestions/479#comment_48131140), this is now supported.

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [July 19, 2022, 8:30pm UTC](https://mworks.discourse.group/t/auto-reconnect-firmata-bluetooth-i-o-device/197/4 "2022-07-19T20:30:07Z")

</div>

Closed on July 19, 2022, 8:30pm UTC


