aurelien brabant's logo

How to connect a Remarkable 2 tablet through USB on Gentoo Linux

I have got a Remarkable 2 tablet, and I must say that I'm very happy with it so far. However, as I wanted to connect it to my desktop computer running Gentoo Linux through USB, I ran into some issue that prevented me from connecting to the tablet on my local network. As I managed to fix that specific issue and that there is no Gentoo-specific documentation about this, I want to quickly address it in this post.

The problem

The issue was pretty simple: I was able to connect my Remarkable 2 to my Gentoo system, it would be recognized as noticed by the dmesg command, but I wasn't able to access the network interface that is supposed to be exposed by the tablet once it gets connected. As a Gentoo user, my first thought was that it should have something to do with my kernel configuration. And I was right.

The fix!

I spent a few hours trying to figure out what I was missing and most importantly, what was really happening at the moment I was connecting my Remarkable. In fact, reading the dmesg output gave me what I needed:

[11961.313512] usb 1-11: new high-speed USB device number 9 using xhci_hcd
[11961.442424] usb 1-11: New USB device found, idVendor=04b3, idProduct=4010, bcdDevice= 5.04
[11961.442427] usb 1-11: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[11961.442432] usb 1-11: Product: RNDIS/Ethernet Gadget
[11961.442433] usb 1-11: Manufacturer: Linux 5.4.70-v1.1.5-rm11x with 30b20000.usb

What matters with that output is the fourth line: RNDIS stands for Remote Network Driver Interface Specification, and that was all I needed to figure it out. When the tablet is connected through USB, it actually acts as a network adapter, exposing a new network interface. That means that it is needed to have support for USB network adapters built into the kernel or as kernel modules. As I expected, my kernel didn't have that, which is not that surprising given how minimal the default configuration we are supplied with is.

By looking up the gentoo wiki, I finally found the configuration options my kernel was missing. I simply had to enable them, recompile and reinstall my kernel (which is actually done in less than five minutes) and reboot my computer.

When I logged back in and plugged in my tablet, the ip a command listed a new network interface named enp0s20f0u11. The last step that remained was to configure that interface to let the init system know about how it should be configured. I simply told it to use the DHCP server to get a proper IP:

config_enp0s20f0u11="dhcp"

And that did the trick. The interface was now listed as being up, and I was able to successfully connect to the IP address the tablet was assigned to by the DHCP server.

Obviously, disconnecting the tablet from the computer would cause the network interface to disappear and would require it to be reconfigured the next time it is plugged in. Same thing applies in case the tablet goes to sleep. If that occurs, a simple . /etc/init.d/net.<interface_name> restart should do the trick.