- Home /
Unity Wi-FI Direct support?
I am working on a new open source project called Navi (everything is on this github repo). In short, it is a system that transfers the sensor data via a local router to your PC for use cases in virtual reality. The system works well when connected to a local router. However, in cases where there is no available router, I still want to be able to connect two devices. As a quick hack, I am able to turn on mobile hotspot using an Android device and use that as the router. However, after doing some testing with it in crowded areas, I realized that the connection tends to break up fairly easily (my guess is the noise interferes with the signal). That made me think that I should support other types of connections such as Wi-Fi direct or bluetooth. I have looked at the AllJoyN framework, but it seems that they have discontinued Unity support (they have support in older releases for Android and Windows, but that is not ideal). To start with, I would really like to add a simple multi-platform Wi-Fi direct connection using Unity. However, I am not sure if this is supported with the given UNET API and was wondering if people have suggestions for frameworks that can be used to make this work with Unity.
EDIT: I got a response on the Unity forums that suggest I would have to write a platform specific plugin for each supported platform. Obviously this is not ideal, and in fact if this was the case, I would use the older AllJoyN release. Does anyone see pros/cons to either solution? Alternatively, I am open to other suggestions to improve performance of the connection.
Answer by saltyJeff · Dec 01, 2016 at 01:10 AM
Shameless self promotion:
https://github.com/saltyJeff/UnityWifiDirect (applies only to Android)
Hey Salty Jeff. Thanks for the comment. I'm working on an android application using wifi direct. I just cloned the repo and I'm trying to get something running in Unity. I was wondering if you had any demo code for a Unity Scene that is using Wifi Direct? Thanks!
legerity here's a quick demo I dumped together (it's pretty ugly)
Thanks so much for the added git repo! I'll take a look at this today
Hey Jeff, don't know if you or anyone else has had success with streams of data over p2p? I'm interested in low framerate low image quality sending receiving video as well as strea$$anonymous$$g other data types. Also, wifiDirect is a little fickle and frequently looses connection. I would like to be able to reconnect to a device and avoid the android message "accept request from peer to connect". Any Advice on this as well? Thanks!
Answer by lrb · Sep 19, 2015 at 03:28 AM
Hi VMohan, great job! I'm trying to do the same thing! First at all, I believe that is necessary to make a wrapper for Windows using native code like here: https://msdn.microsoft.com/pt-br/library/windows/apps/windows.devices.wifidirect.wifidirectdevice.aspx
After that, I believe that is necessary to make a plugin fo Android using native code like here: http://developer.android.com/guide/topics/connectivity/wifip2p.html
I find anything else at this moment! Look for updates. Regards, Lennon.
Thanks for posting this here! As I made mentioned in the EDIT, it seems like it might make more sense to use the older releases of AllJoyN in that case (4.12 I think), since they have already been tested and integrated with Unity. Even though they will not get support in the future, we at least know it worked at one point.
I also came across this project on the web. http://www.opposablevr.com/projects/onetouchconnect/
I am e-mailed them to ask what support they actually provide and am still waiting on a response, so I guess we will have to wait and see if they actually do provide Wi-Fi direct or Bluetooth. I will keep people posted.
Answer by rahgozar · Jun 01, 2016 at 01:38 PM
this plugin make connection over wifi on android phones. you can connect to pc too. https://www.assetstore.unity3d.com/en/#!/content/57537
Your answer
Follow this Question
Related Questions
Target = NetworkedMe 1 Answer
When using photon sometimes it fails to find local game object. 0 Answers
Identifying local player issue 0 Answers