Tips and tricks

From reMarkable Wiki
Jump to: navigation, search


Log into your tablet with ssh[edit]

Most of the tips and tricks in this section require that you first log into your tablet. The Remarkable tablet is a linux machine in its own right and when the tablet is connected to the connected with the USB cable you can use 'ssh' to log into it:

ssh root@10.11.99.1

You will need to type the password to log in; the password is found in the About page on your tablet, at the bottom of the General information section.

Changing the password[edit]

The password of your tablet is shown in the About page on your tablet, at the bottom of the General information section (drag the page to scroll down). The password is stored in the file "/etc/remarkable.conf" which can be edited with the "vi" editor. Look for this section:

[General]
DeveloperPassword=password

Setting up rclone[edit]

rclone is an opensource tool for syncing to various forms of cloud storage.

The 32bit ARM binary works on the reMarkable, and with just a little bit of effort it is relatively easy to sync the device with your Google drive from the ssh shell.

(xenial)kimbotha@localhost:~/Downloads/src$ unzip ../rclone-current-linux-arm.zip 
Archive:  ../rclone-current-linux-arm.zip
   creating: rclone-v1.38-linux-arm/
  inflating: rclone-v1.38-linux-arm/README.html  
  inflating: rclone-v1.38-linux-arm/rclone  
  inflating: rclone-v1.38-linux-arm/rclone.1  
  inflating: rclone-v1.38-linux-arm/README.txt  
  • Copy the rclone binary to the reMarkable
(xenial)kimbotha@localhost:~/Downloads/src$ cd rclone-v1.38-linux-arm/
(xenial)kimbotha@localhost:~/Downloads/src/rclone-v1.38-linux-arm$ scp rclone root@10.11.99.1:/usr/local/bin/
rclone                                                                          100%   13MB   4.4MB/s   00:03    
  • SSH to the reMarkable with a port forward of 53682
(xenial)kimbotha@localhost:~/Downloads/src/rclone-v1.38-linux-arm$ ssh -L 53682:localhost:53682 root@10.11.99.1
reMarkable
╺━┓┏━╸┏━┓┏━┓   ┏━╸┏━┓┏━┓╻ ╻╻╺┳╸┏━┓┏━┓
┏━┛┣╸ ┣┳┛┃ ┃   ┃╺┓┣┳┛┣━┫┃┏┛┃ ┃ ┣━┫┗━┓
┗━╸┗━╸╹┗╸┗━┛   ┗━┛╹┗╸╹ ╹┗┛ ╹ ╹ ╹ ╹┗━┛
remarkable: ~/ 
  • Make the rclone binary executable
remarkable: ~/ chmod +x /usr/local/bin/rclone 
  • Run the rclone config to set up the config for your cloud storage
remarkable: ~/ rclone config
2017/11/12 21:37:18 NOTICE: Config file "/home/root/.config/rclone/rclone.conf" not found - using defaults
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> cloud
Type of storage to configure.
Choose a number from below, or type in your own value
 1 / Amazon Drive
   \ "amazon cloud drive"
 2 / Amazon S3 (also Dreamhost, Ceph, Minio)
   \ "s3"
 3 / Backblaze B2
   \ "b2"
 4 / Box
   \ "box"
 5 / Dropbox
   \ "dropbox"
 6 / Encrypt/Decrypt a remote
   \ "crypt"
 7 / FTP Connection
   \ "ftp"
 8 / Google Cloud Storage (this is not Google Drive)
   \ "google cloud storage"
 9 / Google Drive
   \ "drive"
10 / Hubic
   \ "hubic"
11 / Local Disk
   \ "local"
12 / Microsoft Azure Blob Storage
   \ "azureblob"
13 / Microsoft OneDrive
   \ "onedrive"
14 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
   \ "swift"
15 / QingClound Object Storage
   \ "qingstor"
16 / SSH/SFTP Connection
   \ "sftp"
17 / Yandex Disk
   \ "yandex"
18 / http Connection
   \ "http"
Storage> 9
Google Application Client Id - leave blank normally.
client_id> 
Google Application Client Secret - leave blank normally.
client_secret> 
Remote config
Use auto config?
 * Say Y if not sure
 * Say N if you are working on a remote or headless machine or Y didn't work
