Android Question Multiple WIFI routers with same name but different address ranges

DickD

Active Member
Licensed User
I am converting my Bluetooth app to wifi. It works just fine to transfer data and images on my home network with only one router. After finding the address my phone was assigned by DHCP (Server.GetMyWifiIP) I ping each ip address in the same subnet, .2 to .254, to see if it is running my app.

Recently I had lunch at a large chain restaurant and found a single wifi network "Restaurant free wifi" but the 3 phones I brought with me each got an ip address in a different subnet range, for example 10.21.84.5, 10.76.22.60 and 10.33.29.22. The three side-by-side phones could not use my app since they weren't on the same router or in the same subnet.

Is there any way to detect this in software and use it for communications between nearby phones?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
After finding the address my phone was assigned by DHCP (Server.GetMyWifiIP) I ping each ip address in the same subnet, .2 to .254, to see if it is running my app.
It is better to implement auto discovery with UDP: https://www.b4x.com/android/forum/threads/mqtt-chat-with-auto-discovery.75713/#content

Could you connect the phones to each other if you knew the ip addresses?
If the devices are connected to the internet then you can use an online broker such as Adafruit IO to communicate between them.
 
Upvote 0

DickD

Active Member
Licensed User
It is better to implement auto discovery with UDP: https://www.b4x.com/android/forum/threads/mqtt-chat-with-auto-discovery.75713/#content

Could you connect the phones to each other if you knew the ip addresses?
If the devices are connected to the internet then you can use an online broker such as Adafruit IO to communicate between them.
The point of my app is to connect users in the same area: a restaurant, a gym, a classroom etc. I have been reading up on UDP. Would the example you sent let me do that and do it in the environment I stated previously where a restaurant is running multiple routers with multiple ip address ranges?

Yes, my app works when the ip address is known. But in the restaurant example I gave the wifi connection said "No Internet access". I don't know why a venue would give you wifi access but no internet access. That doesn't make sense and would preclude using Adafruit I guess.
 
Upvote 0

udg

Expert
Licensed User
Longtime User
This should be an interesting reading.
How to turn that info in a solution to your initial request is unfortunately out of my available time these days and, probabily, my overall knowledge too.
 
Upvote 0
Top