Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

Simple way to send messages from HoloLens to a Unity application on desktop

Hi everyone,

Currently I am working on a project that needs the communication between the a HoloLens app and a Unity desktop application. More in detail, I want the HoloLens app to send a simple message (e.g. a digit) to a unity application that is running on a Windows 10 desktop, and the desktop app needs to receive the message and show the digit it gets.

Since I am very new to HoloLens and unity development, and don't know much about network, I have been searching the internet and looking for some very simple and easy way to do this but all ended up with some codes beyond my knowledge. Do you know if there is any easy to way to do this? Would you mind sharing some basic codes? And any examples or tutorials are all welcome!

Thank you in advance!!!
Will

Tagged:

Answers

  • Options

    Try the sharing service. You can run it via Unity using the Hololens Unity ToolKit.

    This tutorial covers its setup a bit:
    https://developer.microsoft.com/en-us/windows/mixed-reality/holograms_240

    Taqtile

  • Options
    james_ashleyjames_ashley ✭✭✭✭

    @willyoung What mark said! Here's a broader article on the sorts of things you can do with the sharing service: https://blogs.windows.com/buildingapps/2017/04/18/building-telepresence-app-hololens-kinect/

    James

    James Ashley
    VS 2017 v5.3.3, Unity 2017.3.0f3, MRTK 2017.1.2, W10 17063
    Microsoft MVP, Freelance HoloLens/MR Developer
    www.imaginativeuniversal.com

  • Options

    Hi all, can someone point me to the function I need to send a string to another program (NOT another HoloLens or Unity)? I can't find anything in the Sharing Stage that would do so.

  • Options
    stepan_stulovstepan_stulov ✭✭✭
    edited September 2017

    While others are advising using HoloToolkit with its CustomMessages (that as far as I understand work within the context of Sharing) I would like to advise a simple and cross-platform solution: uNet aka Unity Networking

    Simply create an instance of NetworkServer on one end and an instance of NetworkClient on another. Additionally use NetworkDiscovery to find each other. Finally connect and send an instance of your own MessageBase subclass and listen for it on another end.

    Bam, done, you can connect PC to HoloLens, iOS to Android, or Blueberry to Linux.

    I'm not entirely sure why HoloToolkit and its CustomMessages as part of its Sharing is recommended. Sharing is "hunting sparrows with a cannon" for the requested task. It's using a tool built on top of (Windows-only?) networking with a very specific purpose of syncing world anchors and actions between HoloLenses only to send one message. Why not just do that - send a message. Would you guys like to elaborate? I can see a general tendency of trying to use HoloToolkit in places where there is a more universal, more simple and less platform-locked solution by Unity. I'm sincerely curious why:)

    Hope this helps.

    Building the future of holographic navigation. We're hiring.

  • Options

    We started with the toolkit based on what we learned in the Hololens Academy and haven't had a need to switch until recently. We just started looking into switching to Unet for its peer to peer capabilities and Android/iOS support but we haven't started working on it yet and thus I can't recommend it or advise on how to use it. But definitely worth looking into other options if you are considering peer to peer or cross platform. Or if you are simply sending a message and not needing spatial anchors... I assume that and people want to send messages in addition to the spatial anchors but in this case it sounds as though I am wrong.

    Taqtile

  • Options

    Thanks so much @mark_grossnickle, just what I needed. I wish the Sharing section on GitHub had better documentation...

    @stepan_stulov In my case, I'm connecting my Unity program on HoloLens to a C++ program that interfaces with our lab's robot arms. The UNet solution doesn't work for me because of this. I previously used dotnet networking on my Unity Android app, but that seems to be incompatible with UWP & HL.

Sign In or Register to comment.