bordaigorl / remy

Remy, an online&offline manager for the reMarkable tablet
GNU General Public License v3.0
282 stars 13 forks source link

No templates.json file #6

Closed mefistoso closed 3 years ago

mefistoso commented 3 years ago

When I try to run python remygui.py wifi (wifi is rsync), I'm getting the following error complaining it doesn't find a templates.jsonfile:

File "/home/user/Downloads/software/remarkable/remy/remy/remarkable/filesource.py", line 372, in __init__
    with open(self._local("templates.json", branch=TEMPLDIR), 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '~/remarkable/rsync/templates/templates.json'

Not sure what this templates.json file is supposed to be or where to get one to adapt. FWIW my remy.json config file is at https://gist.github.com/mefistoso/c2b2ab081ecf1949a4af3fe3765a412b

bordaigorl commented 3 years ago

What's happening is that reMy should have downloaded that file for you from the tablet, but for some reason it's not finding it. Can you try with an absolute path in the data_dir setting?

bordaigorl commented 3 years ago

@mefistoso can you check if the new commit above solves the issue? Also, you may want to check if a directory named literally ~ was created in the directory from which you run remy: in that case it's safe to remove it.

mefistoso commented 3 years ago

@bordaigorl It now tries to connect, indeed, that's an advance. But I feel like the username option in my json config file is not being taken into account. I put a print(cmd) in the _bulk_download method from the LiveFileSourceRsync class and I get something like the following:

['rsync', '-vaz', '--prune-empty-dirs', '--delete', "192.168.0.9:'/usr/share/remarkable/templates/'", '/home/user/remarkable/rsync/templates']

Which can already show that there isn't a user being specified anywhere. Here is my json config file for that section:

"wifi": {
      "name": "reMarkable (RSync)",
      "type": "rsync",
      "data_dir": "~/remarkable/rsync",
      "address": "X.X.X.X",
      "host": "X.X.X.X",
      "key": "~/.ssh/id_rsa",
      "username": "root",
      "timeout": 3
    }

So the result is that it is using the wrong user in the remarkable when connecting. I already have it set up to use ssh-keys so it shouldn't even ask for a password.

bordaigorl commented 3 years ago

Ah yes username is ignored. Can you try by setting "host": "root@X.X.X.X"? (By using host you should also be able to control the user via appropriate ssh config file)

mefistoso commented 3 years ago

Ok, that's fine, doing it through a ssh config file makes sense.

Now, I'm not sure if I have to do some kind of manual copy before running the rsync, because now I'm getting FileNotFoundError: [Errno 2] No such file or directory: '/home/user/remarkable/rsync/templates/templates.json'. But I would've thought remy should do the first copy itself, right? I do have a templates.json at /usr/share/remarkable/templates/templates.json in the remarkable.

bordaigorl commented 3 years ago

ReMy should indeed download these files automatically 🤔 Can you try to change the data_dir to an empty directory so it starts the process over? Also [probably stupid question sorry, just making sure] have you installed rsync on the tablet?

bordaigorl commented 3 years ago

@mefistoso any progress?

jml1795 commented 3 years ago

@mefistoso I went down the same path as you. It appears rsync isn't installed by default (I must have overlooked the obvious). I scp'd over the rsync-arm binary from here and remy connected right away.

Thanks for the great tool and the help! Much appreciated.

mefistoso commented 3 years ago

Yeah, that was the issue. Sorry for the late response. I missed the rsync not found message. I would've thought this was included in the RM2. I'm considering this to be solved. Thanks for the feedback and help, keep up the great work.