rmview icon indicating copy to clipboard operation
rmview copied to clipboard

rm 3.0 compatibility issues? Screen view not functioning

Open TEMET-NOSC3 opened this issue 2 years ago • 43 comments

Was wondering if I was the only one whom rmview stopped functioning once I updated my remarkable to 3.0 Hoping this can be resolved soon

TEMET-NOSC3 avatar Dec 03 '22 21:12 TEMET-NOSC3

You're not the only one, i have the same issue.

jsw08 avatar Dec 19 '22 16:12 jsw08

Manually compiling resolved the issue for me.

(Installed the rmview-git version on the AUR and manually installed the dependencies.)

jsw08 avatar Dec 21 '22 08:12 jsw08

Was not working on my side. I found out that the remarkable fingerprint changed, so I had to accept it again via ssh.

Still not working, so I launched it with debug and I noticed something interesting

$ rmview -v
[INFO] STARTING: Thu Dec 22 11:55:54 2022
[INFO] Searching configuration in <several paths here>
[INFO] Using known hosts file: /home/USER/.config/rmview_known_hosts
[INFO] Loaded known hosts from /home/USER/.config/rmview_known_hosts

So I tried removing that rmview_known_hosts file and it's working again now!

c0m3tx avatar Dec 22 '22 11:12 c0m3tx

Screen sharing is not working for me either after my reMarkable updated to version 3.0.4.1305. I get the following error when I try to connect using rmview:

Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/twisted/python/log.py", line 96, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/usr/lib/python3.10/site-packages/twisted/python/log.py", line 80, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/lib/python3.10/site-packages/twisted/python/context.py", line 117, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python3.10/site-packages/twisted/python/context.py", line 82, in callWithContext
    return func(*args, **kw)
--- <exception caught here> ---
  File "/usr/lib/python3.10/site-packages/twisted/internet/posixbase.py", line 487, in _doReadOrWrite
    why = selectable.doRead()
  File "/usr/lib/python3.10/site-packages/twisted/internet/tcp.py", line 248, in doRead
    return self._dataReceived(data)
  File "/usr/lib/python3.10/site-packages/twisted/internet/tcp.py", line 253, in _dataReceived
    rval = self.protocol.dataReceived(data)
  File "/usr/lib/python3.10/site-packages/twisted/protocols/tls.py", line 329, in dataReceived
    self._flushReceiveBIO()
  File "/usr/lib/python3.10/site-packages/twisted/protocols/tls.py", line 295, in _flushReceiveBIO
    ProtocolWrapper.dataReceived(self, bytes)
  File "/usr/lib/python3.10/site-packages/twisted/protocols/policies.py", line 110, in dataReceived
    self.wrappedProtocol.dataReceived(data)
  File "/usr/lib/python3.10/site-packages/rmview/rfb.py", line 720, in dataReceived
    self._handler()
  File "/usr/lib/python3.10/site-packages/rmview/rfb.py", line 203, in _handleInitial
    self._version_server = version_server
builtins.UnboundLocalError: local variable 'version_server' referenced before assignment

[WARNING] Disconnected: local variable 'version_server' referenced before assignment

marozols avatar Jan 03 '23 10:01 marozols

@marozols your issue was fixed in 7fbcc7cc7495d7bf7a9e0fbd07d7020b77366e44 make sure you are running on the latest commit. I'll add a release to point to the latest version.

As for compatibility with v3: I have not updated yet so I cannot test rmview on the new version. PRs are welcome if anybody finds tweaks that make it work well with it.

bordaigorl avatar Jan 03 '23 11:01 bordaigorl

Thanks, @bordaigorl! I managed to fix it in the meantime. The buffer variable in line 181 of rfb.py turns out to have value b'reM 001.001\n', so the version_server variable later doesn't get initialized. I simply commented out the line 203 in rfb.py

       self._version_server = version_server

and now everything works!

marozols avatar Jan 03 '23 11:01 marozols

I can't get it to work.

The window says "Connecting to reMarkable" und on the tablet I see "Accept connection in the desktop app..."

