Pretending to have internet to an Android tablet

Hello,

I have a demo kit for a piece of network connected hardware*, the plan was to have the device, a travel router, and an Android tablet, then we can connect anywhere whether or not there is internet.

The router is awesome, everything works. However the Lenovo Android tablet is trying to be too clever. If router has internet it is fine, if it doesn't then the tablet keeps disconnecting to try to find a network with internet. I have specifically told it to not do this, it also only knows one network. (Yes, I am moaning to Lenovo support about this).

An idea: Can the router lie to the tablet and pretend to have internet?

This may sound like a stupid thing to do (but stupid problems sometimes have stupid solutions). I don't need the internet, I just need the Android network settings to think there is internet. I just have no idea how routers communicate to devices that they have internet, or how devices check for connectivity.

Any ideas or suggestions would be most welcome. Thank you!

*If anyone is interested it is an Open-Source microscope called the OpenFlexure Microscope

AFAIK, the OpenFlexure microscope detects a valid internet connection by sending an HTTP request to http://example.com and checking for a 200 OK response.

https://superuser.com/questions/277923/how-does-windows-know-whether-it-has-internet-access-or-if-a-wi-fi-connection-re

Basically it tests for a reply. Reroute the query to local resources on router.

Some tablets like Amazon are tricky so you'd have to Wireshark it.

Thanks @j0rn and @mortneff. So I need to find a way to interrupt and send beck a a local resource. The OpenFlexure Microscope is fine, we control that OS ourselves and it is happy. I see that Windows requests "http://www.msftncsi.com/ncsi.txt", do you know what URL an Android tablet is requesting, and whether it is manufacturer specific?

Take hosts file entry to send name to an IP. A tiny server could reply.
You'd have to know what address that tablet is testing. Wireshark should show

Looks up what wireshark is.

OK, I see what you mean now, and that you said it in your last reply! When I get a chance I'll have a go. Thanks!

1 Like

Is this a Windows tablet? Dohhh, you said android.

An idea.

"solved it by turning dhcp off and setting DNS to 0.0.0.0 forcing the network to not try connecting to the internet, "

1 Like

Android 14. Interestingly my phone which is also Android 14 is fine with staying connected. But the phone is Samsung, and the tablet is Lenovo. So it is Lenovo specific, and it is a bug because it ignores the "stay connected without internet" option I selected.

It seems to stay connected if I set a static IP not DHCP. I had tried this before and failed, but it didn't work. Turns out it didn't because I had typed in an IP on the wrong subnet due to fat fingers.

https://www.reddit.com/r/GooglePixel/comments/bs57yw/staying_connected_to_a_wifi_network_with_no/

Dns 0.0.0.0

1 Like

It seems to be staying connected if I am on static IP whether the DNS is set to 0.0.0.0 or to 8.8.8.8. So :crossed_fingers:.

8.8.8.8 is nicer because at least if I am in range of a network I can put the router into Repeater, and then show other things on the tablet during demos. Like cool interactive stitched microscope images

Normally an Android device will give a message like 'This WiFi does not have Internet Access, stay connected?" or similar when you first connect to a WiFi SSID wth no internet. There you can tell it to stay connected even though there's no Internet.

As mentioned above. It does have that option, but it ignores what I select which is the bug I am working around.