Let me first describe the all picture : I want to receive sensors data on my Unity app through Azure Cloud, and specially Azure IoT Hub the dedicated service for IoT system.
Sensors + raspberry pi => Azure Cloud => Unity.
In order to do this, I have created a Azure IoT Hub. I have installed the "Python Client Azure IoT Hub SDK" on my raspberry pi and I can send the sensors data to my IoT Hub thanks to "device to cloud" messages.
Now I want to receive it on my Unity app. IoT Hub endpoint to connect it to Unity is link to Event Hub, as I understood the documentation. As Unity use C# for programming, I try to install the ".NET Event Hub SDK" on Unity but I'm facing some issues.
I've tried on Unity 2018.3.12f1 with those configurations:
(Sorry I didn't find the "add picture" function)
Players Settings:
- Scripting Runtime Version : .NET 4.X Equivalent
- Scripting Backend : .NET
- Api Compatibility Level : .NET 4.X
Build Settings:
- Platform : UWP
- Target device : PC
- Architecture : x64
- Build type : D3D
- Target SDK version : Lastest installed
- Visual studio : 2017
- Unity C# project : yes
- Development Build : yes
I used the Nuget Package : Microsoft.Azure.EventHubs https://www.nuget.org/packages/Microsoft.Azure.EventHubs/ I downloaded it in .zip, and put the dll file (netstandard2.0) in a Plugins folder in Unity Asset.
Unfortunately I had this error : Assembly 'Assets/Plugins/Microsoft.Azure.EventHubs.dll' will not be loaded due to errors: Unable to resolve reference 'System.Diagnostics.DiagnosticSource'. Is the assembly missing or incompatible with the current platform?
So I searched for this nuget package and installed his dll file in the Plugins file. The "same" error occurred : Assembly 'Assets/Plugins/System.Diagnostics.DiagnosticSource.dll' will not be loaded due to errors: Unable to resolve reference 'System.Memory'. Is the assembly missing or incompatible with the current platform?
I did the same, until it just didn't.
My question : How to install Microsoft.Azure.EventHubs on Unity? Are my configurations Players Settings or Build Settings not good?
If someone had the same issues, has already install Microsoft.Azure.EventHubs or has advices, thanks for providing it ;)