Hello everyone,
I’ve been working on a project for the hololens (1). I got the mixed reality toolkit set up and it’s working correctly. I can connect to the hololens remoting tool from within the Unity editor, and run the app on the hololens that way.
Now I want to build and ship a binary.
I figured out I can build a UWP app, package it, and upload it via the hololens web portal. This process works, but my project’s resource demands are too much for the hololens’ internal hardware. So, I want to use the remoting option.
I want to build a Windows executable that my client can run on a powerful machine. The user can then provide the IP address of their hololens, and the application should connect to the holographic remoting link of the hololens. (Basically, what the Unity editor does, but in a built, released, executable format.)
Do you know how I can get my Unity editor to build an executable that will use the hololens in this way?
If I have not explained my puzzle clearly enough, please let me know.
Thanks for reading!
-Ben
Yes! Thank you, GameDevCouple. I made some progress, but got stuck here:
I got my Unity project to build into a UWP solution for visual studio 2017. When I return the VS solution, I get a UWP pop-up “Can’t open app” with the text “To use this app, you’ll need to set up Mixed Reality. Go to Start > Mixed Reality Portal or plug in a compatible headset to get started.”
Now, just a moment before and a moment after, I can run the Unity editor in Play mode using the holographic remoting, and it works just fine. Unity managed to connect and use the hololens. But the UWP built app can’t.
The hololens is connected via USB (which works cause I can see the files)
The hololens is also connected via Wifi (whick works cause I can access the device via its web interface by entering its IP in a browser.)
When I open the Mixed Reality Portal, it just says welcome and “connect your headset”.
I’ve been trying different build options and looking for hidden settings/configs that would explain this. So far I’ve got found nothing.
Any ideas? What am I doing wrong?
Also this:
When I run my project from within the Unity editor WITHOUT connecting to the hololens using Window > XR > Holographic Emulation > Connect
then the code within my project does attempt to connect to the hololens (as it should) and the remoting client on the hololens does see the incomming connection. However, it just removes its help screen (the one with the IP address on it) and shows only black.
My connecting monobehaviour code looks like this:
public void Update()
{
if (Timeout > 0.0f)
{
Timeout -= Time.deltaTime;
if (Timeout <= 0.0f)
{
if (HolographicRemoting.ConnectionState != HolographicStreamerConnectionState.Connected)
{
Debug.Log("Connecting...");
HolographicRemoting.Connect(HololensIpAddress);
}
}
}
connectionState = HolographicRemoting.ConnectionState;
if (!connected && HolographicRemoting.ConnectionState == HolographicStreamerConnectionState.Connected)
{
connected = true;
StartCoroutine(LoadDevice("WindowsMR"));
}
}
public IEnumerator LoadDevice(string newDevice)
{
XRSettings.LoadDeviceByName(newDevice);
yield return null;
XRSettings.enabled = true;
}
The connectionState field is visible in the editor and it does go to "connected’ during play.
It’s just, not working and I don’t know why. Any ideas?
I got a little further still.
The problem described here:
I got my Unity project to build into a UWP solution for visual studio 2017. When I return the VS solution, I get a UWP pop-up “Can’t open app” with the text “To use this app, you’ll need to set up Mixed Reality. Go to Start > Mixed Reality Portal or plug in a compatible headset to get started.”
Was solved in this way:
In the XR section of the player settings in Unity, you must include the Mixed Reality sdk. BUT! you have to include the “none” sdk option FIRST and the Mixed Reality sdk option SECOND.
This causes unity to build a stand-alone UWP project that runs on the desktop system.
The issue I have now is that I added a bit of UI to input the hololens IP Address and a connect button, but the stand-alone app will not connect properly. A unity exception is shown with “Unable to connect”, and not much more.
(I made sure to give the UWP app local-network capability.)
Any ideas are welcome!