Closed all-iver closed 1 year ago
FYI, this also happens with the example "basic" and "pong" projects, so it seems unlikely to be a configuration issue?
Did a little more testing today - seems like stopping and restarting the server in settings is helping? It's still being pretty flaky though. OnConnect() just doesn't reliably get called even though the console says "Connections are ready," and the phone doesn't reliably get all the way to controller.html. I'm not sure how to troubleshoot further.
You need to be in the same WiFi with all devices for it to work, but since you mention you've tried different wifi connections, I assume that doesn't solve your problem?
Have a look at these suggestions/similar issues and let us know if any of that helps: http://stackoverflow.com/questions/37380981/airconsole-on-phone-not-working-for-dev
http://stackoverflow.com/questions/34890806/airconsole-phone-controller-screen-not-loading
I gave it another shot today. Everything is on the same wifi network. Occasionally it will work but usually not. When I browse manually to 192.168.x.x:etc/controller.html on the phone the page shows up fine. I tried remote debugging the phone's web browser and eventually it came up with a "Could not connect to server" message, but nothing more informative than that.
I had the same problem, apparently when launching from unity it grabs my vpn ip. Disabling my vpn fixed this for me. Took me a while to figure out, make sure that the IP in the airconsole.com url is correct :)
AirConsole now offers a detailed workaround guide for anyone experiencing this problem: https://developers.airconsole.com/#!/guides/unity-ngrok
Noticed the issue even with the pong example.
https://www.airconsole.com/simulator/#debug:http://games.airconsole.com/pong/
Can't connect any device. The ngrok workaround doesn't help.
Thank you for bringing this to our attention @Doctor-Script
We will look at it its root and how to best address it.
Little update. I haven't solved it for pong, but found a workaround for my project.
When I try to connect to ngrok generated URL first time from a new browser I get a warning "You should only visit this website if you trust whoever sent the link to you." and need to press the "Visit Site" to load the actual page.
So I requested the controller.html page directly (f.e. ba73w2f-asd-a2312.ngrok.app/controller.html
) from my device, pressed "Visit Site", and after that ngrok started to send the controller page to my device thru the airconsole.com
.
Note that it happens after restarting ngrok too. It generates a new address, counts your device as new, and shows the warning again. Thus requires you to press the "Visit Site" button again from the same device.
Hope it will help someone)
An improvement for the Unity Plugin is underway successfully. This improvement will allow you to configure your ngrok custom domain as local IP which in combination with the modes Normal
and Debug
allows the to connect to the game running in Unity without additional steps.
The required improvements are implemented through a new feature that will be released as part of v2.14 tomorrow
Version v2.14 is now released which should address the issue with the new Local IP Override
functionality. Let me know if your specific setup faces problems due to it.
There is updated documentation for it under https://developers.airconsole.com/#!/guides/unity-external-access
Not sure if that was documented before but: the free ngrok shows a user consent page the first time a user tries to access the external url with a new device. Due to this it can not work with the AirConsole Controller as we don't show the html page. The paid ngrok or the cloudflare tunnel do not have the problem.
When I try to test my game using a real device, AirConsole is really flaky trying to connect. Sometimes it connects, but most of the time this happens:
Like I said, sometimes it works, but rarely. When I use "virtual controllers" it always seems to work. I've tried with two iPhones. With one of them, "leave session" also doesn't work - it just sort of flashes the screen and returns to "Loading...".
My Start() looks like this:
and OnConnect() looks like this:
I've tried deleting/reinstalling the phone app, using the latest unitypackage from github, using the version on the asset store, switching wifi connections, being on the same wifi connection as the webserver, versions of Unity from 5.3.3 to 5.3.5 to 5.4.0, delaying my calls to adding the OnConnect() handler, etc. Is there something I'm doing wrong with the setup? What needs to happen to get past that "Loading..." screen and show the actual controller.html page? Why would it work sometimes and when using the virtual controllers, but usually not work with a real device? Thanks for any help.