Make SyncThing sync only via hotspot when mobile data is On

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. :slight_smile:

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.