@@ -201,22 +201,24 @@ def connected(self, ssh):
201
201
# cat /sys/devices/soc0/machine -> reMarkable 1.x
202
202
_ ,out ,_ = ssh .exec_command ("cat /sys/devices/soc0/machine" )
203
203
rmv = out .read ().decode ("utf-8" )
204
- ver = re .fullmatch (r"reMarkable (\d+)\..*\n" , rmv )
205
- if ver is None or ver [1 ] != "1" :
206
- log .error ("Device is unsupported: '%s' [%s]" , rmv , ver [1 ] if ver else "unknown device" )
204
+ version = re .fullmatch (r"reMarkable (\d+)\..*\n" , rmv )
205
+ if version is None or version [1 ] not in [ "1" , "2" ] :
206
+ log .error ("Device is unsupported: '%s' [%s]" , rmv , version [1 ] if version else "unknown device" )
207
207
QMessageBox .critical (None , "Unsupported device" , 'The detected device is %s.\n rmView currently only supports reMarkable 1.' % rmv )
208
208
self .quit ()
209
209
return
210
210
211
+ version = int (version [1 ])
212
+
211
213
# check needed files are in place
212
- _ ,out ,_ = ssh .exec_command ("[ -x $HOME/rM-vnc-server ] && [ -e $HOME/mxc_epdc_fb_damage.ko ]" )
214
+ _ ,out ,_ = ssh .exec_command ("[ -x $HOME/rM-vnc-server-standalone ]" )
213
215
if out .channel .recv_exit_status () != 0 :
214
216
mbox = QMessageBox (QMessageBox .NoIcon , 'Missing components' , 'Your reMarkable is missing some needed components.' )
215
217
icon = QPixmap (":/assets/problem.svg" )
216
218
icon .setDevicePixelRatio (self .devicePixelRatio ())
217
219
mbox .setIconPixmap (icon )
218
220
mbox .setInformativeText (
219
- "To work properly, rmView needs the rM-vnc-server and mxc_epdc_fb_damage.ko files " \
221
+ "To work properly, rmView needs the rM-vnc-server-standalone program " \
220
222
"to be installed on your tablet.\n " \
221
223
"You can install them manually, or let rmView do the work for you by pressing 'Auto Install' below.\n \n " \
222
224
"If you are unsure, please consult the documentation." )
@@ -232,15 +234,11 @@ def connected(self, ssh):
232
234
try :
233
235
sftp = ssh .open_sftp ()
234
236
from stat import S_IXUSR
235
- fo = QFile (':bin/rM-vnc-server' )
236
- fo .open (QIODevice .ReadOnly )
237
- sftp .putfo (fo , 'rM-vnc-server' )
238
- fo .close ()
239
- sftp .chmod ('rM-vnc-server' , S_IXUSR )
240
- fo = QFile (':bin/mxc_epdc_fb_damage.ko' )
237
+ fo = QFile (':bin/rM%d-vnc-server-standalone' % version )
241
238
fo .open (QIODevice .ReadOnly )
242
- sftp .putfo (fo , 'mxc_epdc_fb_damage.ko ' )
239
+ sftp .putfo (fo , 'rM-vnc-server-standalone ' )
243
240
fo .close ()
241
+ sftp .chmod ('rM-vnc-server-standalone' , S_IXUSR )
244
242
log .info ("Installation successful!" )
245
243
except Exception as e :
246
244
log .error ('%s %s' , type (e ), e )
@@ -263,7 +261,7 @@ def connected(self, ssh):
263
261
self .fbworker .signals .onFatalError .connect (self .frameError )
264
262
self .threadpool .start (self .fbworker )
265
263
266
- self .penworker = PointerWorker (ssh )
264
+ self .penworker = PointerWorker (ssh , path = "/dev/input/event%d" % ( version - 1 ) )
267
265
self .threadpool .start (self .penworker )
268
266
self .pen = self .viewer .scene .addEllipse (0 ,0 ,self .pen_size ,self .pen_size ,
269
267
pen = QPen (QColor ('white' )),
0 commit comments