Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
5e05cd7
Don't resize at autoresize if fullscreen
bordaigorl Jan 29, 2021
6145d3e
Forwarding key/pointer events
bordaigorl Jan 31, 2021
74de306
Better handling of disconnection
bordaigorl Feb 1, 2021
c38c44d
Handle key input emulation via shortcuts
bordaigorl Feb 1, 2021
12e456c
Refactor actions and shortcuts
bordaigorl Feb 1, 2021
254d5f5
Proper handling of reactor thread
bordaigorl Feb 3, 2021
3811abd
New auto orientation option
bordaigorl Jan 20, 2021
1327759
More principled detection of orientation
bordaigorl Feb 1, 2021
85e42d6
Properly saving and merging known_hosts
bordaigorl Mar 1, 2021
5cb7288
Render hint flags
bordaigorl Mar 1, 2021
01165fe
Show pen delay
bordaigorl Mar 1, 2021
939d1b0
Remove frame around QGraphicsView
bordaigorl Mar 4, 2021
88d998b
Don't log raw password to the console.
Kami Mar 13, 2021
311c8b8
Add support for specifing password for password protected key file in
Kami Mar 13, 2021
4b5041b
Allow app to be stopped gracefully using CTRL+C when QT app main loop is
Kami Mar 13, 2021
3b3dcec
Use larger default timeout.
Kami Mar 13, 2021
c26efcd
Update some log statements, add a comment on slow host loading.
Kami Mar 13, 2021
ba98c0e
Add support for using an SSH tunnel.
Kami Mar 14, 2021
64d14ba
Display connecting screen until we successfully connect.
Kami Mar 14, 2021
9db8efe
Move loading of the system known hosts files from constructor to the
Kami Mar 14, 2021
b5db56f
Fix typo.
Kami Mar 14, 2021
825be6a
Prefix log messages with a timestamp and level.
Kami Mar 14, 2021
4302325
Improve logging.
Kami Mar 14, 2021
9174139
Enable SSH tunnel compression since it seems to result in slightly
Kami Mar 14, 2021
3a84027
Update comment.
Kami Mar 14, 2021
0f796e2
Use custom made connecting image to avoid potential copyright /
Kami Mar 14, 2021
ea5a0cd
Update readme.
Kami Mar 14, 2021
e9c2dfa
Merge branch 'devel' of https://github.com/bordaigorl/rmview into var…
Kami Mar 17, 2021
9776b60
Log a warning message if config file is readable by others.
Kami Mar 17, 2021
5001b6f
Fix merge conflict resolution.
Kami Mar 17, 2021
805129b
Don't try to start a new vnc instance if one is already started and
Kami Mar 17, 2021
103c5dc
Fix formatting.
Kami Mar 17, 2021
19dce13
Refactor functionality into multiple utility methods, don't stop VNC
Kami Mar 17, 2021
16aee52
Bug in handling SSH keys
bordaigorl Mar 25, 2021
be9a20a
Rationalising logging
bordaigorl Mar 25, 2021
d46f9b1
Only log sanitised config if verbose
bordaigorl Mar 25, 2021
235d0ac
FB Worker: better handling of exceptions, properly stopping client, n…
bordaigorl Mar 25, 2021
b872a37
Bugfix: stop tunnel even if VNC was already running
bordaigorl Mar 25, 2021
455398f
Make `sshtunnel` optional
bordaigorl Mar 25, 2021
b471450
Document verbosity options
bordaigorl Mar 25, 2021
e624adf
Right click should not trigger pointer event
bordaigorl Mar 25, 2021
1856e1c
Bump version
bordaigorl Mar 25, 2021
dac5b0b
Minor
bordaigorl Mar 25, 2021
50137db
Make sure cloned frames do not share buffers with live ones (see #61)
bordaigorl Apr 8, 2021
bd34b5c
Merge pull request #54 from Kami/various_changes
bordaigorl Apr 8, 2021
c7b5469
Bugfix: failing to detect running instance because of truncated ps ou…
bordaigorl Apr 8, 2021
f05a37a
Tunnel compression disabled by default (performance seems better with…
bordaigorl Apr 8, 2021
853f25a
Move key loading to init of connection worker
bordaigorl Apr 16, 2021
34a3d92
Minor cleanup
bordaigorl Apr 27, 2021
314e822
Wrong field name known_hosts
bordaigorl Apr 29, 2021
6cc9432
Add dockerfile and run script
larsblumberg May 5, 2021
178c806
Disable forward_mouse_events by default, add docs
bordaigorl May 5, 2021
1133189
Correcting warning message (fixes #73)
bordaigorl May 7, 2021
f2fd104
Pinch to Zoom
bordaigorl May 18, 2021
462d7de
do not garbage collect cloned frames and create them with the correct…
vale981 May 26, 2021
bc7882f
Garbage collect cloned frames on close
bordaigorl Jun 1, 2021
1cc4ddb
Merge pull request #79 from vale981/devel
bordaigorl Jun 1, 2021
096e372
Merge pull request #71 from larsblumberg/add-dockerfile
bordaigorl Jun 1, 2021
4772073
Line length in setup.cfg (prepare for linting)
bordaigorl Jul 12, 2021
5e70df8
Refactoring: move pen tracker out of workers
bordaigorl Sep 6, 2021
02f5947
Detect tablet/software version on connection
bordaigorl Sep 9, 2021
bfd9a98
Software version timestamps
bordaigorl Sep 9, 2021
1198a21
Make RFB client compatible with ScreenShare (thanks to @ddvk #87)
bordaigorl Sep 9, 2021
68456c3
Add compatibility with ScreenShare (fixes #86, #87)
bordaigorl Sep 9, 2021
23f56fe
Some docs
bordaigorl Sep 9, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM python:3.9-slim-buster
RUN apt-get update
RUN apt-get install -y \
libdbus-1-3 \
libfontconfig \
libgl1-mesa-glx \
libglib2.0-0 \
libxcb-icccm4 \
libxcb-image0 \
libxkbcommon-x11-0
RUN apt-get clean
WORKDIR /rmview
COPY resources.qrc setup.cfg setup.py ./
COPY assets ./assets
COPY bin ./bin
COPY src ./src
RUN pip install --upgrade pip
# TODO: setup.py could to be fixed to include install_requires
# see also: https://stackoverflow.com/q/21915469/543875
RUN pip install pyqt5==5.14.2 paramiko twisted
RUN pip install .[tunnel]
RUN pip cache purge
CMD rmview
69 changes: 61 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
* Demo [:rocket: here][demo]
* Fast streaming of the screen of your reMarkable to a window in your computer
* Support for reMarkable 1 and 2
* Works with software version pre 2.7
* Compatible with ScreenShare (post 2.9)
* UI for zooming, panning, rotating
* Pen tracking: a pointer follows the position of the pen when hovering on the reMarkable
* Clone a frame into separate window for reference
* Save screenshots as PNG

> :warning: **For reMarkable 2 users** :warning::
> rMview should work out of the box with the stock firmware.
> If you use [`rm2fb`](https://github.com/ddvk/remarkable2-framebuffer) there are known compatibilities issues that are [being addressed](https://github.com/pl-semiotics/rM-vnc-server/issues/5).
> :warning: **Update 2.9+ users** :warning::
> To use rmview with the ScreenShare feature you have to **first** start the ScreenShare from the tablet, and then start rmview.



Expand All @@ -42,6 +43,9 @@ The easiest installation method is by using `pip`, from the root folder of this

(please note the command ends with a dot)
which will install all required dependencies and install a new `rmview` command.
If you want to use the SSH tunnel feature, install with

pip install ".[tunnel]"

Then, from anywhere, you can execute `rmview` from the command line.
The tool will ask for the connection parameters and then ask permission to install the VNC server on the tablet.
Expand All @@ -55,6 +59,7 @@ Install the dependencies ([PyQt5][pyqt5], [Paramiko][paramiko], [Twisted][twiste

# install dependencies
pip install pyqt5 paramiko twisted
pip install sshtunnel # optional
# build resources file
pyrcc5 -o src/rmview/resources.py resources.qrc

Expand All @@ -68,6 +73,12 @@ On the reMarkable itself you need to install [rM-vnc-server][vnc] by copying the

Then you can run the program with `python -m rmview`.

### Using Docker

This project contains a `Dockerfile` so that `rmview` and all its dependencies can be installed and run inside a Docker container.
Since `rmview` not only reads your local configuration but also needs an X11 display, you should run `docker-run.sh` which takes care of the host mappings.
Please note that `docker-run.sh` is written for Unix-like OSes and expects your rmview configuration inside your local `$HOME/.config/rmview/` folder.

## Usage and configuration

**Suggested first use:**
Expand All @@ -78,9 +89,10 @@ the default configuration file which you can edit according to the documentation

More generally, you can invoke the program with

rmview [config]
rmview [-v|-q] [config]

the optional `config` parameter is the filename of a json configuration file.
The optional `-v` flag makes the console output verbose, `-q` makes it quiet (only errors).
The optional `config` parameter is the filename of a json configuration file.
If the parameter is not found, the program will look for a `rmview.json` file in the current directory, or, if not found, for the path stored in the environment variable `RMVIEW_CONF`.
If none are found, or if the configuration is underspecified, the tool is going to prompt for address/password.

Expand All @@ -93,13 +105,25 @@ All the settings are optional.
| Setting key | Values | Default |
| ------------------------ | ------------------------------------------------------- | ------------- |
| `ssh` | Connection parameters (see below) | `{}` |
| `backend` | `"auto"`, `"screenshare"`, `"vncserver"` | `"auto"` |
| `orientation` | `"landscape"`, `"portrait"`, `"auto"` | `"landscape"` |
| `pen_size` | diameter of pointer in px | `15` |
| `pen_color` | color of pointer and trail | `"red"` |
| `pen_trail` | persistence of trail in ms | `200` |
| `background_color` | color of window | `"white"` |
| `hide_pen_on_press` | if true, the pointer is hidden while writing | `true` |
| `show_pen_on_lift` | if true, the pointer is shown when lifting the pen | `true` |
| `forward_mouse_events` | Send mouse events to tablet (see below) | `false` |

**PLEASE NOTE:**
When `backend` is `auto`, if the tablet is using version 2.9 and above then `screenshare` is used;
otherwise `vncserver` is selected.
Note that currently `screenshare` is only compatible with version 2.9 and above,
and `vncserver` with version 2.6 and below.

If `forward_mouse_events` is enabled, clicks and mouse drags on the main window
will be sent to the tablet as touch events,
mouse drags while pressing <kbd>CTRL</kbd> will be sent as pen events, allowing drawing.


Connection parameters are provided as a dictionary with the following keys (all optional):
Expand All @@ -113,6 +137,8 @@ Connection parameters are provided as a dictionary with the following keys (all
| `key` | Local path to key for ssh | not needed if password provided |
| `timeout` | Connection timeout in seconds | default: 1 |
| `host_key_policy` | `"ask"`, `"ignore_new"`, `"ignore_all"`, `"auto_add"` | default: `"ask"` (description below) |
| `tunnel` | True to connect to VNC server over a local SSH tunnel | default: `false` (description below) |
| `tunnel_compression` | True to enable compression for SSH tunnel | default: `false` (description below) |

The `address` parameter can be either:
- a single string, in which case the address is used for connection
Expand All @@ -121,6 +147,7 @@ The `address` parameter can be either:
To establish a connection with the tablet, you can use any of the following:
- Leave `auth_method`, `password` and `key` unspecified: this will ask for a password
- Specify `"auth_method": "key"` to use a SSH key. In case an SSH key hasn't already been associated with the tablet, you can provide its path with the `key` setting.
If key is password protected, you can specify key passphrase using `password` parameter.
- Provide a `password` in settings

If `auth_method` is `password` but no password is specified, then the tool will ask for the password on connection.
Expand All @@ -141,19 +168,45 @@ The old `"insecure_auto_add_host": true` parameter is deprecated and equivalent
In case your `~/.ssh/known_hosts` file contains the relevant key associations, rMview should pick them up.
If you use the "Add/Update" feature when prompted by rMview (for example after a tablet update) then `~/.ssh/known_hosts` will be ignored from then on.


:warning: **Key format error:**
If you get an error when connect using a key, but the key seems ok when connecting manually with ssh, you probably need to convert the key to the PEM format (or re-generate it using the `-m PEM` option of `ssh-keygen`). See [here](https://github.com/paramiko/paramiko/issues/340#issuecomment-492448662) for details.

NOTE: If you have a lot of known hosts in system known hosts file (`~/.ssh/known_hosts`), you are advised to add
known host entry for remarkable to `~/.config/rmview_known_hosts` because paramiko can be very slow when loading
large known hosts file which slows down the whole connection routine.

If your user system known hosts file already contains entry for remarkable, you can add it to rmview specific
hosts file using this command:

```bash
cat ~/.ssh/known_hosts | grep 10.11.99.1 >> ~/.config/rmview_known_hosts
```

You should of course replace IP with your remarkable IP.

### Note on security and using an SSH tunnel

By default, this program will start VNC server on remarkable which listens on all the interfaces and doesn't expose
any authentication mechanism or uses encryption.

This program will then connect to the VNC server over the IP specified in the config.

Not using any authentication and exposing VNC server on all the network interfaces may be OK when connecting to the
remarkable over USB interface, but when you are connecting to remarkable over WLAN, you are strongly encouraged to
use built-in SSH tunnel functionality.

When SSH tunnel functionality is used, VNC server which is started on remarkable will only listen on localhost, this
program will create SSH tunnel to the remarkable and connect to the VNC server over the local SSH tunnel.

This means that the connection will be encrypted and existing SSH authentication will be used.

## To Do

- [ ] Settings dialog
- [ ] About dialog
- [ ] Pause stream of screen/pen
- [x] Pause stream of screen/pen
- [ ] Binary bundles for Window, Linux and MacOs (PyInstaller?)
- [ ] Add interaction for Lamy button? (1 331 1 down, 1 331 0 up)
- [ ] Remove dependency to Twisted in `vnc` branch


## Legacy reStreamer-like version
Expand Down
Binary file added assets/connecting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions docker-run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -e

CONFIG_DIR=$HOME/.config/rmview
mkdir -p $CONFIG_DIR
xhost local:root
docker build -t rmview .
docker run \
--env DISPLAY=$DISPLAY \
--network host \
--volume $CONFIG_DIR:/root/.config \
--volume /tmp/.X11-unix:/tmp/.X11-unix \
rmview
17 changes: 17 additions & 0 deletions example_ssh_key_auth_with_ssh_tunnel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"ssh": {
"timeout": 4,
"address": "192.168.160.100",
"username": "root",
"auth_method": "key",
"key": "/home/user/.ssh/id_rsa_remarkable",
"password": "ssh key passphrase",
"tunnel": true
},
"orientation": "auto",
"pen_size": 15,
"pen_color": "red",
"pen_trail": 200,
"background_color": "white",
"hide_pen_on_press": true
}
3 changes: 2 additions & 1 deletion resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<file>assets/tablet.svg</file>
<file>assets/dead.svg</file>
<file>assets/problem.svg</file>
<file>assets/connecting.png</file>
<file>bin/rM1-vnc-server-standalone</file>
<file>bin/rM2-vnc-server-standalone</file>
</qresource>
</RCC>
</RCC>
5 changes: 4 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
[pycodestyle]
max-line-length = 88

[options]
package_dir=
=src
packages=find:

[options.packages.find]
where=src
where=src
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def run(self):

setup(
name='rmview',
version='2.1',
version='2.2',
url='https://github.com/bordaigorl/rmview',
description='rMview: a fast live viewer for reMarkable',
author='bordaigorl',
Expand All @@ -42,6 +42,7 @@ def run(self):
],
packages=['rmview'],
install_requires=['pyqt5', 'paramiko', 'twisted'],
extras_require = { 'tunnel': ['sshtunnel'] },
entry_points={
'console_scripts':['rmview = rmview.rmview:rmViewMain']
},
Expand Down
Loading