bordaigorl / rmview

A live viewer for reMarkable written in PyQt5
GNU General Public License v3.0
755 stars 63 forks source link

Version 2.2 #63

Closed bordaigorl closed 3 years ago

bordaigorl commented 3 years ago

New features:

Blocking on:

idnovic commented 3 years ago

The ssh tunnel does not work for me. Try the following:

  1. enable ssh tunnel in rmview config
  2. connect tablet over usb
  3. ssh to your tablet over a separat terminal and not rmview and run $HOME/rM-vnc-server-standalone -listen localhost
  4. start rmview and let it connect
  5. connection is declined
    [INFO] Establishing connection to remote VNC server on 10.11.99.1:5900
    [WARNING] Disconnected: Connection was closed cleanly.
Please check your reMarkable is properly configured, see the documentation for instructions.

Connection failed: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionRefusedError'>: Connection was refused by other side: 61: Connection refused.
]

But if you create the ssh tunnel manually ssh -L 5900:127.0.0.1:5900 root@10.11.99.1 -N -v -v

You can connect with a vnc viewer.

So I think ssh tunnel is not created. Instead rmview tries to connect at the device ip address. Rmview needs to do proper port forwarding and the vnc connection should be the local machine instead to the remarkable.

bordaigorl commented 3 years ago

@idnovic I spotted a mistake (fixed in c7b5469) but I doubt that is the reason for your issue. Can you run rmview -v and produce the log? Have you reinstalled the package using pip install ".[tunnel]"? Tunnelling seems to be working fine for me... Would also help to know your OS and RM1/RM2+version.

idnovic commented 3 years ago
[INFO] STARTING: Fri Apr  9 14:53:57 2021
[INFO] Searching configuration in rmview.json, /Users/idnovic/Library/Preferences/rmview.json
[DEBUG] Configuration failure in rmview.json: [Errno 2] No such file or directory: 'rmview.json'
[INFO] Fetching configuration from /Users/idnovic/Library/Preferences/rmview.json
[DEBUG] Config values: {'ssh': {'address': '10.124.0.15', 'auth_method': 'password', 'username': 'root', 'password': '********'}, 'orientation': 'portrait', 'pen_size': 15, 'pen_color': 'red', 'pen_trail': 200, 'tunnel': True}
[INFO] Using known hosts file: /Users/idnovic/Library/Preferences/rmview_known_hosts
[INFO] Loaded known hosts from /Users/idnovic/Library/Preferences/rmview_known_hosts
[INFO] Connecting...
[INFO] Connected to 10.124.0.15
[DEBUG] Stopping connection worker
[INFO] Starting VNC server (command=$HOME/rM-vnc-server-standalone)
[INFO] Start command stdout output: 09/04/2021 12:54:06 Listening for VNC connections on TCP port 5900
[INFO] Establishing connection to remote VNC server on 10.124.0.15:5900
[WARNING] Disconnected: Connection was closed cleanly.
[DEBUG] Stopping framebuffer thread...
[INFO] Disconnecting from VNC server...
[INFO] Stopping VNC server...
[DEBUG] Framebuffer thread stopped
[INFO] QUITTING: Fri Apr  9 14:54:14 2021
[INFO] Establishing connection to remote VNC server on 10.124.0.15:5900
[WARNING] Disconnected: Connection was closed cleanly.

The connection is never established. Everything above is over wifi.

idnovic commented 3 years ago

yes I reinstalled the newest dev branch with tunnel support. I am using macOS 11.2.3 and testet with an reMarkable 2 with version 2.6.2.75. I am also using the newest version of reMarkable Tweaks

bordaigorl commented 3 years ago

@idnovic The tunnel setting needs to be part of the ssh section! Also, if you are on wifi, 10.124.0.15 is not the address you want to be using...

idnovic commented 3 years ago

@idnovic The tunnel setting needs to be part of the ssh section! Also, if you are on wifi, 10.124.0.15 is not the address you want to be using...

Thank you. It does work now. I had the configuration wrong.

Can you add a configuration checker? The syntax was correct but I had one option at the wrong location.

About the ip address. We have a large network. And it is part of the private ip address space.

stheid commented 3 years ago

a config checker would be a very interesting idea. i would be very interested in programming something like that i am just currently a bit out with the codebase...

Perhaps one could create a yaml based schema file that could be used to validate the config.

bordaigorl commented 3 years ago

I think the easiest and most useful feature missing for the config is a settings dialog... The UI would be easy to set up; the thing that may require refactoring is applying the changes to the config on the fly. PRs in this direction would be welcome. The first thing I would do is create an object encapsulating the config, maybe with signals to notify of changes.

stheid commented 3 years ago

yeah, a settings UI would be best, however thats clearly more involved. FYI: https://python-jsonschema.readthedocs.io/en/stable/

Kami commented 3 years ago

Yeah, something like json schema + additionalProperties: false would probably work fine.

In case we only want to support recent Python 3 version, we could also use something like pydantic (https://pydantic-docs.helpmanual.io/) which utilizes native type hints syntax.