y) Yes
n) No
y/n> Y
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
Log in and authorize rclone for access
Waiting for code...
  • Connect to the URL on your main machine (which should be available because of the port forward
  • Authorise the connection
  • On your reMarkable the rclone config process should continue
Got code
Configure this as a team drive?
y) Yes
n) No
y/n> y
Fetching team drive list...
No team drives found in your account--------------------
[cloud]
client_id = 
client_secret = 
token = {"access_token":"XX.....XX","token_type":"Bearer","refresh_token":"1/XX.....XX","expiry":"2017-11-12T22:40:50.400973087Z"}
team_drive = 
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:

Name                 Type
====                 ====
cloud                drive

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q
  • You should now be able to use rclone with this config and enable copying, syncing, downloading etc.
remarkable: ~/ rclone help

Rclone is a command line program to sync files and directories to and
from various cloud storage systems and using file transfer services, such as:

  * Amazon Drive
  * Amazon S3
  * Backblaze B2
  * Box
  * Dropbox
  * FTP
  * Google Cloud Storage
  * Google Drive
  * HTTP
  * Hubic
  * Microsoft Azure Blob Storage
  * Microsoft OneDrive
  * Openstack Swift / Rackspace cloud files / Memset Memstore
  * QingStor
  * SFTP
  * Yandex Disk
  * The local filesystem

Features

  * MD5/SHA1 hashes checked at all times for file integrity
  * Timestamps preserved on files
  * Partial syncs supported on a whole file basis
  * Copy mode to just copy new/changed files
  * Sync (one way) mode to make a directory identical
  * Check mode to check for file hash equality
  * Can sync to and from network, eg two different cloud accounts

See the home page for installation, usage, documentation, changelog
and configuration walkthroughs.

  * https://rclone.org/

Usage:
  rclone [flags]
  rclone [command]

Available Commands:
  authorize       Remote authorization.
  cat             Concatenates any files and sends them to stdout.
  check           Checks the files in the source and destination match.
  cleanup         Clean up the remote if possible
  config          Enter an interactive configuration session.
  copy            Copy files from source to dest, skipping already copied
  copyto          Copy files from source to dest, skipping already copied
  cryptcheck      Cryptcheck checks the integrity of a crypted remote.
  cryptdecode     Cryptdecode returns unencrypted file names.
  dbhashsum       Produces a Dropbbox hash file for all the objects in the path.
  dedupe          Interactively find duplicate files delete/rename them.
  delete          Remove the contents of path.
  genautocomplete Output completion script for a given shell.
  gendocs         Output markdown docs for rclone to the directory supplied.
  help            Help about any command
  listremotes     List all the remotes in the config file.
  ls              List all the objects in the path with size and path.
  lsd             List all directories/containers/buckets in the path.
  lsjson          List directories and objects in the path in JSON format.
  lsl             List all the objects path with modification time, size and path.
  md5sum          Produces an md5sum file for all the objects in the path.
  mkdir           Make the path if it doesn't already exist.
  mount           Mount the remote as a mountpoint. **EXPERIMENTAL**
  move            Move files from source to dest.
  moveto          Move file or directory from source to dest.
  ncdu            Explore a remote with a text based user interface.
  obscure         Obscure password for use in the rclone.conf
  purge           Remove the path and all of its contents.
  rcat            Copies standard input to file on remote.
  rmdir           Remove the path if empty.
  rmdirs          Remove empty directories under the path.
  sha1sum         Produces an sha1sum file for all the objects in the path.
  size            Prints the total size and number of objects in remote:path.
  sync            Make source and dest identical, modifying destination only.
  tree            List the contents of the remote in a tree like fashion.
  version         Show the version number.

Flags:
...

File-tree script[edit]

As the reMarkable stores documents and folders in a flat(ish) directory structure with UUIDs instead of human readable file and directory names, it could be helpful to be able to build a directory structure on the device using "normal" file and directory names so that it can be synced to cloud storage and be meaningful.

A quick bash script (bash is the only programming language, other than maybe awk, that is natively on the reMarkable) is available in the github repo (no warranties provided ;) )

Add contact details to the splash screens[edit]

