Ignorance installing on Android

(ETA that I cannot get Syncthing running on a new phone, although I have it working on my old phone. AudriusButkevicius says I typed too much with no question. So: tl;dr: what is the proper procedure for installing Syncthing on Android?)

I am finally replacing my old OnePlus 3T with a new Note 10+, and having the devil of a time installing Syncthing and Syncthing-fork. I have the same problems with both.

  • The install wants to use the DCIM dir and calls it “Camera …” something. I delete that and create a new folder called “Default Folder” and named in the file system as “Sync”. Both are at /Storage/emulated/0/. I do not have an SD card in the phone.

  • I begin the initialization by changing the device name, allowing operation with mobile data, and a few other option changes.

  • I create the new Sync / Default Folder with no devices.

  • I edit the default folder to add a computer device using the camera. It doesn’t get the name, so I enter that manually, then enable “Default Folder”. Several times the two Linux laptops (but never the Mac laptop) have popped up a request on the browser (which is running the Syncthing web page) to add “Default Folder” from the Note 10+, and I have learned the hard way that if I click Yes, the Note 10+ ends up with two “Deafult Folder” folders, with just the one Sync dir, but it has a duplicate “.stfolder (1)” dir, so now I just click “Ignore”.

I have two Linux laptops and one ancient Mac all connected, plus the old OnePlus 3T phone. They all know about the Note 10+. It knows about all them. The Note 10+ says all are up to date. All laptops and the old phone say the Note 10+ is “Syncing (0%, 5.12 GiB)” and they’ve been like that for an hour or more. I’ve tried de-installing Syncthing on the Note 10+, re-installing, reconfiguring from scratch, and I cannot get the phone to actually transfer any files. The three laptops and the old phone update with each other fine.

Everything looks fine …e xcept no file transfers to the Note 10+. Like it’s paused, but the “Pause Folder” toggle is off and greyed out. The four devices also have a greyed out “Pause Device” toggle. None are introducers.

The Note 10+ “DEVICES” tab aperiodically switches the four devices between “Disconnected” and “Up to Date”, and they seem to change their status of the Note 10+ accordingly, between “Syncing (0%, 5.12 Gib)” and “Disconnect”. These statuses don’t change very often.

ETA that I just saw one of the laptops change status from “Disconnected” to “Up to Date” / “Syncing (0%, 5.12 GiB)”.

I gave up on that trial installation; the laptops kept getting requests to create a new “Default Folder”, and when I agreed, got new “.stfolder (1)” folders, and the Devices tab on the Note 10+ showed multiple “Default Folder” entries for each device.

I also found that .stfolder had a file named “DO_NOT_DELETE.txt” whose contents are a single line “DO_NOT_DELETE”. This doesn’t appear in any other Syncthing node, so I’m guessing it’s some kind of initialization file which ought to disappear pretty soon. The fact that it hangs around ought to be some good clue.

Anyway, I got tired of the constant requests to add known devices again, so I shut it down, deleted the app, deleted the “Default Folder”, and deleted the Note 10+ from all the laptops and the other phone. Reinstalled Syncthing-fork, reconfigured it with the proper device name (“N10+”), and this time created Sync/.stfolder and Sync/.stignore as they are everywhere else, and then added just one of the laptops. No real change other than no more redundant and repetitive requests to add Default Folder. But no syncing either, and .stfolder has that “DO_NOT_DELETE.txt” file again.

Bummer - downloaded the source, and grep found no instance of “DO_NOT_DELETE”, other then two comments with “do not delete” in syncthing-1.6.1/lib/model/folder_sendrecv.go.

Do you have an actual question? It seems like there is a lot of text but at least to me it doesn’t seem like there are any questions.

The “DO_NOT_DELETE” is added by the Android App, as some Android OEMs implement stupid functions like “delete all empty folders every now and then”.

3 Likes

Yes, AudriusButkevicius! Why is nothing actually transferring? What is the proper procedure for installing Syncthing on Android? I obviously did it for the old phone, and it’s working. I cannot get the new phone to actually sync anything.

If you have an existing folder you would like to sync with a new device (your new android installation): Share that existing folder on an existing device with the new device. You will get a prompt to add it on the new device, do that and you are done. If you setup a new folder, essentially do the same. Make sure folder IDs match.

