Devices don't reconnect reliably over LAN after disconnecting

My setup:

  • NAT Traversal and Local Discovery are ON
  • Relaying and Global Discovery are OFF
  • Two devices, one android running syncthing-fork 1.22.1, and one windows running 1.22.1 connected to the same Wi-Fi, with static private IP for each device.
  • In the device address settings, I have set the device address for each device as <static IP of device>, dynamic.

Steps for Replication

  1. Connect both devices to the Wi-Fi Network
  2. Start syncthing on both devices
  3. They connect successfully and sync.
  4. Disconnect Device from the Wi-Fi network, or turn off syncthing in that device, in this case: my android phone, running latest version of syncthing-fork)
  5. Reconnect device to network/restart syncthing

Expected Result

The devices connect and sync the folders.

Actual Result

It shows Device Disconnected, with an i/o timeout error below the address.

Restarting syncthing on either end doesn’t always help, but it does work sometimes. What invariably fixes the problem is when I disconnect and reconnect my Windows Device to the wi-fi network.

I'm not sure which end the problem lies with, but it's inconvenient to disconnect and reconnect every time I step outside the range of the wi-fi network with the phone or have to close syncthing on the phone for battery preservation. Also there's this constant background job running in my mind to monitor if the syncthing connection is stil up, so any help would be greatly appreciated!

Miscellaneous: I made the private addresses static to add them to syncthing to make the initial connection faster, which seems to have worked, but it’s made no difference to the reconnection reliability.

Local discovery is broken in newer versions of Android, so disabling global discovery is strongly discouraged. In other words, having only local discovery enabled does absolutely nothing in this case.

Regardless of the above, you should still be able to connect almost immediately when using static IPs/hostnames though. Screenshots of the Syncthing Web GUI from both devices would be welcome. On Android, you can access the Web GUI using the left slide-out menu.

In accordance with Murphy’s Law, I can’t seem to replicate it now. I’ll post screenshots whenever it pops up next. :slight_smile:

Also, not sure if I worded it well, but connecting doesn’t seem to be the problem, they do connect very rapidly upon starting SyncThing, ever since I switched to static IP. It’s just that they don’t always reconnect after getting disconnected once.

Could you tell me which version of syncthing android has non-broken local discovery?

It’s not about Syncthing, it’s about Android. If I remember correctly, Android 10 and older should work fine. The only way to make local discovery work in Android 11 and newer is probably to run Syncthing as root (which I personally do).

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.