Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Easy WiFi Controller- Turn your mobile phone into a controller!

Discussion in 'Assets and Asset Store' started by greggtwep16, Mar 9, 2015.

  1. Maxpanra

    Maxpanra

    Joined:
    Aug 20, 2020
    Posts:
    1
    Maybe someone has asked this before, but is there a way that someone can explain me how to send a string (like player name) to the server? and also the other way around (like showing client's points or number of player), any help would be extremely useful
     
  2. btspRB

    btspRB

    Joined:
    Jan 28, 2020
    Posts:
    1
    I seem to be having problems with connecting devices that run Android 9 or 10. The server keeps throwing a "Specified cast is not valid" error after the device connects; and the android phone never gets a reply that it's connected.

    I have been wondering if the wifi permissions and/or information revision that happened in Android 9 and 10 have to do something with this.

    I have included the stacktrace below, and would greatly appreciate to find out what I'm doing wrong or what's going wrong in general. I have confirmed this on two separate devices; and even tried using plane mode, but none of that seems to prevent it from happening. I've also tried adding permissions, of which the location permission is the only one that shows itself; and it's activated but doesn't help either. Anyone got any clue as to what causes this?

    Code (CSharp):
    1. InvalidCastException: Specified cast is not valid.
    2. (wrapper castclass) System.Object.__castclass_with_cache(object,intptr,intptr)
    3. EasyWiFi.Core.EasyWiFiUtilities.checkForClient[T] (System.String control, System.Int32 player, T[]& controllerArray, System.Int32& arraySize) (at Assets/Libraries/Easy WiFi Controller/Scripts/Core/EasyWiFiUtilities.cs:141)
    4. EasyWiFi.ServerBackchannels.StringServerBackchannel.checkForNewConnections (System.Boolean isConnect, System.Int32 playerNumber) (at Assets/Libraries/Easy WiFi Controller/Scripts/ServerBackchannel/StringServerBackchannel.cs:65)
    5. EasyWiFi.Core.EasyWiFiController.forceConnectionRefresh () (at Assets/Libraries/Easy WiFi Controller/Scripts/Core/EasyWiFiController.cs:1062)
    6. EasyWiFi.Core.EasyWiFiUtilities.checkForClientTimeout (System.Single timeout) (at Assets/Libraries/Easy WiFi Controller/Scripts/Core/EasyWiFiUtilities.cs:118)
    7. EasyWiFiManager.checkForClientTimeout () (at Assets/Libraries/Easy WiFi Controller/Scripts/Core/EasyWiFiManager.cs:249)
    :
     
  3. Dimn721

    Dimn721

    Joined:
    Mar 30, 2017
    Posts:
    9
    I've been running into an issue affecting my players who have VMWare Virtual Network Adapters. It seems like the server is able to receive the initial broadcast from the clients, but once the clients set the IPEndpoint to that of the virtual network adapter's provided IP address the messages no longer reach the server.

    I've defaulted to telling my players to disabled or end their Virtual Network Adapter processes as a work around but would there be any solutions when dealing with these setups? It seems like this software is preinstalled on a lot of machines without the users being aware of it.

    Problem is replicatable by installing the trial: VMware Workstation Pro.
     
  4. Dimn721

    Dimn721

    Joined:
    Mar 30, 2017
    Posts:
    9
    Actually found the solution, I just had to check if the network interface was a virtual network, and ignore the ips coming from them.

    Code (CSharp):
    1. public static string GetIP()
    2.     {
    3.         string output = "";
    4.  
    5.         foreach (NetworkInterface item in NetworkInterface.GetAllNetworkInterfaces())
    6.         {
    7. #if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
    8.             NetworkInterfaceType _type1 = NetworkInterfaceType.Wireless80211;
    9.             NetworkInterfaceType _type2 = NetworkInterfaceType.Ethernet;
    10.  
    11.             if ((item.NetworkInterfaceType == _type1 || item.NetworkInterfaceType == _type2) && item.OperationalStatus == OperationalStatus.Up)
    12. #endif
    13.             {
    14.                 if (output.IsNullOrEmpty() && item.Description.IndexOf("virtual", System.StringComparison.CurrentCultureIgnoreCase) != -1)
    15.                     continue;
    16.                 foreach (UnicastIPAddressInformation ip in item.GetIPProperties().UnicastAddresses)
    17.                 {
    18.                     if (ip.Address.AddressFamily == AddressFamily.InterNetwork)
    19.                     {
    20.                         output = ip.Address.ToString();
    21.  
    22.                     }
    23.                 }
    24.             }
    25.         }
    26.         return output;
    27.     }
     
    Last edited: Oct 30, 2020
  5. lotusblood

    lotusblood

    Joined:
    Aug 14, 2019
    Posts:
    1
    Hi, I'm curious how you managed to resolve the IP difference. I am also having this same issue. The client broadcast is received but no data is transmitted.
     
  6. kreso

    kreso

    Joined:
    Sep 7, 2013
    Posts:
    133
    @lotusblood, The solution for me was to set a hostname for my Mac.
     
  7. Sapien_

    Sapien_

    Joined:
    Mar 5, 2018
    Posts:
    99
    Seems the Op hasn't replied for a while :(
     
  8. DammitJG

    DammitJG

    Joined:
    Aug 11, 2020
    Posts:
    2
    Hey guys, did any of you have any luck pausing a game and navigating through buttons with the dpad while the Timescale = 0?
    It seems to completely break the navigation for me.
     
  9. kamilo1206

    kamilo1206

    Joined:
    Jul 22, 2017
    Posts:
    1
    @greggtwep16

    I have a trivia game, this would be the server, and I used a dpad the one you have as an example UnityUINavigationClientScene to control and be able to select the correct answer, when I start the game and start the UnityUINavigationClientScene the selection works, then the new question appears and UnityUINavigationClientScene stops working, I really need your help, please I ask you, I don't know what else to do and I tried to do everything I could.

    I am attaching the trivia game in this link https://we.tl/t-jFXq5b3L2W
     
  10. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    382
    Is any here running unity 2020.3? There needs to be method changes due to API changes.
     
    Last edited: Mar 2, 2022
  11. DammitJG

    DammitJG

    Joined:
    Aug 11, 2020
    Posts:
    2
    Hi everyone! I'm developing a project using Easy Wifi Controller and until now it has been working wonders.

    However, I noticed that in most Samsung phones(n20, galaxy tab and others) the controller app client can't listen to the server's signal. Does anyone have any idea of what might be going on?
     
  12. chris0212

    chris0212

    Joined:
    Nov 3, 2021
    Posts:
    2
    Hi
    A client is using easy wifi controller. Now we need to get the status of the client with a third party application. We can listen to udp or tcp. how can we archive, that the server will send the status of the client to our app?

    Thx and greetings

    Christian
     
  13. chris0212

    chris0212

    Joined:
    Nov 3, 2021
    Posts:
    2
    I am a little step further
    When i send: Client_Broadcast (here is my IP address) the server will answer with a heartbeat. But nothing else on the Backchannel.
    Is there something i miss? Or is this something what our client has to implement in the unity scene?

    Thx and greetings

    Christian
     
  14. rodrigozol

    rodrigozol

    Joined:
    Apr 4, 2009
    Posts:
    29
    I can't make it run at Unity 2018.4.32! Is there any config to do? I've deployed the server(pc) and client(android) scenes, but nothing happens! Any clue is welcome
     
  15. rodrigozol

    rodrigozol

    Joined:
    Apr 4, 2009
    Posts:
    29
    I've turned off the firewall and works
     
  16. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    382
    I am wondering if this asset can be used to just read the client gyro and I get the data for my own use.
    Do I set up a client gameobject and server gameobject in the same hierarchy?
     
  17. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    382
  18. Alexander11qq

    Alexander11qq

    Joined:
    Jul 9, 2019
    Posts:
    2
    Some examples don't work (touch, accelerometr, drawing). But when I created a method for returning the points received to the controller, it works, that is, if the example with the accelerometer does not work, an example with the return of the points value works in the same scene, which is very strange. It looks like the server can't handle getting float and bool values. Even with simple examples, the connection between the server and the controller is cut off after about a minute or two after the applications are launched. This is very sad, if someone has hints of a solution to the problem, I will be glad. The firewall is disabled.