Connecting Bose Frames to editor through USB provider
I have downloaded and setup the Bose AR SDK with Unity, and I'm trying to get one of the demos working with my Bose Frames. I've read in the docs that I can use the USB provider to get input data from my Frames to the Unity editor. I tried attaching the usb charging cable to my Mac, placing a Wearable Control script onto the EventSystem object in the Basic Demo scene, and I'm not getting input data or connection information. I've updated the Frames to the latest version and my Unity environment is setup as described in the docs. Am I doing something wrong? Are there additional steps required for using Frames through USB with Unity?
0
Comments
I'm looking through the WearableUSBProvider code in the package and I've started placing breakpoints to see where the device should be connecting while in the editor. I've discovered that the WearableUSBProvider has a function called SearchForDevices that I'd imaging should be running when the editor starts playing so that it can search for any connected devices. It turns out this function isn't running on startup. I looked through the rest of the code and found that the SearchForDevices function for the provider is only initiated by the WearableProxyServer and the WearableConnectUIPanel script. The docs mention that I shouldn't be using the WeableProxyServer and instead should use the usb provider.
Is the WearableProxyServer script a necessary component in a scene to initiate a connection to the Frames through usb?
Otherwise, would I have to setup a UI scene with the WearableConnectUIPanel configured to get a connection to the frames completed?
I was able to figure out how to get the Bose Frames connected to the editor. I read through the documentation more carefully and my suspicions above were correct, the WearableConnectUIPanel is required as stated in the Device Discovery and Connection section of the Advanced guides. By adding the UIPanel prefab, the WearableDeviceDisplayButton prefab, and the WearableControl script to the Basic Demo scene, I am now getting device feedback and the 3D model is rotating.
Although the docs contain the necessary information for getting the project setup, I would have preferred a more structured walkthrough. Having these essential connection guides housed in the "Advanced Guides" was misleading and I was worried the Basic Demo was broken on startup. I'm also unsure of the use of the Basic Demo without these components added from the start, given that the scene only outputs an error when played. It might help future developers to add the connection prefabs to the scene beforehand. Also it would help if the SDK demo sections of the docs explicitly outline that these connection prefabs will be required for the editor to work correctly for developers.
I'm looking forward to getting some projects working with the Frames now!
I'd like to address two points of your comment, specifically:
1. "I'm also unsure of the use of the Basic Demo without these components added from the start"
The primary expected use for the Basic Demo is to deploy to a mobile app for testing with a Bose AR device connected to the mobile app using Bluetooth. This gives an accurate understanding of how the bluetooth connection and mobile app will function in the real world.
Unfortunately, using the USB provider provides a lower-than-realistic expectation for latency and may not be a 1 to 1 representation for how an app will perform via a mobile device connected via bluetooth to a given Bose AR device. There are also differences between how the USB provider functions on Bose Frames versus QuietComfort 35 IIs that are Bose AR capable, and we expect that trend to continue as more supported hardware comes to market.
This is why the Basic Demo setup guide, which we expect many first time users will use to build the example - like you did - points a user to select a "supported platform" (iOS or Android) instead of setting up the USB Provider.
2. "Having these essential connection guides housed in the "Advanced Guides" was misleading and I was worried the Basic Demo was broken on startup."
The "data providers" guide (https://developer.bose.com/guides/bose-ar/data-providers) that shows how to configure the USB provider is under the Advanced area for this reason - it is expected that the various proxies and simulators listed there, including the USB provider, are for more advanced users, once they've done that initial Basic Demo setup and deployed to a mobile device to see how it functions in the real world.
To be clear: the USB provider is meant as a supplementary - not primary (importantly) - testing tool for advanced developers who have already built the demos to their mobile devices and tested real world functionality and who want to test more quickly than having to push builds to mobile each time they test.
Hope this helps!
Michael
In terms of further debugging this, have either of you tried actually deploying the application to the mobile device and connecting to your Bose AR hardware via bluetooth, as intended? If this also doesn't work then you could have an issue with your Bose AR hardware itself.
Regardless, the USB Provider is not the recommended testing method, as it doesn't respond accurately and with the correct amount of simulated latency, because it is simulating a BLE mobile connection over USB on a desktop, and isn't guaranteed to function in all scenarios, as your finding, the way that actually deploying the application to mobile and connecting via bluetooth should.
So we don't recommend making USB Provider your primary way of testing, as it may become a blocker, if you can test as a normally deployed mobile application instead, as intended.
Michael @ Bose
Any ideas?
Can you try recreating the steps in this gitbook:
https://bosedevs.gitbook.io/bose-ar-unity-workshop/
This will show you how to build directly to your mobile device.
If your USB provider inside Unity is having problems, I might suggest you upgrade your device firmware using our Bose updater tool https://btu.bose.com/
Please try the steps above and let us know if you still run into issues.
I will try my best to recreate on my end to narrow down and find the issue.
Happy to help,
Cheers!
Starting with a new project and importing the demo package, building to device is fine. Again, running in unity editor with USB provider selected in Wearable Control in the Root scene, 'Bose Frames' are discovered but attempting to connect leads to an immediate failure as @markmcg describes above.
This message is being reported immediately following the call to WearableUSBUpdate(); in UpdateDeviceConnection()
I hope this helps you track down the error. It really would be helpful to be able to run directly in the editor!
Are your frames connected with the USB cable to the computer?
I tried the steps listed in this video walkthrough, but ran into this same error as the others. https://www.youtube.com/watch?v=B1QgxB_ikJQ Is there a known solution to this other than building to an app first?
Additionally, when installing the SDK in a clean project, I get an error that says "Error while importing package - cannot decompress". I'm not sure this is related but figured I'd mention it. I looked through tons of stuff on this on the Unity forums and it said it's possible the package was built with a different version of Unity and that could be causing issues...as a side quest: do you know the version of Unity the SDK package for 4.04 was created in?
Firmware: 4.03 (Rondo)
SDK: 4.0.4
Unity: 2019.1.14f
(also tested on 2018.4.12LTS and 2019.2.5f)
Try a fresh project and fresh import of the SDK.
Cheers!