eBookwise-1150-Linux

From MobileRead
Jump to: navigation, search

Contents

[edit] Introduction

The eBookwise-1150 manufactured by eBook Technologies is a very nice lower priced piece of reading hardware. The only problem with it is the same for a lot of computer hardware and that is all of the software to manage it is for windows and mac only. It would be more correct to say that the official software to manage this device is windows and mac only. There have been for years utilities that have been written by individuals that give you most of the functionality that you get with windows based software. This article will attempt to gather some of those utilities for Linux into one place so that people wanting to use their eBookwise-1150 without having to switch back and forth to a windows or mac machine can do so.

[edit] Using the Smart Media Card

The most common method and the quickest is to use a card reader that recognizes Smart Media cards to get your imp files onto the reader. With this method nothing special has to be done; just plug the SM card into the reader and copy the files that you want onto it and read. The eBookwise-1150 will automatically convert any imp format files into its own internal format and they will then be available in your bookshelf.

[edit] Connecting the eBookwise-1150 to a USB port

This takes a little more effort but once it is done you can transfer your books to the reader by simply using the USB cable that came with your reader to an open USB port on your computer. You will then be able to access your online bookshelf with eBookwise or whoever you bought the reader from.

[edit] Installing the Software

The first step to getting your eBookwise-1150 connected to your computer is to gather the needed software. The first thing that you will need is eb1150. This is a daemon that will allow the reader to connect to your PC through a USB port. This alone will allow you to access your online bookshelf, but you can also load books that you have converted directly to the reader from your PC without having to go through your online bookshelf. To do this you will need either linreb or ebookutils. You do not need both but I mention them both here and cover the installation steps so that you can try them and decide for yourself which is better for you. Both of these will allow you to setup a local version of your online bookshelf. Then you only need to plug the reader in and transfer those files from the computer to the reader just as you would with your normal online bookshelf.

[edit] eb1150

This small daemon program allows the reader to use USB networking to access your local network. To install this download the source code from one of the following links, this version will compile under ubuntu 8.04 / this version will compile under ubuntu 9.10 or you can try the binary only package for ubuntu 9.10 64 bit if you aren't set up to compile programs. (If you use the binary you can skip installing the libusb devel package mentioned below and skip the configure make make install step. Just extract the binary and copy it somewhere in your path ie. /usr/bin, or /usr/local/bin.) This program needs libusb installed before it will compile. With most Linux distros you will also need to install the libusb-dev or libusb-devel package as well. After that is done unzip the eb1150 archive and change to the created directory. From here just do the ./configure, make and make install steps as you would for any other source package.

./configure
make
sudo make install

Once it is installed find that USB cable that came with eBookwise-1150 and plug it in. Don't turn on the eBookwise-1150 just yet, first open two terminals in the first one issue this command. NOTE you might have to be root for this to work.

tail -f /var/log/messages

This will let you see what is going on when the eBookwise-1150 is turned on and the computer notices it. Here is what shows on mine. You should see something similar.

Aug 24 03:12:19 festus kernel: [30230.144230] usb 2-1: new full speed USB device using ohci_hcd and address 49
Aug 24 03:12:20 festus kernel: [30230.231330] usb 2-1: configuration #1 chosen from 1 choice

Now that the computer knows the reader is there its time to try out eb1150. In the second terminal start eb1150. For now we just want to see if the installed program is going to work so it will need to be started with root privileges. We'll fix that later for now just start it and let it run as root.

>$ sudo eb1150

or if you don't have sudo

>$ su
enter root password:
>$ eb1150

You should see this in the terminal.

eb1150 0.1 (Dec 19 2007) - eBookWise/GemStar 1150 communication daemon
Licensed under the GNU General Public License. ABSOLUTELY NO WARRANTY.
See the GNU GPL for details.
Found eBook 1150, attempting to open ...Success
Socket created 4

If you got that its working and you can now try going to your personal bookshelf. Try tapping the Online Bookshelf tab in the library screen of your eBookwise-1150. You should see something like this in the terminal.

