Autosync on WiFi-on/waking-up/manual - how to?

Hi! I’d want to force and android device to sync with a peer(s) online on WiFi turning on and on waking device up (or manually). Is it possible?

The motivation is: say a peer (workstation) device has changes. I take Android device, turn it on (that is wake it up) and then I’d want to get those changes. I don’t understand what is the way autosync is going.

Now, after few minutes of waiting (syncthing is set to run in background), to force a sync I kill the service and start it again. I’m sure there is more appropriate way :smile:

Android 4.4.2 is in use with android-syncthing from the Play Store (0.7.5 at the moment).

Android device WiFi is set to Never on sleeping. Web GUI mostly isn’t accessible after waking up (but it is accessible just after syncthing restart).

Did you enable the “sync only on wifi” or “sync only while charging” options? If not, Syncthing should always be running, and trying to connect to other devices.

In device WiFi setting, as I have already mentioned, I have set Never for sleep mode. Probably, it conflicts with the fact “only on WiFi” wasn’t set for Syncthing. Now I have set this checkbox and will see the result.

Thanks for the hint!

The setting in the app means that Syncthing will be disabled when it’s not connected to wifi (so not what you want). As I said, if you have both of these settings unchecked in the app, it should run all the time.

You could check the logs for any potential problems.

Sorry, I have lost the track :slight_smile: Let’s take a use case when WiFi router is available. At the case setting device advance WiFi option for sleep mode to Never results in syncing active/sleeping state with WiFi on/off state.

My humble guess is, this setting (“Never”) conflicts with attempts of Syncthing to sync, and it is the reason of syncing and GUI problems I have had.

Setting Syncthing “only on WiFi” checkbox to checked eliminates attempts to sync with disabled WiFi. First tests are promising, probably it is that I want - when the checkbox is set.

A device(your workstation) will know that something on it has changed in two cases - if it has scanned the folder (after scan interval has passed) and found them or if that folder has “inotify” enabled (OS will inform syncthing that something happened to that folder and syncthing will rescan to get the changes). Then syncthing broadcasts that it has changes and if your phone has syncthing running it will try to sync those changes. So if you don’t have “sync only on wifi” selected syncthing should be always running and sync changes as they happen. But if it is selected syncthing will be stopped when no WiFi connection is present and then when WiFi connects it will start and sync all changes that happened in the mean time. If you have WiFi option for sleep mode set to Never when the device wakes up the wifi will reconnect, syncthing will start and sync the changes. If it is set to “Allways” WiFi will not stop and syncthing will sync even if phone is in sleep mode.

1 Like

Thanks, all you have wrote correlates with my vision.