Installing nuBuilder Forte

I decided to try out nuBuilder Forte as I needed a simple way to design forms and reports for a database for another project I’m working on. The first problem was to find out how to test it. I went to the nuBuilder website, had a quick look around, thought this looks good but where is the download page? Most websites for products have a download page with instructions on how to set it up but this site was lacking that page. Eventually, after a lot of searching I found a wiki page that states:

The trickiest thing with nuBuilder is its initial installation.

https://wiki.nubuilder.net/nubuilderforte/index.php/Test_Environment

Great news! NOT!!!!! There are two links on that page, one to a YouTube video that tells you how to set up nuBuilder on a hosting website that you have to pay for. As I just wanted to see if it do what I wanted, I wasn’t going to pay for a hosted site that I might use for a day or two and then never use again. The other link was to a post on the nuBuilder forum by bmullan that explains how to install nuBuilder on a virtual machine (VM) or LXD container. I chose to go down the LXD route as it was simplest to setup on my host PC, I had never tried out LXD containers and wanted to compare with docker that I have used many times over the years.

So I followed bmullan’s guide but for a LXD newbie like me, I had to find out how to install LXD and set it up. After more searching, I found this blog post that helped fill in the gaps. To make it easy for anyone else wanting to test nuBuilder, I have documented all the steps I took to get it working in an LXD container.

Installing nuBuilder in an LXD container

Install LXD

This is fairly straightforward if you just follow the blog post without thinking too hard. First install LXD using:

sudo snap install lxd

Once this has been done, you need to log out and in again as you have been added to the lxd group that allows you use the lxd/lxc commands with out sudo. Then initialise LDX using:

lxd init

There are a lot of options that you can play with but accepting every default worked for me.

Create the container:

$ lxc launch ubuntu:b nubuilder

After a minute or so, the container is running. You can check this using:

$ lxc list
+-----------+---------+---------------------+-----------------------------------------------+-----------+-----------+
|   NAME    |  STATE  |       IPV4          |                     IPV6                      |   TYPE    | SNAPSHOTS |
+-----------+---------+---------------------+-----------------------------------------------+-----------+-----------+
| nubuilder | RUNNING | 10.51.251.63 (eth0) | fd42:cc54:c9ee:527e:216:3eff:fe16:164c (eth0) | CONTAINER | 0         |
+-----------+---------+---------------------+-----------------------------------------------+-----------+-----------+

This container has a basic image of Ubuntu so now we need to add some packages to make it all work. Get a root Bash prompt on the container using:

$ lxc exec nubuilder bash
root@nubuilder:~#

Now install the packages that are needed to to support nuBuilder: MySQL for the database, Apache2 for the web server and PHP for scripting. This is often referred to as a LAMP (Linux, Apache, MySQL, PHP) stack. At the prompt enter:

# apt update
# apt install -y mysql-server apache2 php php-mysql unzip libapache2-mod-php php-mbstring

Installing the nuBuilder code

This is really simple. Just enter the following:

# cd /var/www/html/
# rm index.html
# git clone https://github.com/steven-copley/nubuilder4.git
# mv ./nubuilder4/* . 

Configuring the MySQL database

I started by securing the MySQL database. This step is probably not needed if you just want to test nuBuilder on a local machine but this is what I did.

# mysql_secure_installation
Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?

Press y|Y for Yes, any other key for No: y

There are three levels of password validation policy:
LOW Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2

Please set the password for root here.
New password:

Re-enter new password:

Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.

Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.

By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
Dropping test database…
Success.

Removing privileges on test database…
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.

All done!

One tip about password choice. I originally used an auto generated password with too many special characters in it and nuBuilder wouldn’t start properly (see troubleshooting section for details). I created a new password which was basically letters and numbers with a couple of standard symbols thrown in and this worked fine.

The next thing to do was to create a database for nuBuilder to use.

# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.29-0ubuntu0.18.04.1 (Ubuntu)
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> CREATE DATABASE nubuilder4;
Query OK, 1 row affected (0.01 sec)
mysql> quit
Bye 

Now load the nubuilder4 database with data.

# cd /var/www/html/
# mysql -u root -p nubuilder4 < ./nubuilder4.sql 

Use your editor of choice to add the MySQL root password to the file /var/www/html/nuconfig.php.

Finally, and this is important, restart the container using # reboot. This allows all the changes you have made to run properly. I didn’t do this and wasted a fair bit of time before I re-read the instructions and rebooted.

