The best way for reading your comics

Get it now

Donation information


PayPal - The safer, easier way to pay online!
  • 2 Million+ downloads
  • 469 donors
  • since 2009

 

 

 

YACReaderLibraryServer on Raspberry Pi

July 04, 16

YACReader in Raspberry Pi

This tutorial is outdated, you should pick the code from https://github.com/YACReader/yacreader using git and read the documentation that can be found in the YACReaderLibraryServer folder.

 

One of the greatest additions to YACReader in the 8.5.0 relase is YACReaderLibraryServer. YACReaderLibraryServer is a version of YACReaderLibrary with no graphic user interface that can be used for serving comics to the iOS client of YACReader.

I have developed YACReaderLibraryServer for making easy to have a 24/7 comics server at home. Most of the time having a PC/Mac running YACReaderLibrary just for serving comics is overkill, so the main idea behind YACReaderLibraryServer is to running it in embedded devices like the Rapsberry Pi. These kind of devices are unexpensive, they consume low power and are easy to setup.

By now there are no ARM packages for Raspbian or any other distro, so if you want to run YACReaderLibraryServer in a ARM based system you have to compile by yourself. Yeah, YACReader needs packagers :(

The following tutorial assumes a fresh install of Raspbian, so it will guide you through the compilation and installation process but also the installation of all the needed tools and dependencies.

Installing dependencies and tools.

~ $ sudo apt-get update
~ $ sudo apt-get upgrade

~ $ sudo apt-get install mercurial

~ $ sudo apt-get install qt5-default
~ $ sudo apt-get install libpoppler-qt5-dev

Getting the source code of YACReader.

~ $ mkdir dev
~ $ cd dev/

~/dev $ mkdir yacreader_hg
~/dev $ cd yacreader_hg/

~/dev/yacreader_hg $ hg clone https://bitbucket.org/luisangelsm/yacreader .

Getting unarr source code.

~ $ cd ~/dev/yacreader_hg/compressed_archive/unarr/
~/dev/yacreader_hg/compressed_archive/unarr $ wget github.com/selmf/unarr/archive/master.zip

~/dev/yacreader_hg/compressed_archive/unarr $ unzip master.zip

Compiling and installing YACReaderLibraryServer.

~ $ cd ~/dev/yacreader_hg/YACReaderLibraryServer/
~/dev/yacreader_hg/YACReaderLibraryServer $ qmake YACReaderLibraryServer.pro
~/dev/yacreader_hg/YACReaderLibraryServer $ make
~/dev/yacreader_hg/YACReaderLibraryServer $ sudo make install

Check if everything was OK.

~ $ cd

~ $ YACReaderLibraryServer
Usage: YACReaderLibraryServer [options] command

YACReaderLibraryServer is the headless (no gui) version of YACReaderLibrary

Options:
-h, --help Displays this help.
-v, --version Displays version information.

Arguments:
command The command to execute. [start, create-library,
update-library, add-library, remove-library, list-libraries]

Configuring the system for YACReaderLibraryServer.

The main objective is to have YACReaderLibraryServer running 24/7 and recover it after any possible crash. There are several alternatives for doing this, but one of the easiest ways is to use cron. Since only one instance of YACReaderLibraryServer can run at once (it won't boot if another instance is running), we can schedule a cron task for running YACReaderLibraryServer.

Edit the root crontab file.

~ $ sudo crontab -e

Add the following line to the crontab

* * * * * YACReaderLibraryServer start

Considerations using YACReaderLibraryServer in an embedded system.

First of all, my current setup is running in a Raspberry Pi 3, but any similar device will do the job.

Even the latest version of the little Pi, with its improved performance, is a slow device compared with a PC or Mac. So creating a library using one of these devices can take a long time, specially for larger libraries. The right approach here, is to use your main computer for creating the library, usually in an external disk that will be attached to the Raspberry Pi later. For creating the library just use YACReaderLibrary, libraries' meta-info is stored in the target folder where the library is created, this means that libraries are portable.

Back in the Raspberry Pi, all you have to do is to use the add-library for adding the existing library to the current configuration of YACReaderLibraryServer. For example:

~ $ YACReaderLibraryServer add-library MyComics /mnt/MyComics

Note that if you are installing a task for YACReaderLibraryServer in your root crontab then you should add the libraries as root:

~ $ sudo YACReaderLibraryServer add-library MyComics /mnt/MyComics

Once everything is set up and running all you need to do is type the IP of your Raspberry Pi and the default port 8080 in the iOS app. You can use the command ifconfig to discover the IP of your Pi.

And that's all. Once the forum will be reopened I will create a topic for dicusing any related problem. In the mean time, please, contact me if you have any issues or questions. As promised, I have created the topic for discussing this in the forum.

« Show all news