-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Connecting an SBrick to a BuWizz output gets you a lot of ports for not a lot of space. Unfortunately, the BuWizz doesn't produce any output on the "permanent" pins of any of its ports unless a device is connected to it.
BC2 disconnects from a device as soon as you leave the device page, which makes it impossible to find the SBrick. This can be worked around by using the BuWizz app to power the device in the background whilst scanning for the SBrick, but it'd be nice to be able to do it all in BC2.
Simply commenting out this line makes it work for me:
brickcontroller2/BrickController2/BrickController2/UI/ViewModels/DevicePageViewModel.cs
Line 103 in e83c1d5
| await Device.DisconnectAsync(); |
I can now find my SBricks by doing a scan, selecting the BuWizz, leaving the device page and doing another scan.
I've also edited ConnectAsync to not attempt to connect if the device state is already Connected. Happy to turn this into a PR if that'd be useful.
I'm not sure if there's a downside to keeping these connections open. If so, perhaps it could be made an option for the case where a BuWizz is being used as a power supply.
EDIT:
It turns out that there's a further issue which is that it won't reliably connect to a creation with this configuration of devices. I assume that this is because ConnectDevicesAsync doesn't understand the dependencies and attempts to connect in an undetermined order. I've hacked it around a bit so that it connects BuWizz devices first, then connects all remaining devices in a second pass and this seems to fix it.