~/.local/bin/rmview -v
2023-01-13 22:58:07+0100 [-] Log opened.
[INFO] STARTING: Fri Jan 13 22:58:07 2023
[INFO] Searching configuration in rmview.json, /usr/home/manfred/.config/rmview.json
[DEBUG] Configuration failure in rmview.json: [Errno 2] Datei oder Verzeichnis nicht gefunden: 'rmview.json'
[INFO] Fetching configuration from /usr/home/manfred/.config/rmview.json
[WARNING] Config file "/usr/home/manfred/.config/rmview.json" is readable by others (permissions=664). If your config file contains secrets (e.g. password) you are strongly encouraged to make sure it's not readable by other users (chmod 600 /usr/home/manfred/.config/rmview.json)
[DEBUG] Config values: {'ssh': {'address': '192.168.178.88', 'password': '**********'}, 'orientation': 'auto', 'pen_size': 15, 'pen_color': 'red', 'pen_trail': 200}
[INFO] Using known hosts file: /usr/home/manfred/.config/rmview_known_hosts
[INFO] Loaded known hosts from /usr/home/manfred/.config/rmview_known_hosts
[INFO] Connecting...
[INFO] Connected to 192.168.178.88
[INFO] Detected reMarkable 2.0
[INFO] Using backend 'screenshare'
[INFO] Connecting to ScreenShare, make sure you enable it
[WARNING] Authenticating, please wait...
[DEBUG] Stopping connection worker
2023-01-13 22:58:10+0100 [-] ChallengeReaderProtocol starting on 5901
2023-01-13 22:58:10+0100 [-] Starting protocol <rmview.screenstream.screenshare.ChallengeReaderProtocol object at 0x7fbf98432a10>

After closing the window:

[DEBUG] Stopping ScreenShare streamer thread...
[INFO] Disconnecting from VNC server...
[DEBUG] Disconnect failed ('ScreenShareStream' object has no attribute 'vncClient'), stopping reactor
[DEBUG] ScreenShare streamer thread stopped.
2023-01-13 22:59:09+0100 [ChallengeReaderProtocol (UDP)] (UDP Port 5901 Closed)
2023-01-13 22:59:09+0100 [ChallengeReaderProtocol (UDP)] Stopping protocol <rmview.screenstream.screenshare.ChallengeReaderProtocol object at 0x7fbf98432a10>
2023-01-13 22:59:09+0100 [-] Main loop terminated.
[INFO] QUITTING: Fri Jan 13 22:59:09 2023

manfredu avatar Jan 13 '23 22:01 manfredu

Log on the PC side for me is :

% rmview -v

2023-01-18 16:49:02+0100 [-] Log opened.
[INFO] STARTING: Wed Jan 18 16:49:02 2023
[INFO] Searching configuration in rmview.json, /home/USER/.config/rmview.json
[DEBUG] Configuration failure in rmview.json: [Errno 2] No such file or directory: 'rmview.json'
[INFO] Fetching configuration from /home/USER/.config/rmview.json
[DEBUG] Config values: {'ssh': {'address': '10.0.0.43', 'password': '**********'}, 'orientation': 'auto', 'pen_size': 15, 'pen_color': 'red', 'pen_trail': 200}
[INFO] Using system default known hosts file
[INFO] Loading system default known hosts file, this may take a while...
[INFO] System default known host file loaded
[INFO] Connecting...
[INFO] Connected to 10.0.0.43
[INFO] Detected reMarkable 2.0
[DEBUG] Stopping connection worker
[INFO] Using backend 'screenshare'
[INFO] Connecting to ScreenShare, make sure you enable it
[WARNING] Authenticating, please wait...
2023-01-18 16:49:08+0100 [-] ChallengeReaderProtocol starting on 5901
2023-01-18 16:49:08+0100 [-] Starting protocol <rmview.screenstream.screenshare.ChallengeReaderProtocol object at 0x7ff47fe39e70>
[DEBUG] Stopping ScreenShare streamer thread...
[INFO] Disconnecting from VNC server...
[DEBUG] Disconnect failed ('ScreenShareStream' object has no attribute 'vncClient'), stopping reactor
[DEBUG] ScreenShare streamer thread stopped.
2023-01-18 16:49:53+0100 [ChallengeReaderProtocol (UDP)] (UDP Port 5901 Closed)
2023-01-18 16:49:53+0100 [ChallengeReaderProtocol (UDP)] Stopping protocol <rmview.screenstream.screenshare.ChallengeReaderProtocol object at 0x7ff47fe39e70>
2023-01-18 16:49:53+0100 [-] Main loop terminated.
[INFO] QUITTING: Wed Jan 18 16:49:53 2023