gethostbyname : 207.158.6.50
Socket created 6
Connected to 207.158.6.50:80
Sent: 183 byte(s)
Recv: 560 byte(s)
socket closed
Error: Recv failed (errno = 9)
gethostbyname : 207.158.6.50
Socket created 6
Connected to 207.158.6.50:80
Sent: 611 byte(s)
Recv: 914 byte(s)
socket closed

The eBookwise-1150 will show you your online bookshelf if you have already registered the device.

Now that you know the eb1150 daemon is working hit ctrl-c in the terminal where it is running to stop it. Now it needs to be fixed so that it doesn't need to have root privileges to run. This means that a udev rule needs to be added so your normal user has permission to read and write to the USB port that the eBookwise-1150 is hooked to. This rule is just a simple text file added to the directory /etc/udev/rules.d along with all of the files full of rules about how to handle different devices in your computer. Open a text editor as root and add this line to a file.

SUBSYSTEM=="usb", ATTR{product}=="eBook", MODE="0660", GROUP="plugdev"

Save the file as /etc/udev/rules.d/99-ebook.rules. The 99 at the beginning of the file name should insure that this is the last set of rules that get read and will change the permissions for the eBookwise-1150 when it is plugged into one of the USB ports. You may or may not have to restart udev to get it to use the new rule. To restart it go back to the terminal with this command.

>$ sudo /etc/init.d/udev restart

Now to test it out as a normal user. Close the terminal you were using and open another one or just make sure you are no longer root in that terminal. If you used sudo in front of the commands you are not. Just like before but without root privileges...

>$ eb1150

You should get the same results as the first test but now you are no longer running it with root privilege. When you are through experimenting go ahead and stop eb1150 with ctrl-c again.

[edit] linreb

Note that ebookutils, discussed below is easier to install and use.

While it is nice to be able to use eb1150 with the USB ports on your computer to get full speed access to your online bookshelf it is even nicer to use it with linreb so that you can have a local bookshelf where you can put your own personal content without having to go through the hassle of uploading files and then downloading them again with the eBookwise-1150. The program linreb works something like GeB Librarian. It intercepts the eBookwise-1150's requests to the online bookshelf server and uses content on your personal computer.


Download linreb http://www.mobileread.com/forums/attachment.php?attachmentid=15662&d=1219839151

Unzip the linreb archive and change to the directory that it creates in a terminal. There all you need to do is issue the command:

>$ make

It should compile and leave you with an executable named linreb. Now then before we are ready to try it out some set up on the eBookwise-1150 needs to be done first. Go to Settings Phone Connection in the eBookwise-1150. On this page check mark the Use proxy for USB box. Then tap the HTTP proxy address box and the keyboard will pop up. Put the ip address of your computer here 127.0.0.1 should work. Then tap the next button and enter the port number 9090 and tap enter. This is the port that linreb listens to by default. Go back to the library page when you are done and turn off the eBookwise-1150.


Back to the terminal where you compiled linreb. Start it running with this command.

>$ ./linreb -v

It needs to be started in the same directory where the sub-directories content, shelf and store are. The shelf directory is where you can put your imp files to be transferred to the eBookwise-1150. After starting it up you should see a message in the terminal similar to this.

LinReb v0.2 Build 23-Aug-2008
Simple eLibrarian for REB1200/EBW1150
Bookshelf from     "shelf/"
Bookstore from     "bookstore/index.html"
Html content from  "content/"

Listening on INADDR_ANY:9090

Loaded 2 files in bookshelf

Now turn on the reader and open another terminal and start eb1150 with the -h option which is the proxy host ip you entered in the eBookwise-1150 settings.

>$ eb1150 -h 127.0.0.1

Tap the Online Bookshelf tab on the reader and it should show you the contents of the shelf directory on your reader just like it would your real Online Bookshelf. You should see something similar to this in the terminal that is running linreb.