Check that the nuBuilder is working

At this stage, it is worth checking that nuBuilder can talk to the MySQL database. The following block shows the command I used in the container and the expected output.

# wget http://127.0.0.1/ -O -
--2020-04-10 12:14:15--  http://127.0.0.1/
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5721 (5.6K) [text/html]
Saving to: ‘STDOUT’
...
!DOCTYPE html>
<html id="nuhtml" onclick="nuClick(event)">
<head>
<title>nuBuilder 4</title>
...
2020-04-10 12:14:16 (666 MB/s) - written to stdout [5721/5721]

Note: each ellipsis ... show where lots of text has been cut out.

Connecting the container to the host PC

The final step is to connect the Apache web server on port 80 in the container to the host PC on port 80. First check if your host PC is using port 80. This is what my PC showed:

$ sudo netstat -tpln | grep 80
tcp6 0 0 fe80::4a39:2ddc:e:49152 :::* LISTEN 7933/upplay
tcp6 0 0 fe80::80e:7bff:fef6::53 :::* LISTEN 7472/dnsmasq 

Nothing on port 80. Now you can create an LXD proxy device that connects port 80 of the Apache webserver in the container to port 80 of the host using this command:

lxc config device add nubuilder nubuilder80 proxy listen=tcp:0.0.0.0:80 connect=tcp:127.0.0.1:80 

I used the same wget command that I used on the host to download index.php and it worked. I then tested it on the browser by going to the URL: http://127.0.0.1/. SUCCESS!!! I could see the login page for nuBuilder so I logged in as globeadmin. There was a problem! According to the bullman’s guide, there should be two tabs on the main screen: setup and builders. There were no tabs at all. So following the final steps of bullman’s guide, I appended the following lines to /etc/alternatives/my.cnf

[client]
port=3306
socket=/tmp/mysql.sock

[mysqld]
port=3306
socket=/tmp/mysql.sock
key_buffer_size=16M
max_allowed_packet=8M
sql-mode=NO_ENGINE_SUBSTITUTION

[mysqldump]
quick 

Rebooted the container and it finally worked!!!

Now to find out if nuBuilder really is as easy to use as it claims to be but that will be for another time (maybe).

Troubleshooting

Password problems

When I finally managed to connect to the nubuilder container, I received an error message. I viewed the Apache web server log files to find out what was going on.

# less /var/log/apache2/error.log
…
[Thu Apr 09 16:52:44.027971 2020] [php7:error] [pid 456] [client 127.0.0.1:35478] PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' in /var/www/html/nudatabase.php:12\n
Stack trace:\n
0 /var/www/html/nudatabase.php(12): PDO->__construct('mysql:host=127….', 'root', '', Array)\n
1 /var/www/html/nuchoosesetup.php(21): require_once('/var/www/html/n…')\n
2 /var/www/html/index.php(3): require_once('/var/www/html/n…')\n
3 {main}\n thrown in /var/www/html/nudatabase.php on line 12 

