James Whitt's Blog

Thoughts of James Whitt

Accessing your eBook collection managed by Calibre without Calibre Server

without comments

This post is about how I’ve been going about enabling access to my eBook purchases that are managed with Calibre without actually using the built in Calibre Server.  All of this is running on Linux, with my eBooks and Calibre Library sitting on a remote Linux File Share.

The reason that I’m not using the Calibre Server to do the distribution is because:

  1. I actually store all the eBooks and the Calibre database on a Linux file share that is then shared on my network using Samba.
  2. I use multiple computers to interact with that Calibre database (not at the same time).  They are all setup to open the database on the samba share.
  3. The file share is headless and does not have X installed

So to do this, the first thing I had to do was setup the directory on my file share and then setup samba to share it out to the network.  Once that was done, I then mounted the share on my client computer.  With that done, when I started Calibre for the first time, I just change the configuration to use the samba share directory.  Now whenever I open Calibre, all the eBooks and database files are now stored and shared internally on my file share.

That was great and all, but I also wanted to be able to easily browse the collection inside and outside my network.  To do that, I figured the best way is using a web browser.  After looking around very quickly, I decided to use a software called, “Calibre PHP Server“, since the file server already had Apache and PHP installed on it.  I do have to warn, it’s not the best software out there and the design choices aren’t the best, but it is functional and I was able to get it up and working without having to write it myself.

To get it working with Apache, I created a new sub-domain to put it under, something like books.domain.com.  At that point, the configuration for it was very simple.

<virtualhost *:80>
        ServerName books.somedomain.com
        DocumentRoot "/var/www/books.somedomain.com"
        <directory "/var/www/books.somedomain.com">
                AllowOverride All
                Allow from All
        </directory>
</virtualhost>

After that, I just followed the instructions that came with the software for setting it up.  I also added the optional section, which restricts who can access the books, so that only my wife and I have access to our library.  As I mentioned, the interface isn’t the best, but it is functional.  One area that I ran into issues with was the configuration files.  The first one was the “$config['smarty']” option, which when you install smarty in Ubuntu, you will use, “$config['smarty'] = ‘/usr/share/php/smarty’;”  The other issue is with the, “$config['smarty_dir']“.  I found that no matter what value you enter into it, it won’t work unless you create an additional directory by hand under it called, “smarty_templates_c”.  So for example, if you specify it as “$config['smarty_dir']=’/tmp/smarty’”, then you will then need to create the additional directory as so, “# mkdir /tmp/smarty/smarty_templates_c”.

Now my wife doesn’t have to ask me to put eBooks on her Nook Color anymore, but knows to go to that website when she wants to get one of her books and just download it that way.  It will basically work with any browser and shows all the different file contents it contains.  In our case, we have some PDF’s and epubs.  It works flawlessly.

The next step that I want to take when I have time is to come up with an additional way to use access the library with the source being a OPDS server.  There are two pieces of software that I’m currently looking at, but haven’t had time to play around with them to see which way I like best.  Until then though, this solution is working good for us both.

Written by James

April 22nd, 2012 at 11:53 am

Posted in General,Linux

Subversion diff from url to local directory working copy

without comments

For some reason there is some bad information out there on comparing a local working copy in a branch to that of a subversion url.  In this case, I really wanted to know how far off this branch code that wasn’t commited is from the trunk.  To do that, you just need to use the ‘–old’ and ‘–new’ flags.

$ cd ./branches/one
$ svn diff --old=svn://server/Project/trunk --new=. > working.diff

Then all that needs to be done to update a branch of trunk to that is:

$ patch -p0 -i workingdiff.diff

Written by James

March 15th, 2012 at 11:11 am

Posted in Programming

My IOIO for Android is here

without comments

The IOIO for Android that I recently purchased has shown up!!!  I haven’t had time to play with it or even know much about how to start playing with it, but I will be figuring it out quickly.  If you’re not sure what it is, a quick description from their website is:

The IOIO (pronounced “yo-yo”) is a board specially designed to work with your Android 1.5 and later device. The board provides robust connectivity to an Android device via a USB or Bluetooth connection and is fully controllable from within an Android application using a simple and intuitive Java API - no embedded programming or external programmer will ever be needed!

So setup as it’s default use, it’s not using the new Google Open Accessory (ADK) protocol, which is what I really want to develop with once I get far enough along in Android programming and being able to do some prototypes on the board.  I figure once I get far enough along, that I’ll be turning on blinking LED’s, and from there the worlds the limit, even though I do know what I want the end result to be with it.

The bad news at this point is that the ADK firmware on it is still very beta.  Even to update the device, I need a PIC programmer capable of programming PIC24FJ128DA206.  So that means until it comes out of beta, I can’t use it for the ADK protocol or I ask some EE friends if they have one laying around.  Even if I take the friend route to update it to the beta, it still has the following problematic caveat:

Due to problems with the accessory library implementation (i.e. the Android OS code supporting the protocol) – the IOIO connection will not be properly closed when pausing (and exiting) your IOIO app. When the app is resumed (restarted) it will hang. The current workaround is to physically disconnect and reconnect the IOIO (or power-cycle it).

This is because of a problem in the Android OpenAccessory library preventing the app from gracefully closing the ADK connection. To work around this problem, detach and re-attach the IOIO when that happens (or power-cycle it). Another option is to force-close the app.

Not something that I would call usable in a real life situation.  Hopefully it does get resolved though.  At this point though, since my original plan is for a single use at this point, if all else fails, I’ll just use their implementation of the communication protocol for the initial project.  Either library I use in the end, both will be good learning experiences on making and developing for new accessories to work with Android.

Written by James

January 4th, 2012 at 9:30 am

DVR Software So Far

without comments

I am no where done tweaking with the software and trying to get everything working perfectly. This is just a post to document what I have done so far. Until I have a better internet connection, I will not be playing with streaming services such as Netflix and Hulu.

Operating System – Windows 7 Ultimate

I’ve decided to go with Windows 7 Ultimate. This version comes with Windows Media Center by default, which I will get into later. I know this is surprising to everyone that knows me, since it’s not Linux. The reason that I’ve done this is because Linux doesn’t allow the DVR to meet it’s needs. I wouldn’t be able to stream netflix or many other websites through boxee. In addition, it does come with DVR software for free that provides listings for free.

DVR Software – Windows Media Center (MWC)

I’m using Windows Media Center for the DVR software. It does decent, but is free with Windows 7 and comes with free listings. It does a good job of setting up with the tuner card. It allows for some plug-ins also. I haven’t spent much time trying to tweak it, but I need to find a way to modify the main menu to remove a lot of junk I don’t want. The movie section also leaves a lot to desire, as it does not break things down by folder and just displays all files it finds regardless of which folder it is in.

I have it setup so that when the DVR starts up, that WMC will startup in full screen. With this setup, there is no need for a mouse or keyboard.

Air Video

Air Video can stream videos in almost any format to your iPhone, iPad and iPod touch. You don’t need to copy your videos to the device just to watch them. The program runs in the background and starts automatically when the DVR starts up. With the recent Beta version of the server, it can stream the drm laden wtv format without having to convert them first.

My Channel Logos – MCE Plug-In

This is only a minor plug in, but it adds nice Broadcaster logo’s to the channel listings. It’s a minor touch, but a nice one.

Media Browser – MCE Plug-In

I use this for accessing, organizing, and viewing my shows on the remote server. If you loved how XMBC populated information about shows and movies, you will love this plug-in for watching all your backed up media. It will key off the title, download all the information about the media, and also pictures. Much better than the stock movie lister that came with WMC

Remote Potato – MCE Plug-In

I’ve used this for setting web access to the DVR. It allows for viewing the listings and setting up recordings using a web browser. It also allows you to stream already recorded shows to windows and os x web browsers that support silverlight. This doesn’t include the implementation on linux though.

A new feature that I haven’t had time to test out is streaming to iOS devices. I might try it out in the next couple weeks and update this post. Currently, it does not support native mode on the iPad.

Written by James

March 17th, 2011 at 9:20 pm

Streaming Windows Media Center DVR Shows to the iPad

with 2 comments

I had started this article out about how I use all these different applications, such as using MCEBuddy to convert videos to a non-drm stream on a nightly basis, save to a separate location, and then using Air Video Server to stream it to the iPad or iPhone.

So while I was getting the links together, I realized that Air Video Server now has a beta server out that does that all for you. Air Video now has the ability to stream the DRM WTV video format that WMC saves the shows in!

Software Used

Instructions

  1. Navigate to http://www.inmethod.com/air-video/index.html and there will a box announcement link in the top left of the page that there is a new Air Server beta. Click the box, which will take you to the forum to choose either Windows or Mac in the first post. Download the software and then install on your application.
  2. If the server hasn’t been started yet, start it now (either in task bar or going to applications). Under the “Shared Folders” tabl, click the “Add Disk Folder” button. For a default WMC installation, you should add the folder “C:\Users\Public\Recorded TV”. At this point, if you have other video file locations (MKV, mp4, divx, avi), you can add those in there also. Now start the server by clicking the button at the top left. You are all done on the server side.
  3. Download “Air Video” from the App Store. Once you start up the app, click the “+” button and if you are on the same network as the DVR, the server should pop up. Just navigate to the shared videos and start. It’s that simple.

One of the additional benefits of Air Video is that you can also stream at a lower resolution from your DVR over the internet, but you will need to go to the Air Video Website for more detailed instructions on that.

Written by James

March 16th, 2011 at 9:30 pm

Posted in DVR

Tagged with , , , , ,