I'm trying to create an MQTT client to establish a communication between HoloLens and an MQTT broker. I created a script inside the Assets folder and tried to write an MQTT client using the following libraries.
using uPLibrary.Networking.M2Mqtt;
using uPLibrary.Networking.M2Mqtt.Messages;
But how do I import these libraries to the project? I'm new to C# so I'm not aware of any build tools that can be used.
Appreciate any advice on this regards.
You need to distinguish three cases having two different DLLs:
Running on HoloLens
The native HoloLens
emulator.
Unity editor simulation i.e. Holographic Emulation or simulator (s.
Introducing Holographic
Emulation)
1 and 3 are base on UWP while Unity editor is using .NET framework (4.X nowadays). For accessing uPLibrary namespace from UWP copy the M2Mqtt.WinRT.DLL to somewhere under your Assets directory select it and edit its import settings like this:
To make things work in Unity simulator too, copy M2Mqtt.Net.DLL and edit the import settings so that Any Platforms is clicked and WSAPlayer is excluded.
You don't have to make any distinctions in code and can access MqttClient and other classes platform independent like for iOS or Android.
Related
I have a problem in development of mixed reality app and there has been 2 days that I'm stuck.
My problem is that after adding packages of MRTK to the unity project, if I click the play button, the unity exits (closing) without any error massages or warning.
I tested two versions of unity (2020.3.32f1 and 2020.3.33f1) and both had the same problem.
I am using this link (MRTK document) and also this one Mixed Reality Feature Tool as a guide for configuration and adding the packages of MRTK to my project.
I have also tried two different versions of the packages i.e. (Mixed Reality Toolkit Foundation and Mixed Reality Toolkit Extensions both versions of 2.7.3 and 2.7.2 and for Mixed Reality OpenXR Plugin package I tried 1.4.0 and 1.3.1 versions).
I am using Visual Studio 2019 version 16.11.14
Inside Unity, I am choosing Universal Windows Platform from the Build Settings and I want to practice a little development of mixed reality applications, but I am stuck at the beginning and when ever I press the play button the unity exits (closed) without any warning or error.
Just for more information → I don't have Microsoft Hololens2, therefor I am considering to use Windows Mixed Reality simulator (Mixed Reality Portal).
I can't get what mistakes I am doing, please if you have any idea help me.
Thanks in advance.
There are many steps to configure a Unity Project for Mixed Reality. According to the description, it is hard to determine which step causes the issue. I have created a repository which is implemented with the necessary MR packages, and the configuration has been done. Feel free to pull the repo from https://github.com/sethdu0525/MR-Blank-Project. Please open it and click run to test.
If you still have this issue, you may need to have a clean installation of Unity 2020.3.33f1 (LTS), Visual Studio 2022 and make sure all the required components have been installed, including a comparatively new Windows SDK.
If you have a dump file for the crash, you may also share it and find support from Unity forum -- General Discussion - Unity Forum
I'm running Unreal Engine v4.24 and trying to generate a VS project to develop in C++, but I don't have an option to create it.
I have my project launching and can play it on my Quest, but am stuck on this:
I know that I can't compille Native plugins to work with Android but I don't see why I can't create a project for this engine, any help will be appreaciated.
In order to force a generation you need to click on 'New C++ class' then you'll be able to access the source:
I need to run a Unity Script to generate asset bundles in a Linux/Ubuntu server. The Unity will be on that server but the assetbundles are built for UWP (BuildTarget.WSAPlayer) .
According to this thread it is not supported. But has things changed over time? Do you think newer versions of Unity will support it?
https://forum.unity.com/threads/assetbundles-linux-hololens-compatibility-issue.493271/
If it doesn't support UWP assetbundle building in Linux, that means I have no other way to create my assetbundles in a Linux/Ubuntu server and I have to go for a Windows server?
I'm trying to deploy a Unity test app to iOS to understand what we will need to provide to developers wishing to use our device. The device is custom hardware and shows up in Windows as a HID device over USB or BLE.
In the Windows builds the Unity script calls functions exposed in a C# DLL written targeting the "Unity 3.5 .net Subset Base Class Libraries" as required. The functions in that DLL make native calls to Windows functions like HidP_GetCaps, SleepEx, ReadFileEx, etc.
Clearly that C# DLL is very Windows specific.
The calls into the C# DLL are mainly subscribing to events. For example here's the Start method in my Unity script
void Start () {
DeviceManager.Instance.DeviceConnected += DeviceConnected;
DeviceManager.Instance.DeviceDisconnected += DeviceDisconnected;
DeviceManager.Instance.Initialize(Communication.AllSupported);
}
Unity prepares an Xcode project for me when I build this for iOS. What should I be making to replace the DLL so that Unity developers who want to write for our device can target iOS? Where do I replace the DLL calls to target this whatever-it-is?
I'm running into this basic issue while integrating the AppWarp Unity SDK (no version is specified, downloaded on 10 of March) with Unity 4.3.4 Android player.
The AppWarpVikingMobile sample fails with the same error.
"telnet appwarp.shephertz.com 12346" does connect to the server. Wireshark shows no packets (running with a filter "host appwarp.shephertz.com").
There is a similar issue asked here on February, but it is unresolved still.
Seems that it's SDK import/compatibility issue.
Any ideas?
When running in the player you have to use the AppWarpUnity.dll asset. Its only when building the apk to run on a physical device you need to build with AppWarpUnityMobile.dll asset (and NOT AppWarpUnity.dll) along with the native plugins provided.
It can be a bit confusing because Unity has different restrictions on different versions (Pro and Free) for different platforms with regards to plugins and sockets. AppWarp's goal is to give developers a way to use it with or without the Unity Pro on all platforms.
The interface exposed by the assets is the same so your application code need not change.