I realised that this was something to do with the password I was using. I could log in to the MySQL database from the Bash prompt with no problems but nuBuilder didn’t work. I changed my password to something with less special characters in it and it worked. For reference, the password contained the following characters special characters

 (`)[;,!

My guess is that there is a script in nubuilder that uses the MySQL root password and one of the characters I used caused it to misbehave, possibly truncating the password.

LXD network problems

I spent a fair bit of time chasing down LXD network problems when I added a proxy device to expose port 80. I found this discussion on the LXC forum very useful as it goes though the steps needed to diagnose network issues.

Updating my WD My Book Live

I have a Western Digital My Book Live, WD MBL, with a single 2TB disk that I wanted to update as the kernel and OS were over 5 years old. My aim was to use this a backup for my music collection that is currently hosted on my other NAS server, a ZyXel NAS520 with 2 1TB HDDs using Raid 1. I also wanted to transcode my music collection into several different formats and host them on the MBL instead of just the FLAC that is on my NAS.

After some googling, I found the OpenWrt project https://openwrt.org/toh/wd/mybooklive and decided to out their image. The first problem was that I had to take the HDD out of the MBL case. This is not easy but this video really helped:

Once I had the HDD out, I hooked it up to my PC using a HDD docking station, much easier than opening up my desktop and wiring it up directly. I installed the latest OpenWrt installation image, 18.06.4, following the excellent instructions on the OpenWrt site. I then took the HDD out of the docking station and reconnected it to the MBL circuit board and powered it up. The image worked just fine but I had forgotten that OpenWrt sets everything up like a router and I didn’t want that. So I tried to work out how to configure OpenWrt to not be a router and after a bit reading around, I realised that OpenWrt is not very standard so I could waste a lot of time working out how to set up the NAS the way I wanted.

After some more googling, I found this thread on the WD community site https://community.wd.com/t/any-interests-in-kernel-4-0-on-my-book-live/60483/. Debbie Jessie is a lot like Kubuntu that I use on most of my PCs so there was a minimal learning curve. A lot of the thread was about how to install Debian Jessie from scratch but later on, there was a series of posts from Ewald who had created his own distro and made it available to download and install. I think to myself, ‘Great, I’ll be done in a couple of hours!’ Famous last words! Many days later, I had something working and the following is a summary of what I learnt.

The boot process

There are a few key things to understand about the boot process on the WD MBL.

  1. U-Boot is installed in flash and cannot be changed without a lot of effort. This version of U-Boot can only boot onto ext2 or ext3 partitions and always uses /dev/sda1.
  2. U-Boot will use a script called boot.scr on the root of /dev/sda1 if it is present. This script can run any U-Boot commands but in this case it is told which kernel image to use, the kernel device tree file and where the root partition is.
  3. Once the kernel is running, it uses the /etc/fstab file to set up the partitions.

This is all basic stuff but you have to get everything right or nothing happens.

As I had previously installed OpenWrt, I had to re-partition the HDD to match what was expected by Ewald’s Debian Jessie distribution. Initially, I tried following the instructions here: https://github.com/ewaldc/My-Book-Live/tree/master/debian/debian%208%20(Jessie)#how-to-install-with-ext4-. If this had worked, I would have had a minimal boot partition using ext3 and the rest of the rootfs install on a much larger ext4 partition. However, I wasted an awful lot of time trying to make this work with no success.

I eventually opted for the ext3 only method described here: https://github.com/ewaldc/My-Book-Live/tree/master/debian/debian%208%20(Jessie)#how-to-install-a-combined-boot-and–with-ext2ext3. These instructions are fine but they rely on the disk being partitioned correctly which is not explained clearly. The following instructions show how I eventually made it work.

Installing the distribution

Once you know what you are doing, the installation is actually fairly straightforward and goes like this:

  1. Remove the HHD from the WD MBL.
  2. Attach the HDD to your PC.
  3. Partition the HDD.
  4. Create the file systems.
  5. Unpack the Debian Jessie image.
  6. Change the boot.scr file.
  7. Modify the /etc/fstab file.
  8. Attach the HDD to the WD MBL circuit board and verify that it boots and that you can connect using SSH.
  9. Re-assemble the WD MBL.
  10. Do all the basic tidying up that Ewald suggests.
  11. Customise as required.

Partition the HDD

When I tried de-bricking the WD MBL just I case I messed up, I successfully recovered the MBL. I then tried to find out what partitions were created by the factory image. There were several problems with trying to read the partition info and fdisk couldn’t do it. I found out that gdisk worked and after fixing the errors that it found, I was able to read the partition info (see below).

 Partition Table: 
 gptNumber  Start   End     Size    File system     Name     Flags
 3          15.7MB  528MB   513MB   linux-swap(v1)  primary 
 1          528MB   2576MB  2048MB  ext3            primary  raid 
 2          2576MB  4624MB  2048MB  ext3            primary  raid 
 4          4624MB  1000GB  996GB   ext4            primary

This is what is expected by the default /etc/fstab file but I wanted a bigger root partition so that I wouldn’t run out of space. I used gdisk to create the following partition table.

Number  Start (sector)    End (sector)  Size       Code  Name
    1            2048        20973567   10.0 GiB    8300  OS
    2        20973568      3904931982   1.8 TiB     8300  Data
    3      3904933888      3907029134   1023.1 MiB  8200  Linux swap

Set up the file systems

This is simply:

sudo mkfs.ext3 /dev/sdh1
sudo mkfs.ext4 /dev/sdh2

(/dev/sdh was where the disk appeared on my system). Once the file systems were created, they were automatically mounted on /media/andy.

Unpacking the tarball

Again this was pretty simple. Just make sure that you unpack the tarball on the correct partition. I used df -h work out which partition to use as this shows the mount points.

cd /media/andy/d8710e6e-34e8-4e59-bb19-74de7238a97d/
sudo tar xf /home/andy/software/WDMyBookLive/DebianJessie8.11.tgz

Set the right boot.scr file

Replace the /boot/boot.scr file with this one: https://github.com/ewaldc/My-Book-Live/blob/master/uboot/boot_ext3_sda1/boot.scr. It contains the following U-Boot commands:

setenv md0_args 'setenv bootargs root=/dev/sda1 rw rootfstype=ext3 rootflags=data=ordered ipv6.disable=1'
setenv load_sata 'sata init; ext2load sata 1:1 ${kernel_addr_r} /boot/uImage; ext2load sata 1:1 ${fdt_addr_r} /boot/apollo3g.dtb'
setenv boot_sata 'run load_sata; run md0_args addtty; bootm ${kernel_addr_r} - ${fdt_addr_r}'
echo ==== Loading Linux kernel, Device tree, Root filesystem ====
run boot_sata

This file tells U-Boot which kernel to use, /boot/uImage, and passes a bunch of commands to the kernel, the most important of which is the path to the root FS, /dev/sda1.

Amend the /etc/fstab file

The /etc/fstab file in Ewalds Debian Jessie “distribution” looks like this:

/dev/sda1       /       ext3    defaults,noatime,nodiratime,barrier=1   0 0
/dev/sda3       swap    swap    defaults        0 0
/dev/sda4       /DataVolume     ext4    exec,rw,noatime,nodiratime,data=writeback,barrier=0,errors=remount-ro,suid      0 1
/DataVolume/cache       /CacheVolume    none defaults,bind 0 0
/DataVolume/shares      /shares         none defaults,bind 0 0
/DataVolume/shares      /nfs            none defaults,bind 0 0

The problem with this is that the swap and data partitions are not where the /etc/fstab file expects them to be but it was simple to fix. I simply edited the /etc/fstab file to change /dev/sda4 to /dev/sda2.

After that, I plugged the HDD into the WD MBL circuit board and tested the new system. It booted and I was able to SSH into the newly updated MBL. There was still a lot of work to do to clean up and get everything working and that will be in my next post.

Links

The following links might be useful.

Synchronising PCs

At home, I mostly use my Ubuntu desktop PC during working hours and have my Ubuntu laptop on standby for occasional use in the evenings, at weekends or when I travel. I often make notes on the laptop in the evening and I wanted to be able to access them on my desktop the next day. So how could I do this?

I started with a simple bash script to copy a couple of directories directly between the two PCs, but quickly realised there were lots of problems with this approach. I thought about using git, but this seemed a bit over the top, especially as many of the files in my home directories are binary blobs like documents and spreadsheets. I also realised that I would need to use a third PC as having the desktop on and the laptop on simultaneously was a pain. Fortunately, at home, I have an Intel NUC that I use for Redmine and backups, so I could use that. This copy would also act as a backup of the most important directories on my PCs :-).

So I searched the internet for solutions and after a while I found the program unison. unison seemed to do what I needed and could also be used to sync with Windows PCs (yes, I do have one!)

Installation on both Ubuntu PCs was simple:

sudo apt install unison-all

Once installed, I tested it out and after short time, I worked out how to use the ~/.unison/default.prf file for what I wanted to do. The unison manual has some great examples of how profiles can be used. I kept it really simple:

# Unison preferences file
# Roots of the synchronization
root = /home/andy
root = ssh://maggie//home/andy
# Paths to synchronise
path = bin
path = business
path = Documents
path = hardware
path = issues
# end

To propagate this file between PCs, I keep a copy in my ~/bin directory. Now all I have to to is type unison on either PC to synchronise with the server.

One thing I like about unison is that is that is tells you what it is going to to do before it does it. This allows you to decide to which version of a file is more up to date and keep that version.

References

Unison home page: https://www.cis.upenn.edu/~bcpierce/unison/
Unison manual: https://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html

A rattling good idea!

The idea

I have had an idea that has been rattling around in my head for a while now, so I have decided to get it written down for all to see and use.

Some time ago, I was trying to solve the problem of making two recordings on the same digital TV service that overlap. My idea was to create a file system that created a logical file for each recording but shared the same underlying storage files. An example of this idea is shown in Drawing 1.

Drawing 1

In the above example, the user wants to record two programmes on BBC1, The One Show that is immediately followed by EastEnders but you also want to start both recordings 5 minutes early and end both recordings 5 minutes after each programme finishes. Each logical file has details about the recording, e.g. programme title, duration, and also has links to one or more storage files.  Each storage file can be thought of in a similar way to a file system block containing the data for the media type being used, e.g. transport stream data, MP3.

Referring back to Drawing 1, recording 1 (The One Show) uses storage files 1 to 17, recording 2 (EastEnders) uses storage files 15 to 31 so storage files 15 to 17 are used twice.  The file system maintains a count of the logical files that are using each storage file, and when the number of logical files using it is 0, then it is available for use by another logical file. The size of each storage file would be adjustable but I was planning on using a size that would hold about two minutes of a single program transport stream at standard definition.

Once I had this basic idea, I also realised that by having fixed sized storage files, I could format an entire disk partition using block sizes the same size as the fixed sized storage files. This approach would prevent any wasted space on the partition although the files may not be contiguous.

Obviously, there were many technical challenges to overcome before this idea would work, so I started looking at possible solutions including seeing if anyone had done this before so I could use their work.

Has some one done this before?

After a couple of Google searches, I ended up at the Filesystem In Userspace (FUSE) project web site.  This looked very promising so I looked for similar file systems in the media file system wiki pages. The following FUSE file systems looked useful:

However, I could not find a file system that would do exactly what I wanted so I needed to think about how I would implement the new file system.

How to implement and test it?

Having decided that I would have to develop this new file system myself, I needed a name to avoid calling the project it or thingy. Having decided that FUSE was the way to go, I settled on AVFUSE (Audio Video FUSE) as no-one else seemed to have used the name before.

I also needed some way to test the final product.  More research led me to the following results:

Of the these three, the posix-test-suite seems to be some sort of industry standard, so I plan to use that one when testing AVFUSE.

Next time, I hope to have done sufficient implementation to make it worth writing up, but life has this nasty habit of distracting me from intellectual pursuits like this.

Raspberry Pi Adventures, part 2 – TvHeadEnd

Selecting DTV software

As I said last week, the next thing I wanted to try out on my Raspberry Pi was TvHeadEnd. The main drive behind this is to set up a TV recording server so that I can watch live and recorded TV anywhere I want to. Previously, I tried out a number of different solutions for home media centres and digital TV. My rough findings, from my personal point of view, were:

  • MythTv – I have tried this on several occasions and in every case found it extremely difficult to set up and get working reliably.  The channel changes were also really slow, about 6 seconds for a service on the same mux and longer for services on other muxes.
  • me-tv – Tried this but had issues (I forget exactly what was wrong now).
  • XBMC – This was highly recommended by one of my friends so I gave it a whirl.  The latest version claims to work well with TvHeadend, so I tried out TvHeadEnd.
  • TvHeadEnd – I installed this on my development machine and found that it was a really excellent piece of software. It did nearly everything I wanted and was easy to set up and administer using the web front end.  It also has an app for my iPhone, TvhClient that works really well.

Installing TvHeadEnd

So I had previously done the leg work and now all I had to do was to install TvHeadend on the Raspberry Pi.  I started out by following the instructions on the TvHeadEnd web site  https://tvheadend.org/projects/tvheadend/wiki/AptRepository and this is what I did.

Appended the following line to the file /etc/apt/sources.list

deb http://apt.tvheadend.org/stable wheezy main

Then added the GPG key

curl http://apt.tvheadend.org/repo.gpg.key | sudo apt-key add -

Then executed

apt-get update
apt-get install tvheadend

You also need to fill in a prompt for the admin user name and password for TVheadEnd.  This installed without any problems and I was able to log in to TvHeadEnd but could not see any tuners yet.

Adding DVB-T tuners

Sometime ago, I had bought a DVB-T twin tuner USB stick to play about with.  This needed some firmware installing so that the Linux kernel would recognise it and make it available to TvHeadEnd. So I copied USB stick firmware file dvb-usb-af9015.fw into the directory /lib/firmware.  After a reboot, the kernel recognised up the TV stick and I was then able to see the two tuners in TvHeadend.  I performed a DVB scan and was able to specify my local transmitter and it worked brilliantly.

One of the problems that I have is that I can receive more than one transmitter at home and all my set top boxes use the weaker signals from the first transmitter they find instead of the nice strong signals from Emley Moor. Being able to select the transmitter that I wanted to use and not have to edit the service list after the scan completed was a welcome relief.

At this stage, I was able to watch live TV from my Raspberry Pi on my main development PC. Now all I needed was a hard drive to store my recordings.

Adding a USB hard disk drive

I bought an external USB 2.0 hard drive case a long time ago that had a 250GB hard drive installed that I used to use for back ups.  I partitioned the disk as one big disk and formatted it with EXT-4. I would have preferred to use XFS as this was found to be one of the best file systems for video recording but the Pi didn’t have XFS installed so I took the lazy way out.  Another article perhaps?

The next thing to do was to get the hard drive to auto mount.  USB disks come up slowly, so I had a fair bit of messing around before finding the following solution based on info from this page http://www.raspberrypi.org/phpBB3/viewtopic.php?f=36&t=50457&p=406518&hilit=usb+hdd+fstab#p406518

Plug in the USB disk and find out the unique ID for the disk like this:

andy@lisa ~ $ sudo blkid
/dev/mmcblk0p1: SEC_TYPE="msdos" LABEL="boot" UUID="5D2D-B09A" TYPE="vfat" 
/dev/mmcblk0p2: UUID="41cd5baa-7a62-4706-b8e8-02c43ccee8d9" TYPE="ext4" 
/dev/sda1: UUID="129c3696-0019-4962-8463-87c3a3993e9b" TYPE="ext4"

Then I edited /etc/fstab to add the following lines.

# /dev/sda1
UUID=129c3696-0019-4962-8463-87c3a3993e9b       /media/hts      ext4    defaults      0       1

As you can see, I have mounted the USB HDD on /media/hts and use the default options for the mount.  The comment # /dev/sda1 is just a reminder

After getting the USB HDD working, I stress tested it by making two simultaneous recordings and playing back a third recording and it all worked fine.  All of this happens with TvHeadEnd using less than 20% CPU which I think is very good indeed.

A month or so later

This installation of TvHeadEnd is still working fine with no changes to the set up over a month after I installed it. I have have rebooted several times as I add new software, but it has proved to be at least as reliable as my old Humax 9200T.

One of the things I really like about this set up is that I can use my iPhone at home to set up recordings and the TV doesn’t have to be on.  To be fair, the searches do take a while to perform but you get used to waiting once you know it will eventually get back to you. I’m sure there are ways to improve the performance of the searches but when you compare my Humax, the search times are similar so I can live with it.

Raspberry Pi Adventures, part 1

Introduction

This post is the first of a series of posts about my adventures with a Raspberry Pi computer that now lives in the cellar along with the many boxes of things that “might be useful one day”.

When I was made redundant back in April, I bought a Raspberry Pi computer to play with while I was finding a new job.  I had wanted to set up up a low-power always on server and finally had the time to do something about it.

Planning

The server should fulfil the following requirements:

  • Be always on, so must be low power.
  • Act as a central file store.
  • Host Redmine for bug tracking.
  • Run TVHeadEnd to make and serve recordings of TV.
  • Be able to act as a media server.

Previously, I had tried most of this on an old PC that was running Linux Mint 13 and it was all working well. As the Raspberry Pi could also run a Debian based distro, I was pretty confident that this would all work well with minimal effort.

I wasn’t bothered about any particular order of implementation but the obvious first thing to try out was the hardware.

Setting up the Raspberry Pi

The first thing I did when I the Raspberry Pi arrived was to verify that all the important things on the board were working. The details of what I did to get the Raspberry Pi running are basically those listed on the official Raspberry Pi website Quick Start guide and I used the Raspbian distro image from the Raspberry Pi download page. I then used the Fedora ARM Image Installer to load the image on an 8GB SD card, plugged everything in and waited for it to explode!  Needless to say, it all worked fine.

Once I’d proved all the hardware was working, I played around with the various GUI applications. I was pleasantly surprised by how well most applications performed and it proved to be quite a capable box.

Configuring the Raspbian image as a server

After I reloaded the clean Raspbian image to the SD card, I booted the Pi
and set the following boot options:

1. Expand file system.

8.2. Hostname set to <HostName>

8.4. Enable SSH.

8.5. Update – to make sure it is all updated before doing anything.

Notes:

  1. The numbers refer to the boot options shown on the first time run screen that comes with the Raspbian image.
  2. I did not enable the GUI as I want this to be an always on server administered remotely from my main PC.

After rebooting, I verified that I could login using ssh and we were good to go.

The next post will be about setting up TvHeadEnd as that was what I wanted to do next.