Thanks, imsodin. I hate being so ignorant. Could you please add more detail? I just added the old phone and the new phone to each other as new devices: showed the QR id on one, clicked the “+” sign on the Devices tab on the other, clicked the camera icon, typed in the name, clicked “Default Folder”, clicked the check mark. Did this both ways. They both show each other as Disconnected. The old phone is syncing with one of the laptops right now, the others show “Up to Date”. The new phone just sits there, showing Disconnected with the old phone and the same laptop (I haven’t connected it to any other computers). Neither phone’s notifications show any request to connect.

They won’t sync if they are not connected. Perhaps some sort of mobile firewall is getting in the way? Or corporate network?

You should check via web ui what sort of addresses they are discovering for each other if you expand the disconnected device.

Also, check what discovery status is showing, to make sure it managed to registered with discovery servers.

1 Like

The new phone says about the laptop’s tcp address “i/o timeout (07:10:48)” with the time increasing; and the quic address shows “dial: NO_ERROR: Handshake did not complete in time”. For the old phone connection, it shows just “dynamic”, no errors, nothing. Last seen “never”. Tried pausing and resuming for lack of anything better to try, no change.

The old phone shows all three laptops on the same IP address and port, and shows the new phone as “never seen”.

The new phone shows the one laptop as on an entirely different IP net, not even the first octet is the same. Perhaps this is because I had followed a suggestion somewhere and disabled the three Syncthing Options of Enable NAT Traversal, Global Discovery, and Enable Relaying, leaving only Local Discovery checked.

The old phone has the SIM card and is running off mobile data. The new phone and all three laptops are running off the same WiFi access point.

Why did you disable all the things that are required for devices to connect?

1 Like

Well now! I just re-enabled those three options, and the new phone suddenly told me the old phone was requesting to be a new device. I clicked the Default Folder box, clicked Yes, and the new phone showed two devices for the old phone. The previous old phone device entry showed Disconnected, the new old phone device entry showed Syncing, and it actually had transferred a few files.

Then it asked again for the old phone, I followed the same procedure, and both old phone device entries went Disconnected and the transfers stopped.

I disabled those three options, leaving Local Discovery, because some documentation somewhere suggested that if operating only over WiFi, no mobile data, and the new phone doe snot yet have a SIM card.

Local discovery requires the network to be configured to allow it, which is not always the case. There is stuff like AP isolation etc, generic prevention of multicast etc.

The fact you have two entries for a single device implies you’re probably used two different apps. I suggest you pick an app and start from scratch, and don’t tweak default settings unless you’re 100% sure what you are doing.

1 Like

I have been using Syncthing-fork only on both phones and the laptops. I have de-installed the app a dozen times, deleted the existing /storage/emulated/0/Sync folder, and re-installed and re-initialized every time. I do change the default directory, because it is …/DCIM; I delete that folder and create a new one, same except for being …/Sync. I will try again now, leaving it named …/DCIM.

What do you mean “and laptops”? Are the laptops android as well so that you’re using android-fork there?

The folder ids need to match on both sides if you are adding them manually.

Here’s what I did this time, same as always, except I usually delete the “Android Camera” …/DCIM folder and add my own “Default Folder” …/Sync folder, which I create empty with a file manager.

Install Syncthing-fork. Open it. Allow storage permission, stop battery optimization, allow location permission all the time. Change settings: Run on mobile data and roaming. Set expert mode and dark theme. Set autostart. Change device name to N10+. Check Anonymous usage reporting.

(Usually here I delete the existing “Android Camera” …/DCIM folder and add a replacement …/Sync. But not this time.)

Show ID on the old phone. Edit the “Android Camera” folder and add device on the new phone, setting only the name and clicking “Android Camera”. When that finished, I still have to click 1+3T under Devices in the Android Camera folder to enable it.

The …/DCIM dir on the new phone has created the …/DCIM/.stfolder. The old phone’s …/Sync dir shows none of the new phones’s …/DCIM contents. The new phone’s …/DCIM dir shows none of the old phone’s …/Sync contents. The new phone shows the old phone as Up to Date; the old phone shows the new phone as Disconnected.

Sorry, no, the laptops are not running Syncthing-fork; I meant they are all running 1.6.1. Two are Linux laptops, one is an ancient Mac.

By “folder ids need to match on both sides”, what is the folder id? It has the name “Default Folder” or “Android Camera”, and the directory names of /storage/emulated/0/DCIM or …/Sync. The laptops and old phone use Default Folder / Sync, which is why I was deleting the Android Camera / DCIM folder and adding Default Folder / Sync.

What is 1+3T?

Have you checked the folder ids match? To me is sounds you are trying completely separate folders with different ids…

I think its best if you start posting screenshots as your explanations are hard to follow.