hersle / rmirro

A script that synchronizes PDFs of documents between a Remarkable and a computer folder that mirrors its file structure without cloud access
MIT License
84 stars 7 forks source link

Compatibility with reMarkable paper pro #11

Open gkemlin opened 1 month ago

gkemlin commented 1 month ago

Hi there.

This is not really an issue, but more of a feedback and hack to make the script compatible with reMarkable paper pro. I have been a user of rM1 since the beginning and, as I didn't want to use their cloud for various reasons, I really enjoyed this script that allows very easily to sync files between the computer and the tablet, so first let me say thank you for that.

I recently received the new reMarkable paper pro and of course, I was hoping the script to work as well in order to sync all my files from the rM1 without using the USB web interface nor the cloud. Here is my experience :

  1. Of course, one has to start by activating the Developer mode in order to allow for ssh connections. As it factory resets the table, you better do that before doing anything on it. The security issues are not that important, it's basically how rM1 and rM2 work at the moment, so if you don't have top secret document or business data on your tablet I don't see any reason not to activate developer mode.
  2. To recover the data from my rM1, I just scp the content from the backup folder remarkable_backup to /home/root/.local/share/remarkable/xochitl on the rMPP. Then you just need to restart the tablet and your previous document structure is there ! Your notebooks are still notebooks, just adapted to match the new size of the device.
  3. Once this is done, you might want to use the ./rmirro.py script as usual. This doesn't work out of the box because the script fails when testing if the SSH connection is a remarkable tablet. This is what is done here https://github.com/hersle/rmirro/blob/8f60012cb8728faa35a0b18e0b2088980adb6cf0/rmirro.py#L63 when checking if the output of uname -n is reMarkable. Actually, if you log in with ssh to the rMPP, you'll see that the output of uname -n is imx8mm-ferrari. Therefore, I just replaced the line above by
    if self.run("uname -n", exiterror=f"Could not connect to {self.ssh_name} with SSH").stdout != "imx8mm-ferrari\n":

    and then everything worked smoothly :smiley: Note that if you pull an old notebook that you modifed on the rmPP, the new pages will have a different size when PDFed.

Disclaimers:

  1. Note that I have only tested the default render_usb.py.
  2. I am not a dev or anything, I just wandered through the script and tried some stuff. I don't know if anything else need to be modified, it just appears to work flawlessly at the moment with this tiny change. I'll update the post if anything else happens.
hersle commented 1 month ago

Thank you very much for the helpful feedback! I haven't gotten my hands on the Paper Pro myself. I just pushed a small change to accept the SSH connection with the Paper Pro, too, thanks to your feedback.

hersle commented 1 month ago

Have you tested if both pushing and pulling files work with the Paper Pro?

gkemlin commented 1 month ago

Thanks for the push, I could pull and it works fine. Both pushing and pulling files work :)

gkemlin commented 1 month ago

There is just one thing I don't understand : when I delete a file on my rM, then the next time I sync it actually tries to push it again from my PC, instead of dropping it. I had the same behavior on my rM1, is this also what you get ? According to the table in the README.md file it should delete it on the PC too.

hersle commented 1 month ago

Thanks! That should not happen. Can you try it with a fresh file? I.e.

  1. Sync (so all existing files are up-to-date)
  2. Create a new file on RM
  3. Sync (should only pull the new file to PC)
  4. Delete the new file on RM
  5. Sync again (should only delete the new file on PC)

Run with rmirro.py --verbose and post the relevant output if something unexpected happens. Which PC operating system are you using?

gkemlin commented 1 month ago

Yup, I tried with a new notebook and it stills tries to push it (as a new pdf file though, not as a notebook). Here is the output when I try to sync it with rM after deleting on the table:

Read id = '47e2f893-4c71-4ace-903f-ef6a19e3139e' with metadata = {'createdTime': '1727626733945', 'lastModified':'1727626764706', 'lastOpened': '1727626734158', 'lastOpenedPage': 0, 'parent': 'trash', 'pinned': False, 'type': ' DocumentType', 'visibleName': 'Notebook'}

Compared to others, the deleted tag is not present, I don't know if it is linked to that.

Maybe 'parent'='trash' is the tag to look for ?

hersle commented 1 month ago

Do you also have the output from the command executed by the script? Does it say PUSH (newer on PC) or PUSH (added on PC) (with --verbose)? Which PC operating system are you on?

gkemlin commented 1 month ago

It says PUSH (added on PC). I'm running Linux, with Endeavour OS (arch-based distribution).

hersle commented 1 month ago

Thanks! I will try to take a closer look when I get time.