The splash screens the reMarkable uses are stored as PNG files in /usr/share/remarkable (in the first version of the software, before the software upgrade of mid-january 2017, a few PNGs were also stored in /usr/share/remarkable-shutdown)

root@remarkable:~# ls -la /usr/share/remarkable
drwxr-xr-x    4 root     root          1024 Jan  3 13:24 .
drwxr-xr-x   23 root     root          1024 Jan  3 13:24 ..
-rw-r--r--    1 root     root         65309 Nov  9 15:59 batteryempty.png
-rw-r--r--    1 root     root         75499 Nov  9 15:59 poweroff.png
-rw-r--r--    1 root     root         63863 Nov  9 15:59 rebooting.png
-rw-r--r--    1 root     root         63638 Nov  9 15:59 restart-crashed.png
-rw-r--r--    1 root     root         52644 Nov  9 15:59 sleeping.png
-rw-r--r--    1 root     root       2629366 Jan  3 14:22 splash.bmp
-rw-r--r--    1 root     root         59839 Nov  9 15:59 starting.png
-rw-r--r--    1 root     root         63586 Nov  9 15:59 suspended.png
drwxr-xr-x    2 root     root          2048 Jan  3 13:23 templates
-rw-r--r--    1 root     root           197 Jan  3 13:22 update.conf
drwxr-xr-x    3 root     root          1024 Nov  9 15:55 webui

These files can be copied off the reMarkable with scp over ssh and then edited in a normal image editor that understands PNGs and copied back. Note that transparency, if present, is taken into account by the tablet (meaning that the former content remains visible where the PNG is transparent; this is used e.g. by sleeping.png in the 'light sleep' mode).

The filenames are reasonably self-explanatory, but it is worth noting that a second copy of splash.bmp is stored in /var/lib/uboot/ (where a FAT partition for booting is mounted): you have to copy it over there if you want it to be shown when you power up the reMarkable.

Also worth noting is that the reMarkable displays a progress sequence of dots in the middle while showing starting.png, so it might be worth adding your contact details (or other changes) where they won't be obscured by this graphic.

Upload with cURL[edit]

To copy files from a host computer to a USB-connected tablet, 'curl' is a command-line replacement for dragging and dropping files:

curl --form file=@myfile.pdf http://10.11.99.1/upload

Mounting the file system from Linux[edit]

You can use 'sshfs' to mount the file system on your tablet. This way, you can more easily browse and edit files on your tablet. First, ensure that you have sshfs installed on your Linux machine.

sudo apt-get install sshfs

Then create a writable catalog where you want to mount and run sshfs:

mkdir foodir; 
sshfs root@10.11.99.1:/home/root foodir

Adding PDF documents manually[edit]

The tablet has an embedded web server which can be used to copy documents to the tablet without having to use native apps.

First, connect your tablet with the USB cable and turn on the experimetal web server.

Then start a browser, pointing it to:

http://10.11.99.1/

Now you can drag and drop files into your tablet.

Connecting to WPA2 Wi-Fi[edit]

Since the first Remarkable software release (v1.2.0.344), press RM and go to WI-FI:

Select SSID

  • Enter EAP Method: PEAP
 other valid options: TTLS
  • Phase 2 Authentication: MSCHAPv2
 in case you chose TTLS above, choose PAP here; specifically: auth=PAP (yes, enter it exactly like this: "auth=PAP", credit to this page at HU Berlin).
  • Server CA certification: off
  • Identity: <domain>\<username>
  • Anonymous Identity: <empty> Press enter to go to next line
  • Password: <password>

Connecting to WPA2 Wi-Fi[edit]

  1. Open ssh session to your Remarkable
    Connect your device via usb. It then acts as a new network card. Open settings and go to "About" on your tablet. Use your favorite ssh client (e.g. Putty on Windows) and connect to the IP address mentioned on the bottom of the about page (most likely 10.11.99.1). Use 'root' as username and the provided password.
  2. Create wpa_supplicant configuration file
    For example, if you want to connect to the eduroam network (available on a lot of universities), you can use this example configuration file: https://www.cms.hu-berlin.de/de/dl/netze/wlan/config/eduroam/linux/wpa_supplicant.conf
    Put the file somewhere under /etc/wpa_supplicant/. I used /etc/wpa_supplicant/eduroam.conf
  3. Edit service file
    To actually use the new configuration, you have to change the systemd service (unit) file. Open /etc/systemd/multi-user.target.wants/wpa_supplicant@wlan0.service
    with e.g. vi and extend the ExecStart line with -c/etc/wpa_supplicant/eduroam.conf
  4. Restart service
    systemctl restart wpa_supplicant@wlan0.service
    or: just restart your Remarkable