GET http://bookshelf.ebooksystem.net/bookshelf/default.asp?INDEX=1&REQUEST=100&SHOW_HIDDEN=NO
        Sent BOOKLIST 175 bytes.

You can now move linreb to someplace in your path. Just remember that linreb should be started in the same directory where your shelf bookstore and content directories are.

[edit] ebookutils

This is a suite of tools written by the Mobile Read member ashkulz and hosted at http://ebookutils.berlios.de . The original discussions of impserve (now part of ebookutils) can be found in the thread at this link http://www.mobileread.com/forums/showthread.php?t=28363 . The impserve program is the one that handles serving local content to the eti readers. Setting this up does not require any compiling of source code as the program is written in python. All that is needed is to unzip the archive in the location where you want it to reside. You will get a directory tree that looks something like this.

ebookutils-0.4
    impmake
    impserve
        content  
        impserve  
        plugins
        BeautifulSoup.py
        BeautifulSoup.pyc 
        run.py		
    AUTHORS  
    LICENSE  
    README  
    VERSION  
    update_version.py

Once you have the resulting directory tree where you want it there are a couple of ways that you can set it up to run. The first involves setting the executable bit on the file ebookutils-0.4/impserve/run.py and then creating a symlink to the file somewhere in your path. The other is place a short bash script somewhere in your path that will run the the file ebookutils-0.4/impserve/run.py by calling python and passing any parameters through the script.

To use a symlink just create the link somewhere in your path. I keep a bin directory under my home directory so that I install scripts there without having to place them in the system directories. So assuming that the path to the file run.py is /home/username/bin/ebookutils-0.4/impserve/run.py to create the symlink open a terminal and change to the directory /home/username/bin then use this command.

ln -s ebookutils-0.4/impserve/run.py impserve

For this to work the executable bit on run.py has to be set, chmod +x run.py.

The second method uses this short bash script to start impserve.

#!/bin/bash

python ~/bin/ebookutils-0.4/impserve/run.py $1 $2 $3 

NOTE(As the version numbers change on the ebookutils releases you will need to edit the paths in the above examples to reflect the true ebookutils path.)

Just copy and paste it into an editor and save it somewhere in your path as run_impserve. Again this assumes that the ebookutils directory tree is under the bin directory in your home directory. If that isn't where you put it just change the path in the script to where run.py is. Then set the executable bit on this bash script and you can use it to start impserve.

To test impserve set up the reader just as you did with the linreb program. On the settings phone connection page check the use proxy for USB box and then enter the ip 127.0.0.1 in the http proxy address field and the port number 9090 in the http proxy port field. Then start eb1150 as described before with the -h 127.0.0.1 switch and then in another terminal start impserve by whichever method you picked. With either method you should be able to pass it command line parameters if you need to. The ip and port values can be changed with the -a and -p switches if you need to do that, though the default values are usually just fine. To start it using the bash script above just type

run_impserve ./

at the prompt. Note the dot slash this tells impserve to start in the directory where it was started and find all of the imp format books in that directory and those below it and add them to the online bookshelf. You can also give a full path to use as the starting directory and impserve will use that to search for books. When impserve starts you should see something similar to this in the terminal where it is running.

Loaded plugin: AdjustHtml.py
Loaded plugin: AdjustQueryString.py
impserve 0.4: starting server on 0.0.0.0:9090

If the online bookshelf tab is tapped on the reader you should see all of the imp format books that impserve found listed there and be able to load them on the reader.

[edit] Creating Imp format books

This really isn't possible with any native applications. The ones that are avialable run only on windows and mac, but they can be made to work just fine using wine.

[edit] eBook Publisher

This application is a free download from eBook Technologies the latest version can be found here, and you can read some more about using eBook Publisher here. It will install and run fine in wine allowing you to create and preview the imp format eBooks that are needed by the eBookwise-1150. With a little tweaking you can even get your favorite file manager to open the opf project files in eBook Publisher without having to open a terminal.

