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

Unable to play off local server without internet connection #566

Open
Jab2870 opened this issue Feb 9, 2023 · 20 comments
Open

Unable to play off local server without internet connection #566

Jab2870 opened this issue Feb 9, 2023 · 20 comments
Labels
bug Something isn't working

Comments

@Jab2870
Copy link

Jab2870 commented Feb 9, 2023

I have various wall mounted tablets and similar devices dotted around my house that are on my local network, but do not have wider internet access. The ABS server is accessible to them. However, I am unable to connect to it as the Android app checks for internet connectivity before logging into the serve.

Could the app attempt to connect to the specified ABS server, rather than the generic connectivitycheck.gstatic.com?

@advplyr
Copy link
Owner

advplyr commented Feb 9, 2023

I don't know what you mean. I don't think there are generic connectivity checks. When you put in your server address there is a ping request sent to your server. If it responds then you can login.

@Jab2870
Copy link
Author

Jab2870 commented Feb 9, 2023

No. On the login form, the login button is replaced by a "No Internet" button that I can't push.

@advplyr
Copy link
Owner

advplyr commented Feb 9, 2023

Oh. Maybe a bug then I will see

@Jab2870
Copy link
Author

Jab2870 commented Feb 9, 2023

image
Here you go. This should demonstrate the issue

@Jab2870
Copy link
Author

Jab2870 commented Feb 9, 2023

If I click "Add new server", I get the "No internet" button

@Jab2870
Copy link
Author

Jab2870 commented Feb 9, 2023

So, to add a little bit more to this. I have set up my local DNS server to point connectivitycheck.gstatic.com to a web server on my local network. The ABS app now works as expected, so I think I can say confidently that somewhere, a request to that domain is being made to verify connectivity.

@advplyr
Copy link
Owner

advplyr commented Feb 9, 2023

Must be yeah, we are using a capacitor plugin for the frontend network connectivity check.
We'll probably need to replace that plugin and setup something native.

@advplyr advplyr added the bug Something isn't working label Feb 10, 2023
@yuuzhan
Copy link

yuuzhan commented Feb 11, 2023

I know that this has happened for me with other apps. @Jab2870 are you able to remove the local DNS entry so it stops working again, then turn off your Data connection on your phone (while connected to wifi still) and try to have the app connect?

Some apps try to be "smart" and it senses that there is no internet on the wifi so it switches to a Data connection (which when you are trying to do local connections is a dumb thing to do).

@Jab2870
Copy link
Author

Jab2870 commented Feb 11, 2023

So, the device I was using has no sim card so there is no way that it was doing anything other than wifi @yuuzhan

@advplyr
Copy link
Owner

advplyr commented Feb 12, 2023

I took a look at the plugin and it just using the regular Android Connectivity Manager api to check for connection. This will need to be investigated further by seeing what info the connectivity manager is returning in this instance.

@Jab2870
Copy link
Author

Jab2870 commented Feb 14, 2023

Strange...

Please let me know if there is anything else I can do to assist with this then.

@C3POH2SO4
Copy link

Hi there,

had the same Problem...

Made a Blocking group in my Pi-Hole wich blocks all DNS Querrys with a "." in it. -> Everything to Internet is Blocked.
Then made a Whitelist with some entry's like "(.|^)antolin.de$".

App won't show login due Android "Online" checks !

So what i did on my side was following:

  • Disabled WiFi on my Android Tab
  • Opened Live Query's on Pi-hole (on second device) and set a filter for affected device to see blocked query's.
  • Enabled Wifi and checked logs.

In my case (FireHD10) the DNS query for online check is "tabletcaptiveportal.com" -> After whitelisting that, the app login works again. ;-)

@GuyverFX
Copy link

So is there a Fix for this? Do I need to put in DNS entries to resolve back to my server just to get this to work?
I only have this issue when my internet is down and honestly cant see why you would ever do a external dns call to validate connectivity.

@GuyverFX
Copy link

I read another article in this chain (see below) and disabling a phones internal process to bypass a application dependency is not a solution but a workaround. Dont get me wrong, thanks for the information but any workaround could have other unintended impacts due to that change being in the android OS. The application is making that check dependent for itself before functioning.

Trick is to bypass this check by running the following command in ADB shell of the your Android device which is either not connected to the internet or Google's DNS is blocked at firewall level:

settings put global captive_portal_mode 0

@hobesman
Copy link

hobesman commented Dec 2, 2023

It seems like one solution would be for the app instead of disabling the sign in button, just say "You don't appear to be online. Attempt connection anyway?" And let the user override it.

@xarath
Copy link

xarath commented Feb 2, 2024

I had the same problem and I can confirm that @GuyverFX 's workaround is working for me.

Here are the steps I used:

  1. Enable developper options
  2. Enable USB debugging
  3. Connect phone to PC and run adb shell in PC's terminal
  4. In adb shell: settings put global captive_portal_mode 0
  5. Restart phone

App version: v0.9.71-beta

@stratus-ss
Copy link
Sponsor

This work around doesn't really scale. Or at least it's kind of a pain and it may get reset in the future.

I have a couple of tablets that I use ABS with and they all experience this problem. I might use the ADB route but it is not ideal

@Jab2870
Copy link
Author

Jab2870 commented Feb 29, 2024

@stratus-ss

I mentioned a much more scalable solution earlier that I use. I have set up my local DNS server to point connectivitycheck.gstatic.com to a web server on my local network which solves the problem.

The relevant part of my nginx config is:

server {
    listen       80;
    listen  [::]:80;

    server_name          connectivitycheck.gstatic.com;

    location / {
            return 204;
    }
}

@stratus-ss
Copy link
Sponsor

That's an interesting solution. I could even use a vhost on the server ABS is running on. If apache is down on the ABS server, ABS isnt going to work anyways.

Thanks for the tip!

@skyzuma
Copy link

skyzuma commented Apr 5, 2024

0.9.73-beta ... no internet, no login on local IP ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants