Using android as a Syncthing server

I have a few devices and retired one Android phone to be a SYNCTHING server. I have installed Syncthing Fork (latest v.). Connected my other devices to it and successfully synced folders.

Now the problem is that my Syncthing android server doesn’t seem to be always online. Every time I checked my other devices syncthing app. It takes like 3 to 5 minutes to get connected and find my Synchting server. And I think it doesn’t sync when the devices are in rest.

My Syncthing server is connected to a fixed home wifi. My phone is always plugged and charged. (Phone is locked and screen is off.)

I don’t know if it is the Syncthing server android went offline or the setting makes finding the connection difficult. How do I make it better? I want my server phone always online and are ALWAYS connected to my devices.

Since a Syncthing device initiates connections and also receives connections, it’s technically both a client and a server, and even more so since it’s a single executable for both functions. :nerd_face:

Power management…

Most phones have aggressive power management features, so to keep your Android phone awake all of the time you’ll need to dig into the settings and disable as much of it as possible.

Tools such as DontKillMyApp might also be helpful on phones that use a heavily modified Android.

Wi-Fi…

  • Configure your router to assign a fixed DHCP lease to your Android phone and also set the lease time to the maximum length allowed. Without a static IP address, your other devices will have to potentially find it again on the network if/when the IP address changes.
  • It’s not usual for Wi-Fi access points to time out idle connections.

There are a bunch of other things that can be done, but the ones above are a good start.

1 Like

Is your aim to have a mobile server ? Through cellular networks ? Because telephony service providers sometime (always?) assign private IPs to the phones and as you can’t manage ports in their routers your server would be very alone. Have it on wifi behind your isp router with static IP and port forward… but it can’t travel (or maybe with some dyndns in the phone, but listen port would remain a problem). A Raspberry would rise less questions.

PS : I’m not aware of arm/aarch64 builds for server… ooops, my bad, I thought you wanted a discovery or relay server. Why do you use the word SERVER ? Do you you want it central in your topology, some core/NAS data repo ? For your issue, did you have a look at Settings/Run conditions ? (Not in WEB GUI)

1 Like

I have set all power management setting to allow app both system-wise and app-wise.

I will try your DHCP solution first and if it doesn’t work I think I can try a static ip. (I remembered that my ISP also provide static ip for free).

Thank you so much. Once I tried these things out, will report here for everyone’s reference.

Not a mobile server. I guess I just have a retired phone, and don’t want to do a raspberry pi server. I really only have needs for Synching (and maybe wallabag and some cloud storages). Kinda feel like these needs would fit in a plugged android phone. (?) My phone is connected to wifi only. No sim inside the phone. This phone is to be put at home and powered all time.

btw, I did do a quick research on syncthing for raspberry pi. I recalled the setting appears to be a bit complicated? (like some people can’t get working on raspberry and were asking for help on reddit etc and asked for docker compose file). If you do have a rather clear setup process on Raspberry, it would be great to archive that in my wallabag for later use. ^ ^

and Thank you so much for helping!

If you want to be 100% sure that the phone will not enter any type of standby, then there is a setting in the Developer Options to keep the screen always on when plugged in. If you enable it, the screen will dim once left unused, but will not turn off, which will prevent Android from entering Doze mode.

I had a raspi for a friend with raspbian and seamless standard ST setup as long as you add the syncthing deb repository. I just (re)moved the sdcard or moved /boot to the boot usb ssd drive. No fear to overwear these shitty little sdcards with logs.

Just a last thing : select the catfriend’s syncthing-fork Android ST release from F-Droid because it is planned that the official one won’t be supported anymore :

Welcome to ST and good luck man.

BTW, I missed the announce (post closed now), so I send my many thanks to @calmh & @imsodin for the job done and also @Catfriend1 for going on.

3 Likes

Yeah, all of those with complicated setups on a RPi were most often new to Linux, new to Docker, and also new to Syncthing – a relatively steep learning curve tackling all three simultaneously.

Some tips for your wallabag:

  • Skip Docker – at least at the beginning – and go bare-metal for a much simpler setup.
  • Install Raspberry Pi OS Lite – if you don’t absolutely require a desktop environment, the range of RPi models that can be successfully paired with Syncthing is a lot better.
  • Install the stock Syncthing package from the Raspberry Pi OS repo, or the latest release from Syncthing’s official APT repo https://apt.syncthing.net/.
  • For external storage, avoid formatting volumes as NTFS unless there’s a very good reason to. Use ext4 or exFAT with most RPi models, but if it’s a more powerful model such as RPi 4 or 5 and you’re syncing a lot of small files and/or would like additional data integrity features, consider using btrfs.
  • And for detailed step-by-step instructions: Synchronizing Files on your Raspberry Pi with Syncthinghttps://pimylifeup.com/raspberry-pi-syncthing
1 Like

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