Hi, I use Syncthing to backup certain files on my Android phone to Windows laptop. I have SyncTrazor on Windows & Syncthing by Felix Ableitner on Android. I noticed that Syncthing uses the internet & syncs using mobile data on my phone to my internet connected laptop. But what I want it to do is that, whenever I connect my phone to my laptop via hotspot with mobile data On(So that I can use internet on my laptop), Syncthing uses the hotspot connection only to transfer files to my laptop instead of mobile data that would cost me money. Selecting ‘Sync only on WiFi’ on my Android phone completely blocks Syncthing from running when mobile data is On. I want it to detect if hotspot is On & send data only using that link. Is this possible or can this be added as a feature? Thanks.
Yeah, it’d be a very useful improvement
I tried doing so while traveling abroad to download stuff from the phone to the laptop, using phone’s hotspot as a “local network”.
Unfortunately you are correct, hotspot is not recognized as wifi from phone’s point of view. I tried to enable ST for all networks on phone, and leaving only local discovery on, unfortunately it didn’t work either.
Idk if that’s phone’s fault (i.e. not assigning local ip to self when “hotspotting”) or something else’e…
What you can do - is use another phone with hotspot, connect to it both your phone and a laptop, disable global discovery on both to avoid data charges, and it’ll sync.
Update: After some searching, I found out that turning off global discovery on BOTH my Windows & Android device makes Syncthing sync only via local WiFi, which is what I want. My problem is solved. Thanks.
Edit: @scienmind, read your post after posting this. No additional phone is required. Disabling global discovery on both my devices prevents Syncthing from using my data plan & sync directly via local WiFi. 
It would be pretty simple to have “run on wifi” also trigger if you open a hotspot. But I’m not sure how/if we can prevent Syncthing from connecting over mobile data in that case (and disabling global discovery seems like a bad hack).
Anyway, feel free to open an issue on Github.
If this “local WiFi” is hotspot, it doesn’t work for me for some reason…
Good point…
Maybe make it a separate option, a sub-option to “Sync only on WiFi”, if enabled, let user check “Sync when running Portable WiFi Hotspot”, dimmed and disabled otherwise. (still ugly, but somewhat safer…)
Or, even better would be:
if it is possible to detect in SW that the phone runs WiFi Hotspot AND “Sync only on WiFi” is enabled, disable global discovery automatically, and let ST run.
Hi! 9 years later and I still have this issue.
Your idea would be perfect: On Hotspot only connect to devices with the IP range of the Hotspot-subnet! I then don’t care much if global discovery is on or off - as the discovery alone is cheap. (Issue in practice: Then the connected laptop will try to push the changes to the WAN-connected device over the phone Hotspot.)
My basic request is simpler tbh: I would love a “Sync via Hotspot” Button, that just enables Syncthing the way “Sync on Mobile Data” would (with a warning that it also syncs to remote deviecs). I for myself can afford to take the risk to rarely sync files over Hotspot.
That being said, that is my personal situation. In other areas of the world, mobile data might be way more expensive - so we should maybe also look for solutions to allow for a temporary island-solution - even though the device would theoretically have global connectivity. So a question for me is:
If my phone is connected to mobile data and provides a Hotspot to other devices also running Syncthing: How to prevent big amounts of sync-data going over the mobile network without permission? (Maybe this should become its own thread)
My ideas:
- If there is a metered connection, only sync to local IPs (an advanced version of pause on metered wifi on linux and Metered Connections - #9 by OndroNR ) - no idea if this is already implemented.
- Urge users to classify the connected connections properly!
- (I also thought about some Magisk-Module that blocks Syncthing packets from the Hotspot to WAN, but that might be out of scope for 99% of the Users.)
Best, Thomas