Skip to content

Hacking and development notes

dae1804 edited this page Feb 27, 2018 · 6 revisions

Useful notes for tweaking or debugging okreader installs.

Resetting your Kobo

  1. Hold down the power switch for about thirty seconds to turn your Kobo off.
  2. Wait about five seconds
  3. Slide the powerswitch again to boot the Kobo.

Don't use the "reset" switch (the small hole on the bottom of the kobo, near the micro USB port). On at least the Kobo Glo, this will corrupt your okreader install!

Setting a root password:

In the built-in terminal editor (tools menu, second page), enter these commands, substitution yourpasswordhere with your password of choice:

echo 'root:yourpasswordhere' | chpasswd
reboot

The Kobo will take about 30 seconds or so to restart (watch for the light near the powerswitch to cycle).

Once set, the password will be retained across reboots.

Connect to your Kobo over SSH:

  1. Set a root password as above.
  2. Turn on WiFi (settings menu, network, check WiFi connection).
  3. Obtain your IP address (settings menu, network, network info; or run ifconfig in the terminal emulator)
  4. ssh [email protected]

Be aware that the Kobo (or just its wlan card?) will go into powersave after a few minutes of no keypresses on its screen, at which point your SSH connection will drop.

Run koreader with debugging enabled

You need to be connected over SSH to do this, as the terminal emulator is part of koreader.

  1. Set a root password and connect via SSH (as above)
  2. You need to kill the existing koreader instance, and the okreader.sh shell script that spawns it.
  3. Kill okreader.sh first, as it will otherwise re-spawn koreader so long as it is running:
    1. ps aux | grep okreader.sh to find the PID of the bash instance running the script
    2. kill <PID> to terminate that process.
  4. Now kill koreader itself. koreader is a Lua program run by the luajit executable. So:
    1. ps aux | grep luajit, then kill all PIDs for LUA JIT processes running ./reader.lua:
    2. kill <PID>
  5. At this point, the existing KOReader instance is dead, and your Kobo's touchscreen should be non-responsive. To start a new instance, with debugging enabled:
    1. cd /opt/koreader
    2. ./reader.lua -d
  6. You should see some output as koreader starts up, and be left with a working touchscreen.

When finished debugging, you can Ctrl+C to stop koreader, and use the reboot command to restart your kobo.

Internal storage partition shows as unformatted on Windows when connecting over USB

Edit /etc/rc.local, and change the line that reads

modprobe g_file_storage file=$DATA_PART

to

modprobe g_file_storage file=$DATA_PART removable=y
Clone this wiki locally