Auto connect android

Hello. I’m currently using Syncthing to have my phones password manager match my PC’s, and it works great for that. The only problem is I have to manually connect them. I’m sure that’s intended behavior, but I was hoping that when they were on the same internet connection they could automatically connect and sync in the background. Is this possible?

Have you changed any default settings by any chance? Normally, the devices should connect with each other automatically.

What do you mean exactly by “manually connect” though? Do you mean hard-coding the IP addresses and such?

I think I changed one or two, but only what was shown in tutorials for setting it up. I don’t remember what but nothing too deep. And I mean I will have to open the syncthing app on my phone, even if it’s get that notification kept up to be running in the background. Both the PC and that notification just say it is disconnected.

Do you mean that Syncthing runs only when the app is opened? This may be caused by the OS preventing it from running in background, e.g. in order to “save battery”. Android manufacturers are well known for this behaviour (see https://dontkillmyapp.com).

There are also multiple run conditions in the Syncthing app itself, including “start on boot”, which you probably want to enable.

It could be that, since I’ve got a Xiaomi. I do have battery saving stuff turned off and start on boot enabled, but I remember doing some setting to do with the notification that helps stop it closing it so I’ll try that.

Ah, opening the notification specifically says current wifi SSID is not whitelisted. That would probably do it. Now to figure out how to change that.

Ah, yup, it only had permission for location when in use. Works now. Still not sure why it needs that and would prefer it didn’t, but it’s open source so I can’t be too worried about it. Thanks Tomas!

That’s an Android limitation. Location needs to be turned on for apps to be able to view the current Wi-Fi (which does actually make sense).

But it’s already connected to the same wifi connection. Can it not identify it as just another device on the network?

The thing is, if the app asks “which Wi-Fi am I connected to”, the answer may reveal some kind of hint about the device’s location. So if you want it to run on select networks and not on others, Android requires the user to grant it permission to that information. The fact that some other device is on the same network is irrelevant, because we’re talking about even starting the app’s background process or not. When not running, it cannot check for other devices on the same network.

2 Likes

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