credit goes to jfreax on reddit/r/RemarkableTablet

In some cases the /etc/systemd/multi-user.target.wants/wpa_supplicant@wlan0.service file might not be available. An alternative procedure is detailed below:

  1. Connect your device via usb. It then acts as a new network card. Open settings and go to "About" on your tablet. Use your favorite ssh client (e.g. Putty on Windows) and connect to the IP address mentioned on the bottom of the about page (most likely 10.11.99.1). Use 'root' as username and the provided password.
  2. Create wpa_supplicant configuration file
    For example, if you want to connect to the eduroam network (available on a lot of universities), you can use this example configuration file: https://www.cms.hu-berlin.de/de/dl/netze/wlan/config/eduroam/linux/wpa_supplicant.conf
    Put the file somewhere under /etc/wpa_supplicant/. I used /etc/wpa_supplicant/eduroam.conf
  3. Edit service file
    Open /lib/systemd/system/wpa_supplicant@.service
    with e.g. vi and extend the ExecStart line with -c/etc/wpa_supplicant/eduroam.conf
  4. Restart service
    systemctl restart wpa_supplicant@wlan0.service
    or: just restart your Remarkable

To debug connection issues do the following:

  1. Stop the wlan service systemctl stop wpa_supplicant@wlan0.service
  2. Manually run the wpa_supplicant tool: wpa_supplicant -C/var/run/wpa_supplicant -c/etc/wpa_supplicant/eduroam.conf -iwlan0

By running wpa_supplicant you should see output similar to this:

Successfully initialized wpa_supplicant
wlan0: Trying to associate with SSID 'eduroam'
wlan0: Associated with 48:ff:36:e5:d1:98
wlan0: CTRL-EVENT-EAP-STARTED EAP authentication started
wlan0: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=25
wlan0: CTRL-EVENT-EAP-METHOD EAP vendor 0 method 25 (PEAP) selected
wlan0: CTRL-EVENT-EAP-PEER-CERT depth=1 subject='/C=NL/ST=Noord-Holland/L=Amsterdam/O=TERENA/CN=TERENA SSL CA 3' hash=be4dd8c5d8
wlan0: CTRL-EVENT-EAP-PEER-CERT depth=0 subject='/C=BE/ST=Oost-Vlaanderen/L=Gent/O=Universiteit Gent/OU=DICT/CN=ugnps.ugent.be' hash=9c442326c372fcd43
wlan0: CTRL-EVENT-EAP-PEER-ALT depth=0 DNS:ugnps.ugent.be
wlan0: CTRL-EVENT-EAP-PEER-ALT depth=0 DNS:ugnps1.ugent.be
EAP-MSCHAPV2: Authentication succeeded
EAP-TLV: TLV Result - Success - EAP-TLV/Phase2 Completed
wlan0: CTRL-EVENT-EAP-SUCCESS EAP authentication completed successfully
wlan0: WPA: Key negotiation completed with 48:ff:36:e5:d1:98 [PTK=CCMP GTK=CCMP]
wlan0: CTRL-EVENT-CONNECTED - Connection to 48:ff:36:e5:d1:98 completed [id=0 id_str=]
Cwlan0: CTRL-EVENT-DISCONNECTED bssid=48:ff:36:e5:d1:98 reason=3 locally_generated=1
nl80211: deinit ifname=wlan0 disabled_11b_rates=0

Changing Timezone[edit]

Changing the timezone may be required for the development of custom applications, in particular ones that display time. Due to unknown reasons, the reMarkable interaface does not expose a visible clock to the user. Additionally, the reMarkable is equipped with an embedded version of Linux that does not provide the /usr/share/zoneinfo directory which typically contains timezone files that are symlinked to /etc/timezone.

