syncthing-android icon indicating copy to clipboard operation
syncthing-android copied to clipboard

Not synching over phone's WiFi hotspot

Open 360fun opened this issue 4 years ago • 9 comments

I have a similar (not solved) issue: https://forum.syncthing.net/t/make-pc-sync-with-phone-via-phones-wifi-hotspot/13560/8

problematic scenario:

  • phone with WiFi hotspot on (with new photos ready to be synced)
  • laptop connected to phone's WiFi (with shared phone's camera folder)
  • sync should work over WiFi but it doesn't 😢

other scenario:

  • phone A with hotspot on (no syncthing installed, acting as a simple router)

  • phone B connected to phone A (with new photos ready to be synced)

  • laptop connected to phone A WiFi (with shared phone's camera folder)

  • sync between B and laptop works (new photos appear on the laptop)

    App Version: 1.12.1 Android Syncthing Version: v1.13.0-1 Mac Android Version: Lineage 17.1 Android 10

After digging around I found this is a very common problem: https://github.com/syncthing/syncthing-android/issues/641 https://github.com/syncthing/syncthing-android/issues/1034

SOLUTION IS If you use your mobile as WiFi hotspot/router and also have Syncthing installed: Turn on "Run on mobile data"

In addition if you want to turn Internet off but keep WiFi sync on: Turn also on "Run when device is in flight mode"

PERSONAL FEEDBACK I love Syncthing but if you think people intuitively understand that "WiFi Hotspot" means "Mobile network" you're very wrong: this is a UI/UX problem more than a bug.

SUGGESTION Please add at least an explanation like:

Run on mobile data or WiFi hotspot

So people can understand your logic...but honestly I would make the app able to differentiate between LAN and mobile sync: local IP are very different so technically should be possible to avoid data consumption. In the current way I don't have the option to use the hotspot but be sure that the sync is over the local network, which IMO is pretty bad.

360fun avatar Feb 03 '21 17:02 360fun

I think there is already an existing issue for this.

Have you checked them?

AudriusButkevicius avatar Feb 03 '21 17:02 AudriusButkevicius

All the relevant issues that I found are already quoted, my point is that the current UI/UX could be improved to make more clear when Syncthing is using a LAN or an Internet connection to sync data. :)

A very common risky situation is having free WiFi at home but using phone's hotspot outside: what happens if you forget the hotspot on? The laptop connects to home's WiFi but the phone uses it's Internet connection to sync consuming data.

That's why other people suggested to include the hotspot inside the "Wifi" option and I agree, that's what I expected honestly.

360fun avatar Feb 03 '21 19:02 360fun

If I understand correctly you want to do "local" sync only over the network interface of the hotspot, while mobile data is still enabled. That may be possible, but difficult and won't happen unless someone steps up to implement it.

Another thing is that syncthing-android already can sync over a hotspot with mobile data disabled, but you need to check the "flight mode" option. That's indeed a bit obscure and the help text doesn't really help. Changing that is simpler - feel free to suggest something or file a PR.

imsodin avatar Feb 03 '21 20:02 imsodin

If I understand correctly you want to do "local" sync only over the network interface of the hotspot, while mobile data is still enabled. That may be possible, but difficult and won't happen unless someone steps up to implement it.

Another thing is that syncthing-android already can sync over a hotspot with mobile data disabled, but you need to check the "flight mode" option. That's indeed a bit obscure and the help text doesn't really help. Changing that is simpler - feel free to suggest something or file a PR.

In my first post I suggested something similar, that could be a short term solution, waiting for a function that splits local from Internet sync. Please read under "SUGGESTION". :)

360fun avatar Feb 03 '21 20:02 360fun

I don't think this is physically possible, as I don't think we have any control at this. The routing is done by the operating system.

AudriusButkevicius avatar Feb 03 '21 20:02 AudriusButkevicius

I don't think this is physically possible, as I don't think we have any control at this. The routing is done by the operating system.

So improving the UI/UX seems the only way. 🤔

I've another suggestion: the app seems detecting when the sync is not working and suggests to change options, but is not really clear which one!

I believe should be easy to implement this pseudo-code:

if "sync not working" && "hotspot on" { print "Do you want to turn on Run on mobile data?" print "YES - NO"

if "Run on mobile data on" && "mobile data off" { print "Do you want to turn on Run when device is in flight mode?" print "YES - NO" }

}

This should also work with the app in background, maybe sending a notification to push the user to check what's wrong.

360fun avatar Feb 04 '21 12:02 360fun

I don't think this is physically possible, as I don't think we have any control at this. The routing is done by the operating system.

Indeed. I can't find the ticket right now but I remember a conversation with @Catfriend1 where he said this is not possible because Syncthing doesn't get notified about the hotspot being enabled/disabled.

codethief avatar Nov 25 '21 17:11 codethief

I think I have a useful suggestion. But first, here's my use case:

I only have my phone's mobile data available to access internet. So I enable wifi hotspot on the phone and connect my laptop to it to surf the web etc. As my PC and my phone are on the same local network, I would like syncthing to directly sync over this local network without using up any mobile data. I have been able to get this to work but only when the option "Run on mobile data" is allowed. To be clear, this doesn't use the internet (mobile data) and uses the direct local connection. Clearly, mobile data has nothing to do with what I'm trying to achieve here. So why do I have to enable this "Run on mobile data" option to be able to do what I'm doing?

This seems like an unnecessary and unrelated check that I had to enable just to get my use case working. Not to mention I still don't want Syncthing to use my mobile data ever, yet I have to keep it enabled because of my use case.

Just letting people use the app even when its not connected to wifi or mobile data will solve this problem as I believe the app can just detect other nearby devices on its local network running Syncthing. Is there an actual reason why the app doesn't want to start when no run conditions are met? It's obvious that no internet will be used if both the wifi and mobile data has been denied, so why not just allow sync if its able to detect the other device (via wifi hotspot in this case)?

sarutabiko avatar Jan 17 '22 05:01 sarutabiko

@sarutabiko I don't have an answer for you but I just found my aforementioned conversation with @Catfriend1 which might be of interest to you: https://github.com/Catfriend1/syncthing-android/issues/394#issuecomment-526954754

codethief avatar Jan 17 '22 08:01 codethief

Any updates on this? I would love to see this implemented for battery saving purposes.

UtkarshVerma avatar Dec 31 '23 01:12 UtkarshVerma

No changes on a ticket mean there are no updates, please don't write +1 comments: https://github.com/syncthing/syncthing/wiki/NoPlusOne

Also closing this ticket as a feature request, see https://github.com/syncthing/syncthing-android#no-feature-request-taken-feature-contributions-case-by-case

imsodin avatar Dec 31 '23 08:12 imsodin