I can see that activate screen shearing on the device still open port 5900

# No Screen Shearing
% nmap 10.0.0.43

Starting Nmap 7.93 ( https://nmap.org ) at 2023-01-18 16:54 CET
Nmap scan report for 10.0.0.43
Host is up (0.0086s latency).
Not shown: 999 closed tcp ports (reset)
PORT   STATE SERVICE
22/tcp open  ssh
MAC Address: ****** (Ampak Technology)

Nmap done: 1 IP address (1 host up) scanned in 0.52 seconds
# ScreenShearing enabled
% nmap 10.0.0.43
Starting Nmap 7.93 ( https://nmap.org ) at 2023-01-18 16:55 CET
Nmap scan report for 10.0.0.43
Host is up (0.0060s latency).
Not shown: 998 closed tcp ports (reset)
PORT     STATE SERVICE
22/tcp   open  ssh
5900/tcp open  vnc
MAC Address: ****** (Ampak Technology)

Nmap done: 1 IP address (1 host up) scanned in 0.55 seconds

Sniffing packets on the PC side, I can see that the device is broadcasting UDP packages to port 5901, 51bytes data

michelepagot avatar Jan 18 '23 15:01 michelepagot

Is there any news for this issue? Does someone needs more information to identify the origin of the problem?

On my side, I have the same logs and I can see the cursor on the "connecting screen":

image

[INFO] Using system default known hosts file
[INFO] Loading system default known hosts file, this may take a while...
[INFO] System default known host file loaded
[INFO] Connecting...
[INFO] Connected to 192.168.1.93
[INFO] Detected reMarkable 2.0
[INFO] Using backend 'screenshare'
[INFO] Connecting to ScreenShare, make sure you enable it
[WARNING] Authenticating, please wait...

Thank you for your help!

tillwf avatar Mar 06 '23 11:03 tillwf

@tillwf was screensharing working before updating? Have you tried with the official app?

bordaigorl avatar Mar 06 '23 13:03 bordaigorl

I didn't try rmview before and the official app works indeed.

tillwf avatar Mar 06 '23 16:03 tillwf

@tillwf thanks, that confirms it's not a problem with closed ports. I am still on v2 so cannot help further at this time

bordaigorl avatar Mar 06 '23 16:03 bordaigorl

any news? Just tried running on v3.4 and having the same issue as described by @tillwf (same console output)

Soliprem avatar Jun 04 '23 16:06 Soliprem

+1 having the same issue as well

jsw08 avatar Jun 06 '23 18:06 jsw08

+1 connection works and can see cursor in rmview with pen movements made on the tablet, but not image is received.

zeigerpuppy avatar Jul 24 '23 13:07 zeigerpuppy

Just reporting that I installed rmview from scratch on Fedora 38 with Python 3.11.4 and have Remarkable 1 with version 3.5.2.1807 and rmview is working fine. Works with both password and ssh keys.

I start the "Present with Screen Share" on Remarkable first and then run rmview and it connects and works great.

[I'm having an issue where sometimes it stops connecting and it will timeout when trying to connect. After some time it works again. But I think this may be something with my test computer/network (which has some issues) because when this happens, I'm also unable to ssh and ping the remarkable independent of rmview]

meelash avatar Aug 05 '23 12:08 meelash

EDIT: FIXED The problem was that the content of /etc/version on the remarkable was: 20180309123456 I guess the firmware update set it to that for some reason. I can't think of any other explanation. In any case, screenshare.py chooses to use the vnc client instead of ScreenShare based on that data. I modified /etc/version to instead have: 20230824123456 and it worked!

---------------------------/EDIT I updated to 3.6.0.1865 and rmview stopped working. Here are the logs:

[INFO] Using system default known hosts file
[INFO] Loading system default known hosts file, this may take a while...
[INFO] System default known host file loaded
[INFO] Connecting...
[ERROR] Could not connect to 192.168.1.17: Unknown host key for server '192.168.1.17': got 'AAAAC3NzaC1lZDI1NTE5AAAAICBKSADoWnkCYT31fZtaiMYlSCfxhSn628PT4/BeV5GE'
[INFO] Please check your remarkable is connected and retry.
[ERROR] Unknown host key for server '192.168.1.17': got 'AAAAC3NzaC1lZDI1NTE5AAAAICBKSADoWnkCYT31fZtaiMYlSCfxhSn628PT4/BeV5GE'
[DEBUG] Stopping connection worker
[INFO] Saved host key in /home/saleemabdulhamid/.config/rmview_known_hosts
[WARNING] No key nor password given. System-wide SSH connection parameters are going to be used.
[INFO] Using known hosts file: /home/saleemabdulhamid/.config/rmview_known_hosts
[INFO] Loaded known hosts from /home/saleemabdulhamid/.config/rmview_known_hosts
[INFO] Connecting...
[INFO] Connected to 192.168.1.17
[INFO] Detected reMarkable 1.0
[INFO] Using backend 'screenshare'
[INFO] Connecting to ScreenShare, make sure you enable it
[WARNING] Skipping authentication
[DEBUG] Stopping connection worker
2023-08-24 21:52:33-0400 [-] Starting factory <rmview.screenstream.common.VncFactory object at 0x7f959b707250>
2023-08-24 21:52:33-0400 [VncClient (TLSMemoryBIOProtocol),client] Using protocol version 3.800
2023-08-24 21:52:33-0400 [VncClient (TLSMemoryBIOProtocol),client] auth failed, currently ignored

If I stop Screen Share on the remarkable I get these logs:

[WARNING] Disconnected: Connection was closed cleanly.
2023-08-24 21:52:46-0400 [-] Stopping factory <rmview.screenstream.common.VncFactory object at 0x7f959b707250>
2023-08-24 21:52:46-0400 [-] Main loop terminated.

So, I think it is connected. And it is successfully ssh'ing to the device, using the key and adding the key to the known_hosts.

I think these are the interesting lines:

[WARNING] Skipping authentication
2023-08-24 21:52:33-0400 [VncClient (TLSMemoryBIOProtocol),client] auth failed, currently ignored

meelash avatar Aug 25 '23 01:08 meelash

@meelash thank you so much for your report! I am still on version 2 of firmware (to preserve my current workflow) so I could not directly debug this one. The version being wrong is a weird one to find! I'll see if I can cook up a quick patch to solve this. Many thanks!

bordaigorl avatar Aug 25 '23 08:08 bordaigorl

I do have the same issue, any solution so-far?

rsoeldner avatar Aug 25 '23 17:08 rsoeldner

To summarize: this issue has many reports of different nature (most of which were resolved some time ago); the current status is that version 3.6.0.1865 of the firmware stores the wrong version number in /etc/version on the tablet. This makes rmview think it's dealing with an old version without screenshare and tries to use a custom vnc server (which is known not to work with recent updates). The easiest workaround is to run

ssh RMIPADDRESS 'echo 20230824123456 > /etc/version'

to overwrite on the tablet the version number with something sensible. A sensible solution would be to add a screenshare+auth backend option which forces the combination of connection methods that works for this version (overriding the version detection)

bordaigorl avatar Aug 25 '23 19:08 bordaigorl

Edit: The issue was actually solved by the version reset. The problem left was the UPD Port.

I was hoping that the issue is resolved by changing /etc/version on the remarkable, but no luck for me. Am I missing something?

rmview 
[INFO] STARTING: Fri Aug 25 22:57:28 2023
[INFO] Searching configuration in rmview.json, /home/drever/.config/rmview.json
[INFO] Fetching configuration from rmview.json
[WARNING] Config file "rmview.json" is readable by others (permissions=644). If your config file contains secrets (e.g. password) you are strongly encouraged to make sure it's not readable by other users (chmod 600 rmview.json)
[INFO] Using known hosts file: /home/drever/.config/rmview_known_hosts
[INFO] Loaded known hosts from /home/drever/.config/rmview_known_hosts
[INFO] Connecting...
[INFO] Connected to remarkable
[INFO] Detected reMarkable 2.0
[INFO] Using backend 'screenshare'
[INFO] Connecting to ScreenShare, make sure you enable it
[WARNING] Authenticating, please wait...
[INFO] Disconnecting from VNC server...
[INFO] QUITTING: Fri Aug 25 22:57:39 2023

drever avatar Aug 25 '23 21:08 drever

I tried implementing the mentioned feature (enforcing authentication) here: https://github.com/rsoeldner/rmview/tree/rmv3-auth

I get the following output:

[INFO] Detected reMarkable 2.0
[INFO] Using backend 'screenshare+auth'
[INFO] Connecting to ScreenShare, make sure you enable it
[WARNING] Authenticating, please wait...
2023-08-25 23:10:04+0200 [-] ChallengeReaderProtocol starting on 5901
2023-08-25 23:10:04+0200 [-] Starting protocol <rmview.screenstream.screenshare.ChallengeReaderProtocol object at 0x7f9d1807c4f0>

But it will not pass the authentication. Maybe @bordaigorl can confirm, using the ChallengeReaderProtocol is the correct one?

rsoeldner avatar Aug 25 '23 21:08 rsoeldner

@rsoeldner yes ChallengeReaderProtocol is the authentication protocol which is known to work since 2.9.1. The key is to bypass the version check at line 137 in screenshare.py. When that protocol hangs it is usually a sign that the UDP port at 5901 is blocked (maybe by firewalls/OS) and opening it typically solves the problem (see the wiki). @rsoeldner do you know for a fact that, in the same network/os environment you were able to connect before upgrading to v3?

bordaigorl avatar Aug 27 '23 14:08 bordaigorl

@bordaigorl Unfortunately, this does not work for me ... The mentioned change should be implemented in my fork. Any ideas how to debug thus further?

rsoeldner avatar Aug 27 '23 18:08 rsoeldner

I was hoping that the issue is resolved by changing /etc/version on the remarkable, but no luck for me. Am I missing something?

rmview 
[INFO] STARTING: Fri Aug 25 22:57:28 2023
[INFO] Searching configuration in rmview.json, /home/drever/.config/rmview.json
[INFO] Fetching configuration from rmview.json
[WARNING] Config file "rmview.json" is readable by others (permissions=644). If your config file contains secrets (e.g. password) you are strongly encouraged to make sure it's not readable by other users (chmod 600 rmview.json)
[INFO] Using known hosts file: /home/drever/.config/rmview_known_hosts
[INFO] Loaded known hosts from /home/drever/.config/rmview_known_hosts
[INFO] Connecting...
[INFO] Connected to remarkable
[INFO] Detected reMarkable 2.0
[INFO] Using backend 'screenshare'
[INFO] Connecting to ScreenShare, make sure you enable it
[WARNING] Authenticating, please wait...
[INFO] Disconnecting from VNC server...
[INFO] QUITTING: Fri Aug 25 22:57:39 2023

I just did it today with my RM2 with firmware 3.6, and I can confirm it does work, no issues connecting.

atxbyea avatar Sep 04 '23 07:09 atxbyea

thank you for the version-overwriting workaround! confirm that it works for me.

bbolker avatar Sep 04 '23 23:09 bbolker

I've just got my remarkable with 3.6 firmware and have the connection problem. Part of it was fixed by the mentioned update of /etc/version file, however now I have some UDP errors that I couldn't find in previous issues:

2023-09-05 15:31:21-0500 [-] Log opened.
[INFO] STARTING: Tue Sep  5 15:31:21 2023
[INFO] Searching configuration in remarkable-home.json, rmview.json, /home/alserg/.config/rmview.json
[INFO] Fetching configuration from remarkable-home.json
[WARNING] Config file "remarkable-home.json" is readable by others (permissions=644). If your config file contains secrets (e.g. password) you are strongly encouraged to make sure it's not readable by other users (chmod 600 remarkable-home.json)
[DEBUG] Config values: {'ssh': {'address': '10.11.99.1', 'username': 'root', 'auth_method': 'key', 'key': '/home/assaron/.ssh/id_rsa', 'timeout': 2}, 'backend': 'screenshare', 'orientation': 'auto', 'pen_size': 15, 'pen_color': 'red', 'pen_trail': 200, 'background_color': 'white', 'hide_pen_on_press': True}
[INFO] Using system default known hosts file
[INFO] Loading system default known hosts file, this may take a while...
[INFO] System default known host file loaded
[INFO] Connecting...
[INFO] Connected to 10.11.99.1
[DEBUG] Stopping connection worker
[INFO] Detected reMarkable 2.0
[INFO] Using backend 'screenshare'
[INFO] Connecting to ScreenShare, make sure you enable it
[WARNING] Authenticating, please wait...
2023-09-05 15:31:24-0500 [-] ChallengeReaderProtocol starting on 5901
2023-09-05 15:31:24-0500 [-] Starting protocol <rmview.screenstream.screenshare.ChallengeReaderProtocol object at 0x7f9d685896c0>
[INFO] received timestamp challenge 1693945892026
2023-09-05 15:31:32-0500 [ChallengeReaderProtocol (UDP)] Unhandled Error
	Traceback (most recent call last):
	  File "/home/alserg/miniconda3/lib/python3.10/site-packages/twisted/python/log.py", line 80, in callWithContext
	    return context.call({ILogContext: newCtx}, func, *args, **kw)
	  File "/home/alserg/miniconda3/lib/python3.10/site-packages/twisted/python/context.py", line 117, in callWithContext
	    return self.currentContext().callWithContext(ctx, func, *args, **kw)
	  File "/home/alserg/miniconda3/lib/python3.10/site-packages/twisted/python/context.py", line 82, in callWithContext
	    return func(*args, **kw)
	  File "/home/alserg/miniconda3/lib/python3.10/site-packages/twisted/internet/posixbase.py", line 482, in _doReadOrWrite
	    why = selectable.doRead()
	--- <exception caught here> ---
	  File "/home/alserg/miniconda3/lib/python3.10/site-packages/twisted/internet/udp.py", line 254, in doRead
	    self.protocol.datagramReceived(data, addr)
	  File "/home/alserg/miniconda3/lib/python3.10/site-packages/rmview/screenstream/screenshare.py", line 46, in datagramReceived
	    if not self.callback(timestamp):
	  File "/home/alserg/miniconda3/lib/python3.10/site-packages/rmview/screenstream/screenshare.py", line 119, in runVnc
	    userId = self.get_userid()
	  File "/home/alserg/miniconda3/lib/python3.10/site-packages/rmview/screenstream/screenshare.py", line 106, in get_userid
	    token = cfg.get('General', 'devicetoken')[offset:-1]
	  File "/home/alserg/miniconda3/lib/python3.10/configparser.py", line 793, in get
	    raise NoOptionError(option, section)
	configparser.NoOptionError: No option 'devicetoken' in section: 'General'
	
[INFO] received timestamp challenge 169394589202
...

The config mentioned there seems to be /etc/remarkable.conf, indeed, I don't see any devicetoken value there...

Edit: got, I had to register the device first :) now it works fine!

assaron avatar Sep 05 '23 20:09 assaron

Thanks @assaron for the report, it would definitely be better for rmview to detect whether you still need to register and give a more informative error...

bordaigorl avatar Sep 05 '23 23:09 bordaigorl

The easiest workaround is to run

ssh RMIPADDRESS 'echo 20230824123456 > /etc/version'

to overwrite on the tablet the version number with something sensible.

Thanks a lot! I also confirm, that this worked for me (Firmware Version: 3.6.1.1894).

eguvep avatar Sep 17 '23 07:09 eguvep

The easiest workaround is to run

ssh RMIPADDRESS 'echo 20230824123456 > /etc/version'

to overwrite on the tablet the version number with something sensible.

Thanks a lot! I also confirm, that this worked for me (Firmware Version: 3.6.1.1894).

This worked for me as well!

ezhang7423 avatar Sep 24 '23 00:09 ezhang7423