Connecting Bose Frames to editor through USB provider

Connecting Bose Frames to editor through USB provider

jpnelsonjpnelson Member Posts: 3
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?

Comments

  • Michael@Bose[email protected] Member Posts: 66
    Hi! Per this guide - https://developer.bose.com/guides/bose-ar/data-providers - you also need to change the Editor Default Provider to USB Provider via a dropdown menu once you attach the Wearable Control script.
  • jpnelsonjpnelson Member Posts: 3
    I have already set the provider to USB provider.

    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?
  • jpnelsonjpnelson Member Posts: 3
    Posting an update to my response.

    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!
  • Michael@Bose[email protected] Member Posts: 66
    Hi jpnelson. Glad you were able to figure it out!

    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
  • markmcgmarkmcg Member Posts: 5
    Just to resurrect this - I'm in a similar position. I've followed the workshop guide for setting up the basic scene (including the WearableConnectUIPanel prefab), added a WearableControl component, and set it to USB provider for the Editor and when I hit play it just sits at searching with no device found. The WearableUSBProvider GetDiscoveredDevices() method is being called every couple of seconds, but it's returning 0 devices discovered. The glasses are definitely plugged in over USB (e.g. the firmware update to 4.0.2 worked fine), and if i change the WearableControl to use the debug provider that is discovered fine. Any debugging suggestions?
  • StyloTyloStyloTylo Member Posts: 1
    markmcg said:
    Just to resurrect this - I'm in a similar position. I've followed the workshop guide for setting up the basic scene (including the WearableConnectUIPanel prefab), added a WearableControl component, and set it to USB provider for the Editor and when I hit play it just sits at searching with no device found. The WearableUSBProvider GetDiscoveredDevices() method is being called every couple of seconds, but it's returning 0 devices discovered. The glasses are definitely plugged in over USB (e.g. the firmware update to 4.0.2 worked fine), and if i change the WearableControl to use the debug provider that is discovered fine. Any debugging suggestions?
    I am having this exact same problem as well! Have tried several different versions of Unity as well as Mac/PC.
  • Michael@Bose[email protected] Member Posts: 66
    Hi! We are unable to reproduce the issue you describe @StyloTylo and @markmcg - without being able to know more details about your development environment or the functionality of your hardware it's not likely we will be able to help you find a solution.

    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

  • Michael@Bose[email protected] Member Posts: 66
    One final thing you can try: If you are using Bose Frames and you have them turned upside down, that will automatically turn them off. Please ensure that you have them sitting normally and not upside down while plugged in via usb and connected to your desktop/laptop computer. 
  • markmcgmarkmcg Member Posts: 5
    Hi Michael, so if i set the WearableControl runtime provider to WearableDevice and deploy to an Android phone it works perfectly. So the Unity project appears setup correctly, it just never discovers the device when running in-editor with the USB Provider for the Editor Default Provider. Is there anything I can check/verify driver wise? This is on Windows 10 incidentally, and the Bose Updater picks up the frames as being connected to the computer. I've tried on various versions of Unity as well, from 2017.4 up to 2019.1. I've tried with two different frames each with different cables, which both received the firmware updates fine, so I don't think it's a (Bose) hardware issue at any rate. 
  • edited 07/09/2019 - 09:25
    markmcgmarkmcg Member Posts: 5
    @[email protected] Getting slightly further with 0.15. Now the Frames are detected at least with the USB provider, but when i click the Bose Frames entry on the UI panel the connection fails:
    <div>Session opened.
    <span style="background-color: transparent; color: inherit; font-size: inherit; font-family: Gotham, &quot;Segoe UI&quot;, &quot;Helvetica Neue&quot;, Helvetica, Raleway, Arial, sans-serif;">USB send: im on
    </span><span style="background-color: transparent; color: inherit; font-size: inherit; font-family: Gotham, &quot;Segoe UI&quot;, &quot;Helvetica Neue&quot;, Helvetica, Raleway, Arial, sans-serif;">Error from HIDAPI:
    </span><span style="background-color: transparent; color: inherit; font-size: inherit; font-family: Gotham, &quot;Segoe UI&quot;, &quot;Helvetica Neue&quot;, Helvetica, Raleway, Arial, sans-serif;">The parameter is incorrect.
    </span><span style="background-color: transparent; color: inherit; font-size: inherit; font-family: Gotham, &quot;Segoe UI&quot;, &quot;Helvetica Neue&quot;, Helvetica, Raleway, Arial, sans-serif;">Closed USB session with unprocessed commands.
    </span><span style="background-color: transparent; color: inherit; font-size: inherit; font-family: Gotham, &quot;Segoe UI&quot;, &quot;Helvetica Neue&quot;, Helvetica, Raleway, Arial, sans-serif;">[Bose Wearable] The connection to the device has failed. Ending attempt to connect to device.</span></div>
    Any ideas? 
  • squaresetsoundsquaresetsound Member Posts: 4
    markmcg said:
    @[email protected] Getting slightly further with 0.15. Now the Frames are detected at least with the USB provider, but when i click the Bose Frames entry on the UI panel the connection fails:
    <div>Session opened.
    <span style="background-color: transparent; color: inherit; font-size: inherit; font-family: Gotham, &quot;Segoe UI&quot;, &quot;Helvetica Neue&quot;, Helvetica, Raleway, Arial, sans-serif;">USB send: im on
    </span><span style="background-color: transparent; color: inherit; font-size: inherit; font-family: Gotham, &quot;Segoe UI&quot;, &quot;Helvetica Neue&quot;, Helvetica, Raleway, Arial, sans-serif;">Error from HIDAPI:
    </span><span style="background-color: transparent; color: inherit; font-size: inherit; font-family: Gotham, &quot;Segoe UI&quot;, &quot;Helvetica Neue&quot;, Helvetica, Raleway, Arial, sans-serif;">The parameter is incorrect.
    </span><span style="background-color: transparent; color: inherit; font-size: inherit; font-family: Gotham, &quot;Segoe UI&quot;, &quot;Helvetica Neue&quot;, Helvetica, Raleway, Arial, sans-serif;">Closed USB session with unprocessed commands.
    </span><span style="background-color: transparent; color: inherit; font-size: inherit; font-family: Gotham, &quot;Segoe UI&quot;, &quot;Helvetica Neue&quot;, Helvetica, Raleway, Arial, sans-serif;">[Bose Wearable] The connection to the device has failed. Ending attempt to connect to device.</span></div>
    Any ideas? 
    Just to add that I am having what I think is the same issue with SDK v0.16.0 targeting Android.
  • Filip@Bose[email protected] Member Posts: 43
    Hey @markmcg and @squaresetsound, I hope this finds you well.
    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!

  • squaresetsoundsquaresetsound Member Posts: 4
    I've now upgraded to Frames firmware Version 4.0.3 and Unity sdk version 4.0.0.

    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.

    Session opened.
    USB send: im on
    Error from HIDAPI:
    The parameter is incorrect.
    Closed USB session with unprocessed commands.
    [Bose Wearable] The connection to the device has failed. Ending attempt to connect to device.

    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!
  • Filip@Bose[email protected] Member Posts: 43
    Can you attempt to restart Unity and try connecting with the Wearable Control USB Provider again?
  • prehensileprehensile Member Posts: 11
    I think I'm having the same problem - trying to use USBProvider in a new Unity project, built from scratch and using components the 4.0 SDK.

    Running in the editor, with the Frames connected over USB, I see Bose Frames as an option on the 'Select a device' screen, but they never connect.

    Running on an iPhone, behaves as expected.

    I'm running macOS 10.14.5, Unity 2019.1.8f1, BoseWearable-Unity_v4.0.0.unitypackage, Frames firmware 4.0.3

  • Filip@Bose[email protected] Member Posts: 43
    Have you tried updating your firmware on https://btu.bose.com/ ?
    Are your frames connected with the USB cable to the computer?
  • thegladscientistthegladscientist Member Posts: 1
    Hey @[email protected]

    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)

  • Filip@Bose[email protected] Member Posts: 43
    Can you confirm that running the latest version of the SDK 4.0.5 still gives you this issue? 
    Try a fresh project and fresh import of the SDK.
    Cheers!
Sign In or Register to comment.