Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to connect to /192.168.4.1 (port 80) from /[EXTERNAL IP] (port X) after 5000ms #64

Open
szekelyisz opened this issue Jun 22, 2022 · 2 comments

Comments

@szekelyisz
Copy link

I'm trying to provision with SoftAP, letting this library establish the WiFi connection as well (using device.connectWiFiDevice(name, password). Most of the time I'm getting the above error. Rarely it succeeds, and device.scanNetworks(...) also works, but the provisioning always fails with this error.

The problem most probably is that it tries to reach the SoftAP endpoint from the external address as suggested by the error message.

Any ideas how to force it to connect from the WiFi interface?

@KhushbuShah25
Copy link
Contributor

Hi @szekelyisz ,

As per description, app is able to connect with device and also able to display scanned networks.

After sending Wi-Fi credential to device, do you see any error in phone app or on device console ?

@szekelyisz
Copy link
Author

Hi @khushbushah2302 thanks for your help!

It seems like when I use the default method connectWiFiDevice() after manually connecting to the wifi network, it seems to work (for a minute or so).

However, if I use connectWiFiDevice(name, password), it fails with the above error all the time. It looks like if connectivityManager.bindProcessToNetwork(network); didn't do its job, and the library tries to connect to the device through the cellular interface. Any ideas why this would happen?

I'm in API level 28 (P), so no WifiNetworkSpecifier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants