### Source SDK Environment and Check Compiler Source: https://developer.remarkable.com/documentation/sdk This example demonstrates how to source the SDK's environment setup file to configure your shell for cross-compilation. It then verifies that the standard 'CC' environment variable is correctly set to the SDK's cross-compiler. ```shell source /home/myuser/sdk/environment-setup-cortexa53-crypto-remarkable-linux echo $CC aarch64-remarkable-linux-gcc -mcpu=cortex-a53 -march=armv8-a+crc+crypto -mbranch-protection=standard --sysroot=/home/myuser/sdk/sysroots/cortexa53-crypto-remarkable-linux ``` -------------------------------- ### Build Application using CMake Source: https://developer.remarkable.com/documentation/qt_epaper Commands to build the Qt Quick application on a Linux environment. This involves sourcing the SDK environment setup script, configuring the build with CMake, and then compiling the project. The output binary will be located in the 'build' directory. ```bash source ~/codex-sdk/rm2/VERSION/environment-setup-cortexa7hf-neon-remarkable-linux-gnueabi cmake . -B build cmake --build build ``` -------------------------------- ### Install SDK to Custom Directory Source: https://developer.remarkable.com/documentation/sdk This command shows how to run the SDK installer script and specify a custom directory for installation. The '-d' flag indicates the desired destination directory, and the installer will prompt for confirmation. ```shell ./meta-toolchain-remarkable-4.0.813-ferrari-public-x86_64-toolchain.sh -d sdk ``` -------------------------------- ### Set SDK Execute Permission Source: https://developer.remarkable.com/documentation/sdk This command demonstrates how to set the execute permission for the SDK installer script. This is a prerequisite step before running the installer to ensure it can be executed. ```shell chmod u+x meta-toolchain-remarkable-4.0.813-ferrari-public-x86_64-toolchain.sh ``` -------------------------------- ### Update Udev Rules for USB Access (Linux Shell) Source: https://developer.remarkable.com/documentation/recovery-for-linux-host Guides through updating udev rules to grant USB access to the reMarkable tablet. This involves navigating to the directory containing the 'uuu' binary, executing 'uuu -udev' to generate rules, and then applying them system-wide. This process requires root privileges for modifying system files. ```shell cd /tmp/reMarkable/data ./uuu -udev sudo sh -c "./uuu -udev > /etc/udev/rules.d/70-uuu.rules" sudo udevadm control --reload ``` -------------------------------- ### Run Qt Quick Application on reMarkable Source: https://developer.remarkable.com/documentation/qt_epaper Steps to deploy and run the built Qt Quick application on a reMarkable device. This includes copying the executable using SCP, connecting via SSH, stopping the default UI ('xochitl'), setting environment variables for touch event handling (especially for different reMarkable models), and launching the application using the 'epaper' platform backend. Finally, restarting the default UI is necessary. ```bash scp hello_remarkable root@10.11.99.1: ssh root@10.11.99.1 systemctl stop xochitl # reMarkable 1 only: export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS="rotate=180" # reMarkable 2 only: export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS="rotate=180:invertx" QT_QUICK_BACKEND=epaper ./hello_remarkable -platform epaper # when you are done testing the application, stop it with ctrl-c systemctl start xochitl ``` -------------------------------- ### main.cpp: C++ Launcher for Qt Quick Application Source: https://developer.remarkable.com/documentation/qt_epaper The C++ main function initializes the Qt GUI application and the QQmlApplicationEngine. It loads the QML module and handles potential object creation failures. This serves as the entry point for the Qt Quick application. Dependencies include QGuiApplication and QQmlApplicationEngine. ```cpp #include #include int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QQmlApplicationEngine engine; QObject::connect( &engine, &QQmlApplicationEngine::objectCreationFailed, &app, []() { QCoreApplication::exit(-1); }, Qt::QueuedConnection); engine.loadFromModule("remarkable_example", "Main"); return app.exec(); } ``` -------------------------------- ### Compile and Run 'Hello World' on reMarkable (C) Source: https://developer.remarkable.com/documentation/sdk This snippet demonstrates how to compile a simple C 'Hello World' program on your PC, copy it to the reMarkable device via SCP, and then execute it using SSH. Ensure developer mode is enabled and you have network access to the device. ```c #include int main(int argc, char** argv) { printf("Hello world!\n"); return 0; } ``` ```shell # Compile $CC helloworld.c -o helloworld # Copy to device scp helloworld root@10.11.99.1: # Run ssh root@10.11.99.1 ./helloworld # Prints "Hello world!" ``` -------------------------------- ### CMakeLists.txt for Qt Quick Application Source: https://developer.remarkable.com/documentation/qt_epaper This file configures the build system using CMake for a Qt Quick application. It specifies the required Qt components, sets up the project, and defines the executable and QML module. Dependencies include Qt6 and its Quick component. ```cmake cmake_minimum_required(VERSION 3.16) project(hello_remarkable VERSION 0.1 LANGUAGES CXX) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(Qt6 REQUIRED COMPONENTS Quick) qt_standard_project_setup(REQUIRES 6.5) qt_add_executable(hello_remarkable main.cpp) qt_add_qml_module(hello_remarkable URI remarkable_example VERSION 1.0 QML_FILES Main.qml) target_link_libraries(hello_remarkable PRIVATE Qt6::Quick) ``` -------------------------------- ### Copy libqsgepaper.so for Version 3.17 Source: https://developer.remarkable.com/documentation/qt_epaper Instructions to copy the necessary graphics library ('libqsgepaper.so') to the reMarkable device for software version 3.17. This is typically done after building the application and before running it, to ensure proper rendering. It involves navigating to the SDK directory, copying the file, and then moving it to the correct location on the device via SSH. ```bash cd ~/codex-sdk/rm2/sysroots/cortexa7hf-neon-remarkable-linux-gnueabi/usr/lib/plugins/scenegraph scp libqsgepaper.so root@10.11.99.1: ssh root@10.11.99.1 mkdir /usr/lib/plugins/scenegraph mv libqsgepaper.so /usr/lib/plugins/scenegraph/. ``` -------------------------------- ### Main.qml: reMarkable Qt Quick UI Source: https://developer.remarkable.com/documentation/qt_epaper This QML file defines the graphical user interface for the reMarkable application. It creates a main window that fills the screen and displays text. A MouseArea is used to toggle the visibility of the text upon touch events. Dependencies include QtQuick and QtQuick.Window. ```qml import QtQuick import QtQuick.Window Window { width: Screen.width height: Screen.height visible: true Text { id: hello_text x: 50 y: 50 font.pixelSize: 32 text: "Hello reMarkable!" } MouseArea { anchors.fill: parent onPressed: { hello_text.visible = !hello_text.visible } } } ``` -------------------------------- ### Check reMarkable OS Version Source: https://developer.remarkable.com/documentation/sdk This snippet shows how to check the reMarkable OS version running on your device. It involves executing a command on the device itself to retrieve and display the OS version information from the '/etc/os-release' file. ```shell cat /etc/os-release |grep ^VERSION= # VERSION="4.0.813 (kirkstone)" ``` -------------------------------- ### Trigger Software Restore (Linux Shell) Source: https://developer.remarkable.com/documentation/recovery-for-linux-host Initiates the software restore process for a reMarkable device in recovery mode. This command requires the 'rm_recover' tool to be executable. It triggers a download of the 'uuu' helper tool. ```shell ./rm_recover restore ``` -------------------------------- ### Make Recovery Tool Executable (Linux Shell) Source: https://developer.remarkable.com/documentation/recovery-for-linux-host This command makes the downloaded recovery tool executable on a Linux host. It's a prerequisite for running recovery or artifact retrieval commands. No specific inputs or outputs are defined, but it modifies file permissions. ```shell chmod u+x rm_recover ``` -------------------------------- ### Retrieve Artifacts (Linux Shell) Source: https://developer.remarkable.com/documentation/recovery-for-linux-host Retrieves artifacts, specifically the 'uuu' helper tool, from the reMarkable device. This command is used after triggering a download via './rm_recover restore' and helps in accessing device information. ```shell ./rm_recover artifacts ``` -------------------------------- ### Remount reMarkable root partition as read-write Source: https://developer.remarkable.com/documentation/developer-mode This command makes the root file system of your reMarkable tablet writable, allowing modifications to system files. This change is temporary and will revert to read-only after a reboot. Use with caution as incorrect modifications can prevent the device from booting. ```shell mount -o remount,rw / ``` -------------------------------- ### Unmount reMarkable /etc directory overlay Source: https://developer.remarkable.com/documentation/developer-mode This command unmounts the overlay file system for the /etc directory on your reMarkable tablet, allowing changes to configuration files within /etc to be persisted across reboots. This is a more specific way to modify protected system configurations. ```shell umount -R /etc ``` -------------------------------- ### Enable SSH over WiFi on reMarkable Source: https://developer.remarkable.com/documentation/developer-mode This command enables SSH access over WiFi on your reMarkable tablet. It modifies a configuration flag on the home partition. This utility can also be used to disable SSH over WiFi by running `rm-ssh-over-wlan off`. ```shell rm-ssh-over-wlan on ``` -------------------------------- ### Connect to reMarkable via SSH Source: https://developer.remarkable.com/documentation/developer-mode This command allows you to establish an SSH connection to your reMarkable tablet when connected via USB. It requires the root username and the device's IP address, which can be found in the device's settings. ```shell ssh root@10.11.99.1 ``` -------------------------------- ### Factory Reset reMarkable Tablet (Linux Shell) Source: https://developer.remarkable.com/documentation/recovery-for-linux-host Performs a factory reset on the reMarkable tablet, which includes reflashing the software and erasing all user content. This command will disable developer mode if it was previously enabled. It requires the 'rm_recover' tool to be executable. ```shell ./rm_recover reset ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.