question

SamuelKingslinKumarA-7050 avatar image
1 Vote"
SamuelKingslinKumarA-7050 asked SatishBoddu-MSFT answered

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

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SatishBoddu-MSFT avatar image
2 Votes"
SatishBoddu-MSFT answered

Hello @SamuelKingslinKumarA-7050, 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.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SandervandeVelde42 avatar image
1 Vote"
SandervandeVelde42 answered

Hello @SamuelKingslinKumarA-7050 ,

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.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.