Open danimateos opened 2 weeks ago
Can you try again with the latest commit and this time with the --debug
option? That should print out e_type
, e_code
, etc before the error occurs.
Those are also weirdly large numbers. The biggest e_type
is 31 and e_code
is 767. Those are defined by libevdev. Maybe the data isn't being unpacked correctly?
I cloned the repo and installed using python setup.py install
. I got some fresh codes: 40898, 42550, 22872, 35596...
See below:
[dani@flecha:~/repos/remarkable_mouse] [remarkable_mouse] master 25s
± remouse --debug --key ~/.ssh/remarkable --address 10.11.99.1
Debugging enabled...
Connecting to input '10.11.99.1'
Pen:/dev/input/event2
Touch:/dev/input/event2
Button:/dev/input/event0
Connected to 10.11.99.1
Chose monitor: Monitor(x=0, y=0, width=1680, height=1050, width_mm=None, height_mm=None, name=None, is_primary=True)
Screen size: (1680, 1050)
Chose monitor: Monitor(x=0, y=0, width=1680, height=1050, width_mm=None, height_mm=None, name=None, is_primary=True)
Traceback (most recent call last):
File "/Users/dani/opt/mambaforge/envs/remarkable_mouse/bin/remouse", line 33, in <module>
sys.exit(load_entry_point('remarkable-mouse==7.1.1', 'console_scripts', 'remouse')())
File "/Users/dani/opt/mambaforge/envs/remarkable_mouse/lib/python3.10/site-packages/remarkable_mouse-7.1.1-py3.10.egg/remarkable_mouse/remarkable_mouse.py", line 175, in main
File "/Users/dani/opt/mambaforge/envs/remarkable_mouse/lib/python3.10/site-packages/remarkable_mouse-7.1.1-py3.10.egg/remarkable_mouse/pynput.py", line 49, in read_tablet
KeyError: 40898
[dani@flecha:~/repos/remarkable_mouse] [remarkable_mouse] master 8s 1
± remouse --debug --key ~/.ssh/remarkable --address 10.11.99.1
Debugging enabled...
Connecting to input '10.11.99.1'
Pen:/dev/input/event2
Touch:/dev/input/event2
Button:/dev/input/event0
Connected to 10.11.99.1
Chose monitor: Monitor(x=0, y=0, width=1680, height=1050, width_mm=None, height_mm=None, name=None, is_primary=True)
Screen size: (1680, 1050)
Chose monitor: Monitor(x=0, y=0, width=1680, height=1050, width_mm=None, height_mm=None, name=None, is_primary=True)
Traceback (most recent call last):
File "/Users/dani/opt/mambaforge/envs/remarkable_mouse/bin/remouse", line 33, in <module>
sys.exit(load_entry_point('remarkable-mouse==7.1.1', 'console_scripts', 'remouse')())
File "/Users/dani/opt/mambaforge/envs/remarkable_mouse/lib/python3.10/site-packages/remarkable_mouse-7.1.1-py3.10.egg/remarkable_mouse/remarkable_mouse.py", line 175, in main
File "/Users/dani/opt/mambaforge/envs/remarkable_mouse/lib/python3.10/site-packages/remarkable_mouse-7.1.1-py3.10.egg/remarkable_mouse/pynput.py", line 49, in read_tablet
KeyError: 42550
[dani@flecha:~/repos/remarkable_mouse] [remarkable_mouse] master 3s 1
± remouse --debug --key ~/.ssh/remarkable --address 10.11.99.1
Debugging enabled...
Connecting to input '10.11.99.1'
Pen:/dev/input/event2
Touch:/dev/input/event2
Button:/dev/input/event0
Connected to 10.11.99.1
Chose monitor: Monitor(x=0, y=0, width=1680, height=1050, width_mm=None, height_mm=None, name=None, is_primary=True)
Screen size: (1680, 1050)
Chose monitor: Monitor(x=0, y=0, width=1680, height=1050, width_mm=None, height_mm=None, name=None, is_primary=True)
Traceback (most recent call last):
File "/Users/dani/opt/mambaforge/envs/remarkable_mouse/bin/remouse", line 33, in <module>
sys.exit(load_entry_point('remarkable-mouse==7.1.1', 'console_scripts', 'remouse')())
File "/Users/dani/opt/mambaforge/envs/remarkable_mouse/lib/python3.10/site-packages/remarkable_mouse-7.1.1-py3.10.egg/remarkable_mouse/remarkable_mouse.py", line 175, in main
File "/Users/dani/opt/mambaforge/envs/remarkable_mouse/lib/python3.10/site-packages/remarkable_mouse-7.1.1-py3.10.egg/remarkable_mouse/pynput.py", line 49, in read_tablet
KeyError: 22872
Can you log in to the tablet and run this command and paste the output here?
ls -l /dev/input/touchscreen0
Also in /dev/input
there should be files like event0
, event1
, event2
, ... that correspond to pen input, touch input, button input, etc.
For each one, can you do cat /dev/input/eventXXX
to figure out what input it's associated with? It should show nothing until you touch the screen with stylus/finger or press a button (doesn't exist on rM pro?)
For example, on my rM1 I get this when I run cat /dev/input/event2
and touch the screen with my finger:
[root@reMarkable ~] cat /dev/input/event2
�$g9
�$g5
�$g6T�$g:�$g4�$g�$g�� 5
�$g�� 6U�$g�� :_�$g�� 4�$g�� �$gf� �$gf� 6W�$gf� :H�$gf� 4�$gf� �$g�X
9�����$g�X
�$g�&5��$g�&6��$g�&:��$g�&4�$g�&�$guM5��$guM:~�$guM4�$guM�$g'w5��$g'w:|�$g'w1�$g'w4�$g'w�$g5��$g6��$g:z�$g0�$g4�$g�$g��5��$g��6��$g��:w�$g��1 �$g��4�$g���$g��5��$g��6��$g��:p�$g���$g^5��$g^6��$g^:j�$g^�$g}J5��$g}J6��$g}J:a�$g}J�$g�t5��$g�t6��$g�t:1�$g�t0 �$g�t4�$g�t�$g�9�����$g�^C
Greetings, thought I would hop in since I am having the same issue. Tried doing the latest instructions for the events, this is what I got:
event0
-> power on/off button
event1
-> pen attach/detach
event2
-> stylus interaction (hovering/writing)
event3
-> hand interaction (touching the screen)
@locallium
Thanks. What about these commands:
cat /sys/class/input/event*/device/capabilities/ev
ls -l /dev/input/touchscreen0
Also there's going to be some more work ahead to figure out the new coordinate mappings for all these inputs
Once the --debug
option is working it should be straightforward to figure this stuff out.
Thanks @EVidlo and @locallium !
$ cat /sys/class/input/event*/device/capabilities/ev
3
21
b
b
$ ls -l /dev/input/touchscreen0
lrwxrwxrwx 1 root root 6 Oct 17 12:39 /dev/input/touchscreen0 -> event2
I'm available to do the remaining work that you mention. Thanks a lot for the responsiveness!!
I've added the rmpro
branch which should let you connect to the tablet and at least move the cursor around. It looks like the pen/touch coordinate systems on the Pro are not the same as rm1/rm2. We need to know the new mapping (use the --debug
flag).
For example rm1/rm2 looks like this:
TABLET COORDINATES
PEN TOUCH
+---------+ +---------+
| X | | Y |
| | | | | |
| | | | | |
| +--- Y | | X ---+ |
| | | |
|---------| |---------|
| USB PORT| | USB PORT|
+---------+ +---------+
Thanks to both of you!
Installed the new branch, it did let me connect. Unfortunately, it does not move the cursor. Also it throws the following error just as soon as I touch the screen with my finger.
Debugging enabled...
Connecting to input '10.11.99.1'
Password for '10.11.99.1':
Pen:/dev/input/event3
Touch:/dev/input/event2
Button:/dev/input/event0
Connected to 10.11.99.1
Chose monitor: Monitor(x=0, y=0, width=2560, height=1440, width_mm=597, height_mm=336, name='\\\\.\\DISPLAY1', is_primary=True)
Screen size: (5120, 1440)
Chose monitor: Monitor(x=0, y=0, width=2560, height=1440, width_mm=597, height_mm=336, name='\\\\.\\DISPLAY1', is_primary=True)
Traceback (most recent call last):
File "C:\Users\lauri\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\lauri\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\lauri\AppData\Local\Programs\Python\Python310\Scripts\remouse.exe\__main__.py", line 7, in <module>
File "C:\Users\lauri\AppData\Local\Programs\Python\Python310\lib\site-packages\remarkable_mouse\remarkable_mouse.py", line 175, in main
read_tablet(
File "C:\Users\lauri\AppData\Local\Programs\Python\Python310\lib\site-packages\remarkable_mouse\pynput.py", line 49, in read_tablet
if codes[e_type][e_code] == 'ABS_X':
KeyError: 61892
I've noticed that the events are different, I'm not sure whether that changes anything, just something I've noticed 😅. Running the previous command also outputs a different event from the one @danimateos had. Again, unsure whether that changes anything, but I just wanted to let you know.
$ ls -l /dev/input/touchscreen0
lrwxrwxrwx 1 root root 6 Oct 25 23:07 /dev/input/touchscreen0 -> event3
Hi!
Then, connected to the tablet and experimented a bit. Pen detach or finger touch don't seem to result in any reaction. Pen hover triggers a KeyError
. The keys are high numbers, so far always above 4000 and below 65k.
I've got: 54003, 60124, 10755, 54520, 29203, 14673, 61016, 5351, 36373, 46999, 62710, 44749, 60108 and many more with no pattern that I can discern. Tried hovering over each corner and also could not tell any pattern.
Maybe we could capture the keyerror and log it to file so that we could generate many more keys to check statistically? I guess I could do that, will try to do it later today.
Also run again the touchscreen ls to recheck:
[dani@flecha:~/repos/remarkable_mouse] [base] rmpro 8s 1
± ssh remarkable ~/repos/remarkable_mouse 11:08:26
root@imx8mm-ferrari:~# ls -l /dev/input/touchscreen0
lrwxrwxrwx 1 root root 6 Oct 17 12:39 /dev/input/touchscreen0 -> event2
I put a try/catch block inside the loop in read_tablet (see attached file) and redirected debug output. As long as it doesn't KeyError
out, it recognizes the hover and moves the cursor! Then I did, in turn:
The finger is not recognized.
pynput.py
lines 77, 78
except KeyError as e:
log.debug(e)
Hello again! Thank you, @danimateos, very much for your contributions!
Updating the device fixed the touchscreen0
file, now I also get event2
and regarding that all works as it should (still getting KeyErrors on stylus interaction though).
Wanted to try your solution, but unfortunately I am having some issues. I don't really understand how exactly you incorporated the above code, I keep getting the Expected expression Pylance
error, supposedly because it wants a try
statement first. Anything else you've changed maybe?
Thanks!
These errors are almost surely just because rm.pen_file
is pointing to the wrong file in /dev/input/
. For now I recommend
connect_rm
to return reMarkablePro(client)
reMarkablePro
class in common.py
so that pen_file
points to the right place.I am currently working on detecting the right input files in a more robust way. In the meantime, the changes I suggested above should move things further along.
I got my remarkable paper pro yesterday and I love it... but I've realized that remarkable_mouse was a huge part of the value proposition of the remarkable 2 for me. I use as a digital whiteboard in lessons and it works great.
I've set up ssh access with the same key that I used for RM2 and it works fine.
when I try to use it as is with the RMPP I get the following error:
The
KeyError
is different in each run. I've gotten 220, 65392, and 29834 so far.My naive hope is that it would be enough to update the codes.py dictionary... I have some Python experience so maybe I could help.