Local discovery not working on android 11

We apparently even had it at one point, though not anymore!

https://docs.syncthing.net/rest/system-discovery-post.html

But yes, the local discovery protocol is quite simple, an “external” implementation would be doable.

I’ve experimented with Wifi direct and java based doscovery some year ago. There is still a branch on the forks repo about that. Never finished but that could be partly used to discover other running Syncthing Android app instances and feed the IP to a new REST endpoint.

1 Like

We don’t even need to re-implement Syncthing’s discovery protocol if we just want to fix LAN transfer, which is what most people want.

This already works with global discovery if at least one device is able to determine its own LAN IPs. So if we can extend the interface IP discovery and tell it to the discovery server, the LAN transfer should work again.

If we want fully local discovery we would need to re-implement the protocol as @calmh pointed out. As this only uses broadcast/multicast we could bind the port with SO_REUSEPORT in Syncthing and allow the wrapper to use the same.

1 Like

What’s the actual problem? Does android now have multiple network adapters and we advertise the wrong one or something?

Android started restricting syscalls the go standard library uses to discover the interface. Apparently there are potential fixes: x/mobile: Calling net.InterfaceAddrs() fails on Android SDK 30 · Issue #40569 · golang/go · GitHub

I have a pair of A12 devices (one is now A13, but that’s irrelevant for this). One of them is a legacy device and the other is newer.

The legacy device can be locally discovered by my PC. But not the newer one. For that I need to manually enter its LAN IP address.

The only relevant difference between the two I can think of is MAC randomisation. The legacy device doesn’t have the hardware, so the feature is unavailable there. The newer one has it.

Otherwise, just being on A12 doesn’t explain why my legacy A12 device and PC can discover each other.

Can someone please provide a YouTube Tutorial so everyone whose need help can solve their problem, it would be more appropriate method to help someone.…Thanks in advance…

My version is 1.23.0. Does scanning the qr code also help when the devices are already paired?

Scanning the QR code is just an alternative method to inputting the device ID manually. It doesn’t do anything more than that.

Is global discovery enabled on both devices?

1 Like

I had to delete the previous reply because of the 3 replies per topic limit.

Global discovery is disabled. This issue/topic is about local discovery not working, so…

Here is a simple workaround that does not require any special configuring, or root.

Simply use the camera on each phone to scan the others QR code. That’s what I did and it worked.

The option to do that is in the Android Syncthing software.

You’re thinking of the wrong step.

Discovery is the process of fetching the IP address of a device you’ve already added.

Local discovery is limited to finding out your device’s LAN IP, so that another device on the same LAN can connect to it. This step doesn’t work, hence the topic.

Well global discovery is recommended because local discovery is known to not work on newer android versions due to restrictions from the platform. take it or leave it - the alternative is to configure IPs manually.

I’m aware of the current understanding of the issue. But I’ve described behaviour here that does not match what you say. Any ideas what’s going on?

If local discovery doesn’t work at all, the phone can’t find the IP address of the PC and vice versa. Global discovery avoids this by publishing the LAN IP of your PC which is enough to bootstrap a local connection :slight_smile:

Hmm,

I just disconnected and re-established the connection. I’m pretty sure both devices found each other using remote discovery. If Android local discovery is what’s broken, mine found each other using remote discovery.

I have 3 Android devices on the same LAN. Once the QR code was scanned, they managed to simply find each other. I don’t know whether it used local or remote discovery but I know that my Android devices were able to sync to each other immediately after scanning the QR code. I’m pretty sure they’re using my router ip and the 22000 port # Here is my config in pics.

You can easily test for that by leaving just Local Discovery on, and turning off every other method.

Nobody has any idea about this?