Temporarily Changing The Timezone[edit]

To temporarily change the timezone for the current shell instance, you can set the TZ variable to the appropriate timezone

$ TZ="CET"
$ date
Fri dec  8 10:38:50 CET 2017

Note: The timezone change is restricted to the shell session in which it has been set. Attempting to retrieve the time outside of the current shell session will display the old timezone

Permanently Changing The Timezone[edit]

reZone script[edit]

The reZone script provided by the reHackable organisation will update the reMarkable timezone according to the host machine.

Download the script

$ curl https://raw.githubusercontent.com/reHackable/scripts/master/host/rezone.sh -o rezone.sh

Finally execute the script. If you opt to connect to your device trough wireless instead of USB, you may provide the IP address as parameter

$ chmod +x rezone.sh
$ ./rezone.sh

If no issues were raised, the timezone has been changed and the script will confirm the success.

Manually Updating the Timezone[edit]

To update the timezone manually, the following line must be edited in /etc/profile

TZ="UTC"           # Time Zone. Look at http://theory.uwinnipeg.ca/gnu/glibc/libc_303.html

To your new timezone (ie CET)

TZ="CET"           # Time Zone. Look at http://theory.uwinnipeg.ca/gnu/glibc/libc_303.html

After the line has been changed, save your changes. To confirm your new timezone, instance a new shell and execute date.

$ bash
$ date
Fri dec  8 11:23:46 CET 2017

Changing Suspend Time Delay[edit]

On Codex Version 1.2.0.344, the time interval before the device goes to light sleep or powers off is stored in /home/root/.config/remarkable/xochitl.conf

...
IdleSuspendDelay=1200000
...
SuspendPowerOffDelay=43200000
...

If the device is just updated, the configuration lines might not exist. In that case, go to settings -> power and disable then re-enable both Auto Sleep and Auto Power off. Both numbers are in milliseconds (i.e 1200000ms = 1200 seconds = 20 minutes). Restart the device (or the xochitl service) after changing the number.

Adding PDF files via ssh/scp[edit]

Using the script downloadable on github (after downloading via the RAW button be sure to set the executable flag via chmod +x pdf2remarkable.sh), you can upload PDF files to the tablet via the command line, as

$ pdf2remarkable.sh someFile.pdf someOtherFile.pdf

Here are the comments at the start of that script:

# Transfer PDF file(s) to a reMarkable
# Adrian Daerr 2017/2018 - public domain
#
# - The files will appear in reMarkable's top-level "My Files" directory,
# - After finishing all transfers, you have to restart the xochitl
#   service on the tablet in order to force a scan of its document
#   directory ${xochitldir} (so that you see the newly transferred
#   files), e.g. by sending the tablet the following command: 
#     ssh remarkable systemctl restart xochitl
#
# Disclaimer and liability limitation:
# [see also all-caps text borrowed from GPL below]
# - This is a dirty hack based on superficial reverse-engineering.
# - Expect this script to break at any time, especially upon a
#   reMarkable system upgrade
# - I am not responsible for any damage caused by this script,
#   including (but not limited to) bricking your reMarkable, erasing
#   your documents etc. YOU ARE USING THIS SOFTWARE ON YOUR OWN RISK.
#
# Disclaimer of Warranty.
#
# THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
# APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE
# COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM
# “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE
# RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.
# SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
# NECESSARY SERVICING, REPAIR OR CORRECTION.
#
# Limitation of Liability.
#
# IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
# WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO
# MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE
# LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
# INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
# INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
# DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
# YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE
# WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS
# BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#
# Prerequisites:
#
# * The ssh access has to be configured under the host alias 'remarkable',
# e.g. by putting the following in .ssh/config :
# | host remarkable
# |        Hostname 10.11.99.1
# |        User root
# |        ForwardX11 no
# |        ForwardAgent no
# See also the variable "xochitldir" below
#
# * Beyond core utilities (date, basename,...), the following software
#   has to be installed on the host computer:
# - uuidgen
# - imagemagick (or graphicsmagick)
[snip]

The script works with versions 0.0 and 1.2 (current version as of January 2018) of the reMarkable software.