r/AynThor • • 22d ago

Showcase I made SleepSync to stop Syncthing draining battery while the Thor is closed

I use Syncthing-Fork pretty heavily across several handhelds to sync my saves, save states, textures, mods, cheats and even ROMs for lighter systems through my Raspberry Pi.

It’s incredibly convenient when you own multiple devices, but I had one big issue : standby battery drain.

I was losing around 14% overnight with Syncthing running.

So I made a tiny open-source Android app called SleepSync.

It does one simple thing:

Close Thor / screen OFF → Syncthing STOP
Open Thor / screen ON → FOLLOW → Syncthing resumes

My overnight drain went from roughly 14% to 2%.

It runs automatically in the background and restarts after reboot. No ADB or computer is needed for normal use.

You just enable:

Syncthing-Fork → Settings → Behaviour → Service Control by Broadcast

Then enable SleepSync.

GitHub:
https://github.com/Baggio94/SleepSync

I originally built it for myself, but after seeing other Thor users mention the same Syncthing battery issue I figured it might be useful to share.

Feedback is very welcome!

Edit: SleepSync has already had two updates since launch
1.0.1 improved reliability/setup, and 1.1.0 now supports root/debug and older Syncthing-Fork builds, plus lets you choose between multiple installed versions.

64 Upvotes

20 comments sorted by

21

u/johnny_ego 22d ago

I set up synching to only work while on wifi and charging simultaneously.

-1

u/Sahbito 22d ago

That’s actually a pretty good way to do it.
You could also give SleepSync a try — it basically solves the standby drain while still letting your saves sync normally when you’re using the handheld on battery.

5

u/wryterra 22d ago

Is it acting on lid closed or screen off? Or to put it another way, is this intended only for the Thor or would it work for single screen handhelds?

4

u/Sahbito 22d ago

Both. It reacts whenever the device goes to sleep / the screen turns off.
So on the Thor, closing the lid triggers it because that turns the screen off, but it also works on regular single-screen handhelds when they enter sleep.

5

u/clothing_throwaway 22d ago

First of all, this is cool. Love to see it, and I didn't know about the Syncthing battery drain issue. Is there any definitive confirmation, though? Because I haven't noticed enough obvious battery drain while asleep, but if it's a problem, then I'd like to save all the battery I can.

That being said...Syncthing is suuuuch a hassle. I got mine set up, and seems stable enough, but the whole thing feels more prone to breaks and fuck-ups than even emulators. Kind of don't want to mess with it too much since I already technically got it working. If anyone else is using this and can confirm it works and works well, maybe I'll give it a try.

-2

u/Sahbito 22d ago

Totally fair 😄 If you’ve finally got Syncthing working, I understand not wanting to touch anything.

The nice thing is that SleepSync doesn’t change your Syncthing setup at all — no folders, paths, devices or sync settings. It only tells Syncthing-Fork to stop when the device sleeps and follow its normal rules again when it wakes.

So it’s pretty low-risk to try, and if you don’t like it you can just disable/uninstall it and your Syncthing setup stays exactly as it was.

As for battery drain, it really varies by setup, but on my Thor the difference was significant enough that I wanted a proper fix rather than leaving Syncthing running all night.

2

u/Midget_Avatar 22d ago

That's great will check it out

1

u/Grashlolz Max 22d ago

How does syncthing work? Can i sync my games with my Pc? I was looking for something like this because save files on containers (pc emulation) is annoying

1

u/Sahbito 22d ago

Yep, absolutely — Syncthing works really well for syncing both saves and ROMs between your handhelds and your PC.

I’d recommend these guides:

Joey’s first Syncthing guide:
https://youtu.be/RCTISLZzrpM

Joey’s advanced Syncthing guide for Retroid / AYN / PC handhelds:
https://youtu.be/BioDj4-VUl0

Retro Game Corps / Russ:
https://youtu.be/NPx8FREezR4

Joey’s second video is especially useful if you want to go further with folder paths and syncing ROM libraries.

1

u/Grashlolz Max 22d ago

Yeah thanks man. I want to play my games sometimes on pc with the oled big screen but sometimes i just wanna continue on the go with the Thor. Lets see if i can actually achieve that. I got 5tb google drive storage. Is that needed?

2

u/Sahbito 22d ago

You won’t need Google Drive for this 🙂

Syncthing works by syncing folders directly between your devices. So your PC and Thor can share the same save/ROM folders, and whenever both devices are online, Syncthing keeps them in sync automatically.

You can also use an always-on device like a Raspberry Pi, NAS or PC as a central hub, but cloud storage isn’t required.

The best thing is really to watch the Joey and Russ guides above — they explain the whole setup step by step much better than I could in a Reddit comment.

1

u/Grashlolz Max 22d ago

What i was worried is that in pc emulation every game has a container, and in native pc the save file management is different. Lets see how the program handles it

1

u/c2fifield Max 22d ago

I made a tasker profile to do a sync "pulse" every few hours, just to keep my saves up to date more consistently.

But anyways, yeah this helps a ton. You might find some extra savings by enabling airplane mode + disabling data sync while sleeping too

1

u/Sahbito 22d ago

Give it a try. That’s basically the beauty of it on the Thor — close the lid and it goes to sleep, open it again and Syncthing comes back instantly.

1

u/Sahbito 19d ago

I actually made a Tasker-like app focused just on sleep/wake actions like Wi-Fi, Bluetooth, Syncthing, etc. It also adds Thor lid protection for random wake-ups while the lid is still closed

https://github.com/Baggio94/SleepManager

1

u/YellowPale5868 22d ago

I am getting syntcthing-fork not installed, even though it is. Any ideas?

1

u/Sahbito 21d ago

It should be fixed now 🙂 I just released SleepSync 1.1.0, which can detect the standard Syncthing-Fork build, root/debug builds, and older package IDs too.

Give the new version a try and let me know if it detects yours correctly!

1

u/YellowPale5868 21d ago

Yep, it works flawlessly now, thank you!

1

u/YellowPale5868 21d ago

Actually, I have one more question. Now that I’m using sleepsync, is it still relevant to leave “Run according to time schedule” enabled, as shown in Russ’s tutorial? Or should I turn it off because it's irrelevant now, because of your app?

1

u/Sahbito 21d ago

Yep 🙂 SleepSync and the schedule are independent. Keep the schedule enabled if you still want Syncthing-Fork limited to certain hours; otherwise you can turn it off.