If wine isn't already installed on your system most distributions have packages for wine so installing it is as easy as using your package manager. Once wine is installed you need to use a script named winetricks to install the windows core fonts so that the built in editor in eBook Publisher will display files correctly. You can get winetricks from here. Once you have the script downloaded use this command to install the corefonts.

sh winetricks corefonts

After you have the core fonts installed go ahead and download eBook Publisher then install it with this command.

WINEPREFIX=~/.wine wine Win_eBookPub_2.2.5.exe

You should see all of the usual windows installer popups, just follow the prompts. Once it is done if you are using a desktop manager that recognizes .desktop files you should have two new icons on your desktop. One for eBook Publisher and one for the Bulk Convert utility. You can click on the eBook Publisher icon to start the application and it will function like any other gui app. It is a fairly simple to use program and you can start converting your eBooks to imp format. You can learn more about using eBook Publisher here.

[edit] File Manager Integration with eBook Publisher

You can set up most file managers so that when you double click on an imp file or an opf file wine will run the correct program to deal with it. The trick is to supply the windows app with a path that it can use to find the file. That means that the path that is passed to the program needs to look something like this.

Z:\home\yourusername\Books\book.imp

The two programs that you are going to want to run are eBookPub.exe and viewer.exe. I usually accomplish this with short bash scripts. It makes it easy to change the command for different file managers. Most of the time I use emelfm2 so that is the one that I'll use as an example. Thunar would be just as easy to set up as well as krusader.

First the two bash scripts one to start eBookPub.exe and one to start viewer.exe. Both scripts assume that you let the eBook Publisher installer put the files in the default locations.

#!/bin/bash
# run_etiBookPublisher
# script to start the eBook Publisher using wine

ETIFILE=$(echo "$1" | sed 's/\//\\/g')
ETIFILE=$(echo $ETIFILE | sed 's/^/Z\:/')
# Modify WINEPREFIX to match your actual home directory 
WINEPREFIX="/home/username/.wine"
wine "C:\\Program Files\\eBook Technologies\\eBook Publisher\\ebookpub.exe" $ETIFILE
exit
#!/bin/bash
# run_etiBookViewer
# script to start the eBook Publisher viewer using wine

ETIFILE=$(echo "$1" | sed 's/\//\\/g')
ETIFILE=$(echo $ETIFILE | sed 's/^/Z\:/')
# Modify WINEPREFIX to match your actual home directory
WINEPREFIX="/home/username/.wine"
wine "C:\\Program Files\\eBook Technologies\\eBook Publisher\\viewer.exe" $ETIFILE
exit

They both do essentially the same thing. Take a full path passed in as an argument and convert it to one that the windows applications can use. They do this with a couple of quick sed calls, the first changes all of the forward slashes to back slashes and the second just adds a Z: to front of the path. If for some reason your system doesn't use Z: as the drive letter where the Linux file system is you will need to change that Z to whatever it really is.

Copy and paste the two scripts above into seperate files. Name the first run_etiBookPublisher and the second run_etiBookViewer. Save them somewhere in your path and set the executable bit on each file.

Emelfm2 context menu

To set up emelfm2 so that when you double click on an opf file the eBook Publisher program starts and loads that project right click on a file in emelfm2. Select Edit Filetype, in the window that opens scroll down to the bottom of the Categories list and select the last entry.

Emelfm2 File type dialog

Click the Add After button then click in the field under Categories. Type in a name like opf file and hit enter. Then click in the Extensions and click the Add After button type in opf in the field and hit enter. Click under Labels and hit the Add After button again, put _Open in this field and hit enter. Click under Commands and click the Add After button one more time, in this field type run_etiBookPublisher and hit enter. Click the Apply button and then OK. Now when you double click a file with the opf extension it should be opened with eBook Publisher. To get the viewer to work go through the same steps but make extension imp and the command run_etiBookViewer.

[edit] Problems

Any problems that you run into can be discussed in the mobileread forum post. http://www.mobileread.com/forums/showthread.php?t=28166

Personal tools
Namespaces

Variants
Actions
Navigation
MobileRead Networks
Toolbox
Advertisement