Android Question Resolve the rigth ip

Ricardo Escalante

Member
Licensed User
Hello everyone:
I hope you are well and I want to ask you how to solve a problem that I have in a project that I am integrating.
On the one hand we have the ESP8266 circuit that provides an access point and a web server. The address of this web server is 192.168.4.1
The cell phone connects to the network generated by the ESP8266, without problem, but
When trying to make an http request:

Dim Job As HttpJob
Job.Initialize ("job", Me)
Job.Download2 (Starter.kerberosliteUrl & "/list", Array As String ("list", ""))
Log(Starter.kerberosliteUrl & "/list")
ProgressDialogShow2 ("Sending ...", False)

It does not find the server, we must necessarily close the cellular data connection to make it work.

Some idea to work with or without connection to cellular data.

Thank you very much for your attention and time
 
Last edited:

Didier9

Well-Known Member
Licensed User
Longtime User
What is the variable
B4X:
Starter.kerberosliteUrl
set to?

Can you upload your project?

Also, when posting code, use the code tags like as above, it will be appreciated :)
 
Upvote 0

Didier9

Well-Known Member
Licensed User
Longtime User
It is possible that even though the IP address is numeric the phone tries to resolve it via DNS and since DNS is only available through the cellular data connection, it will look there by default if it's available.

That would be an issue with the phone or the Android version. A lot of people, me included, have successfully downloaded stuff from an ESP8266 configured as a web server and a SoftAP router (using the phone's browser), even though in my case I do not use httpdjob in the app (I use a direct socket connection).

Have you tried to get the document using the phone's browser?

What kind of phone is it and what Android version?
 
Upvote 0

Ricardo Escalante

Member
Licensed User
Hi Didier9:
Yes, using the phone's browser, is the same thing!
By the way the phone is an old Moto Android v4.1.2
Also and tried with a newer Moto G5Plus Android v7.0
With the same results.

Tnks a lot
 
Upvote 0

Didier9

Well-Known Member
Licensed User
Longtime User
Hi Didier9:
Yes, using the phone's browser, is the same thing!
By the way the phone is an old Moto Android v4.1.2
Also and tried with a newer Moto G5Plus Android v7.0
With the same results.

Tnks a lot

If it's the same thing with the phone's browser, the problem is not with the app. It's either with the phone or the way the ESP8266 is configured.

Since I have half a dozen Motorola phones here that I use regularly (like right at this instant) to fetch data off a WiFi module configured as SoftAP while the cellular connection is up, I guess it's most likely that the problem is with the ESP8266.

Looks like it's refusing the connection so the phone tries the next best thing available to it.

Focus on making the ESP8266 work with the browser first, then get the app working.
 
Upvote 0

Ricardo Escalante

Member
Licensed User
It's correct, I think it's not the app's problem but the way the phone resolves that ip address.

I appreciate your attention and time, I will continue looking for the solution and if I find it, share it with all of you.

regards
 
Upvote 0
Top