Showing posts with label nook. Show all posts
Showing posts with label nook. Show all posts

May 15, 2011

Nook: update busybox version & use Putty to connect to Nook (ADB)

Disclaimer: this post is addressed to advanced users, that have experience with Linux command line interface, and that are confortable connecting to Nook using ADB (or telnet/ssh).

The busybox version included in Nook is quite old. Updating it to a new one could be useful, for  having access to both new commands and features.

The procedure to update busybox is really simple:
  1. download and unizp busybox (or directly from busybox site);
  2. (optional) to be on safe side, make a backup of current busybox binary, placed into /system/bin;
  3. using adb, copy new busybox executable to nook, folder /system/bin, renaming it busybox;
  4. change owner and permissions of new busybox file:
    chmod 744 /system/bin/busybox
    chown system.system /system/bin/busybox
In my case (maybe using other configuration this could be different), using the updated busybox results in a easier usage of ADB enhanced Putty client to connect to Nook: infact, both autocomplete by tab key and command history (up key) work correctly.

Tip: if you add in file /init.rc the following row (about at the start of the file, where also others env variables are set):
export ENV /ash_startup_script ash
you can then create the file /ash_startup_script. In this file you can add whatever you want, that will be executed at session shell creation. In my case, for instance, i put the alias for ll, so that i don't have to define it manually each time i start a shell session:
alias ll=ls -l"


    Nook: install Nano text editor

    Disclaimer: this post is addressed to advanced users, that have experience with Linux command line interface, and that are confortable connecting to Nook using ADB (or telnet/ssh). The text editor Nano is not accessible by Nook (android) user interface.

    The linux version installed on Nook firmware lacks any kind of text editor (nano, vi, emacs, and so on), normally present on linux distributions.
    Having a text editor is really useful for advanced users, in order to quickly show and edit configuration files. Just to make some example: wifi configuration (wpa_supplicant.conf); startup configuration (init.rc).
    Nano is a really simple to use editor, and it's easily installable on Nook. Of course, a rooted Nook is necessary; but if you don't have a rooted Nook, you probably will not need any linux CLI text editor.

    Installation procedure:
    1. download and unzip nano;
    2. download terminfo;
    3. copy both files to your Nook, using adb;
    4. move nano to folder /system/bin;
    5. set appropriate owner and permission to nano executable:
      chown system.system /system/bin/nano
      chmod 755 /system/bin/nano
    6. unzip terminfo and set correct permission:
      busybox tar -xzvf terminfo.tar.gz -C /
      chmod -R 0755 /system/etc/terminfo
      chmod -R 0644 /system/etc/terminfo/?/*
    7. set the following env variables:
      export TERM=xterm
      export TERMINFO=/system/etc/terminfo
    8. now you should be able to launch nano from your shell:
      nano <filename>
    9. (optional) you need to set the env variable of step 7) each time you launch a shell; therefore, it could be convenient to set them automatically during initialization of Nook, adding the following two lines to file /init.rc (about at the start of the file itself, where a lot of env variables are set):
      export TERM xterm
      export TERMINFO /system/etc/terminfo
    That's it!

    March 12, 2011

    Nook: alternative applications to standard library

    The standard library application of Nook has some limitations; for instance:
    • since it doesn't handle folders (i.e. all book will be shown in a single list), it is quite uncofortable to use it when you have a large collection of books loaded into Nook;
    • it misses some nice features like the cover view.
    Luckily, the Nook developers community provides some valid alternatives to the default library. Of course, to be able to install and use them, you need a rooted Nook; but this should not be a big problem!


    What i consider the best library application is the "File Browser" by Nomad. It features a really nice and fast cover strip mode, that allows you to choose books by sliding the covers (on the touch screen display). Moreover you can (optionally) navigate trhoughout your contents in folder-mode. This is really useful when you have a large collection of books, organized in a tree structure.

    Original thread in russian by the author, with further info and download here (translation to english).
    Please note that the author publishes 2 versions:
    • one will become automatically the default library of Nook;
    • the other will instead be installed as a standalone application;
    so pay attention to choose the one you prefer.
    The author often releases new versions to correct bugs or introduce new features, so check his thread out once in a while to see if a new version is available!


    Another valid option is NookLibrary by Nookdev community. More or less it offers the same features of the application by Nomad, but in my opinion is slightly slower and a bit less comfortable in its usage. My advice in any case it's just to try both applications and see which one better suit your needs.
    Here you can find more info and download the last version (currently 0.1.7).

    Nook: update for Firmware Improvements (v1.2 available)

    Minor update for my Nook Firmware Improvements.
    Version 1.2 include a better handling of "Full-Screen" feature, that now is handled directly through the reader menu.
    Moreover, both Orientation and Full-Screen setting are now persisted across reboots.
    Again (see this post), all credits for these new features go to user darkker of russian forum "The Electronic Book".

    As usual, instructions and download on this page.

    March 5, 2011

    Nook: full-screen mode and landscape orientation on reader

    With the version 1.1 of my firmware improvements for Nook, i introduced two more features for default Nook eBook-Reader application:
    • choose text orientation between portrail (default) and landscape;
    • choose to display or hide the top status bar (with title, battery status, time) in order to maximize the reading area.
    For the orientation feature, all credits go to user darkker of russian forum "The Electronic Book". I just merged the modification he made with my code (in order to keep also the other improvements i made). This is the original link in russian (and its translation to english) to the thread where you can find more info about his implementation of this feature and its author.

    As usual, instructions and download on this page.

    January 16, 2011

    Nook: new version of my Firmware improvements

    I made a complete refactoring of the improvements i made on Nook firmware, and already described in the previous posts:
    With the last version, i introduced a configuration file that easily allow to enable / disable the various hacks and also to configure some parameters, without the need of messing with ADB.

    Further info and download on this page.

    December 31, 2010

    Nook: Shutdown image hack

    By default, when you power off the Nook reader (long-clicking the power button) the eInk display will be set with an all-white image (i.e. no image at all).
    As you probably already know, a nice eInk display feature is that they don't need any power to display any kind of image: the power is only needed during page transitions. Therefore it is possible to let the Nook display any given image when it is powered off without any effect on battery life.
    Unfortunately, this (pretty useless, i admit; it is just "for fun") feature is not present on original Nook firmware, so i decided to implement it with a small modification of firmware (actually, of an android system library).

    More details and download on this page.

    December 18, 2010

    Nook: updated version 1.2 of Font Hack available

    The new version 1.2 of Font Hack for Nook is available.
    This version fixes a small bug that prevented the right indication of the currently used font in Preferences Menu of Epub Reader application.
    Moreover, now if the file "name of the font.fontname" is imissing, the label "unknown font X" is used as font name instead of the corresponding default font of Nook, so to avoid possible ambiguities.

    Further details and downloads in this page of the blog.

    December 17, 2010

    Nook Screensaver set: Piranesi - Carceri d'Invenzione

    A nice feature of Nook (and, indeed, of many other ebook readers) is the possibility of using custom screensaver.
    Actually, there would be no need for using a screensaver on an eInk display (on the other end, they also don't have almost any side effect, even on battery life); so its only function is just to let you enjoy nice pictures!

    I created a screensaver set collecting the famous and beautiful series of (16) prints The Prisons ("Carceri d'Invenzione") by the Italian artist Giovanni Battista Piranesi; the images are converted and optimized for usage on Nook (and any other eInk reader with display size of 800x600 px).
    Some samples of the image set:


    You can download the entire set here.

    The installation on Nook is pretty simple and could be done on any (either stock or root) firmware version. Simply unzip the archive and copy the folder containing the 16 images into folder "my screensaver" of the internal SD drive of Nook (of course, after connecting the Nook to a PC through USB). Then config this screensaver on Nook clicking, starting from Home screen: Settings -> Display -> Screensaver -> "Piranesi - Carceri d'Invenzione".

    Source images of Piranesi prints from here.

    December 4, 2010

    Nook: How to use any font in ePub reader

    The ePub reader application of Nook provide the feature of choosing one of the 3 font families included (i.e.: Amasis, Helvetica Neue, Light Classic).
    But there are many reasons why one would have the chance of using other fonts for viewing his own ePub documents:
    • the standard fonts are not able to correctly render all the characters used in some languages (for instance, eastern-europe languages based on Cyrillic alphabet);
    • you may find more readable, or simply like more, other fonts;
    • you just want to have full control on any geek gadget you own.
    You can find the complete procedure here.

    November 30, 2010

    Nook: Font Management and Troubleshooting

    The Nook ebook reader allows by default to choose amongst 3 different font families, when reading epub documents:
    This is done quite simply using the menu system of reader application, through the touch screen.
    But probably it happened to you that on some epub document it is not possible to change the displayed font family; often, in these cases you cannot change the font size, too.
    Why this happens? Almost surely, the cause is a bad realized epub document.
    If you are curious, you can just have a look at your epub document "inside". Simply, change the extension of the document from epub to zip. Now double-click on it and you see the component of your file. Basically, you will find (almost always):
    • some files containing: document meta-data; table of contents structure; and other needed stuff;
    • xhtml files: these files are the main content of your document; they really are html document, and in fact you could open them with any web browser;
    • image files (could be on png, jpg or gif format): any image contained into the document;
    • css files: the style sheets containing all the information to correctly format the content of xhtml files.
    One of the information usually contained into CSS files is the font that is to be used to render the content of the (x)html files. This is normally done applying a CSS similar to this:
    body{
      font-family: Georgia, Garamond, serif, sansserif, monospace;
    }
    p{
      margin:0pt;
      text-indent:0em;
      text-align: justify;
      font-size: 1.00em;
    }
    In the first part of this snippet, we ask the browser (in our case, the epub Reader application) to render the entire body of our web page (document chapter), unless otherwise specified, using as font "Georgia"; as second choice (in case font "Georgia" is not available on our environment) font "Garamond" is to be used. In case it is not possible to use this font, too, then there is a sort of fall-back mechanism. In fact, we ask the browser to use, in order of preference: any font of type "serif" (for instance: Times New Roman); any font of type "sans-serif" (for instance: Verdana); as last choice, any font of type "monospace" (for instance: Courier).
    In the second part of the snippet, you can see that there are the setting to render a generic paragraph element <p>: here, there is no override of the above mentioned font-family declaration for element <body>: therefore that also applies to every <p> element.
    There is still a missing link for browser to correctly render a font: how could a browser know what we mean by "Georgia", "Garamond" or any other font? how could it know that "Georgia" is of type serif, "Verdana" is of type sans-serif and so on? Actually, there is a specific CSS property just to do that:
    @font-face {
      font-family: Georgia, serif;
      font-style: normal;
      font-weight: normal;
      src: url("Georgia-roman.ttf")
    }
    @font-face {
      font-family: Georgia, serif;
      font-style: italic, oblique;
      font-weight: normal;
      src: url("Georgia-italic.ttf")
    }
    @font-face {
      font-family: Georgia, serif;
      font-style: normal;
      font-weight: bold;
      src: url("Georgia-bold.ttf")
    }
    
    It's not difficult to understand how the above code snippet works. It defines the font called "Georgia" (and declare it is a font of type serif), respectively in the style plain, italic and bold; and tell the browser what is the location of the True Font files to be used to render the font.
    Now the puzzle is complete: for each html element, the browser knows what is the font to be used; and for each font, he knows what is the True Font file to be used to render it.
    In our context, the browser is the epubReader application. The html page is any of the xhtml file embedded into the epub document. Normally, the first of the above code snippets is contained into one of the CSS files embedded into the epub document.
    And normally, there is no need to include any @font-face directive into the epub document, leaving this duty in charge of the Reader application (that will dinamically append a CSS with the needed @font-face directives to the xhtml file to render).
    You should now guess how the font change is possible for Reader application: when we choose one of the 3 font in touch screen display, the reader application simply changes the content of CSS file that contains the @font-face directives, so that they use the wanted TTF (or OTF) file.

    So we can come back to the original question: why for some epub documents the font changing does not work?
    In most cases, this is due to two possible causes:
    1. the CSS embedded into epub contains some @font-face declarations (and of course, the epub also contains the corresponding font files), and they override the ones contained in the CSS appended by Reader application; this could be a desired feature provided by the epub designer, for various reasons (aesthetic, compatibility, and so on);
    2. the CSS appended by Reader application, that define the font (@font-face) selected by user, do not define (for obvious reasons) specific font family names, but just font types (serif, sans-serif): if the font-family directives included into epub just contains exact font name ("Georgia") but does not provide any feedback to generic font types, the html rendering engine of the Reader application will obviously not be able to associate the required font name to its font type. It is a common (and good!) practice to provide always some fall-back when declaring a font family into the CSS (like is done in the first snippet, where both serif, sans-serif and monospace are mentioned).
    In both cases, the only solution to allow font-changing feature involves editing the epub document; depending to how the epub has been realized, this could be either an easy or a rather complicated task.
    Some hints about it will be provided in next posts.