I want to connect the IoT realtime data to unity 3D with ARcore ?

Samuel Kingslin Kumar A 26 Reputation points
2021-08-18T05:27:18.17+00:00

Hi,
I need to Get data from the Azure IoT Hub, Real - Time data ( Dynamic Data) and I want to import the data into Unity 3D with AR Core. I am searching for the best solutions . Please provide the solution.

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,272 questions
0 comments No comments
{count} vote

Accepted answer
  1. QuantumCache 20,366 Reputation points Moderator
    2021-08-18T18:38:46.637+00:00

    Hello @Samuel Kingslin Kumar A , I really like the idea of integrating Azure IoTHub with Unity 3D apps.
    I hope the below information may help with your initial query. Please do comment in the below section if you need further help in this matter.

    Approach 1:

    You can use Microsoft.Azure.Devices.Client package, and then use DeviceClient to receive Cloud-to-Device message.

    Receive messages in the device app

    private static async void ReceiveC2dAsync()  
     {  
         Console.WriteLine("\nReceiving cloud to device messages from service");  
         while (true)  
         {  
             Message receivedMessage = await s_deviceClient.ReceiveAsync();  
             if (receivedMessage == null) continue;  
      
             Console.ForegroundColor = ConsoleColor.Yellow;  
             Console.WriteLine("Received message: {0}",   
             Encoding.ASCII.GetString(receivedMessage.GetBytes()));  
             Console.ResetColor();  
      
             await s_deviceClient.CompleteAsync(receivedMessage);  
         }  
     }  
    

    Approach 2:

    Sensors + Raspberry Pi => IoT Hub => Storage => Api => Unity App

    Approach 3:

    Sensors + Raspberry Pi => IoT Hub => Publish to Service Bus Topic => Unity App(subscribe)

    Approach 4:

    IoT Hub-> Azure Function-> SignalR -> Unity

    Build real-time Apps with Azure Functions and Azure SignalR Service

    Reference to visit : Azure Functions demo for Unity

    Further readings: SO link 1 SO Ref Link 2
    Please do comment in the below section if you need further help in this matter.

    2 people found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Sander van de Velde | MVP 36,761 Reputation points MVP Volunteer Moderator
    2021-08-18T18:22:22.647+00:00

    Hello @Samuel Kingslin Kumar A ,

    I'm not well informed about the AR Core programming model but there are multiple solutions to investigate.

    Are you able to connect to an EventHub or ServiceBus? Use IoT Hub message routing so send messages to that service.

    If you can connect to a WebSockets server, you can send IoT Hub telemetry to that server (eg. using the Azure Function EventHub trigger connected to the IoT Hub built-in event hub compatible endpoint).

    Or, more specific, If you can listen to SignalR messages, you can make use of Azure SignalR services (again connected to the IoT Hub using an Azure Function).

    Eventually, you can create your own custom (intermediate) service accepting telemetry which is sent to that service using eg. An Azure Function or an EventGrid Webhook.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.