The AADL Developer's Blog. Technical info about what new features we're working on, releasing, and playing with.

Stuff We Like: littleBits Synth Kit

We have a ton of cool music tools here at the library and during some down time last week I was able to play with one of our latest acquisitions for evaluation: The littleBits Synth Kit. littleBits are awesome circuit building pieces, held together with magnets. They've partnered with synthesizer giant Korg to offer a kit that contains authentic synth modules that can be chained together to create custom sounds. Here's a little sample of what I was able to put together:

This particular kit is still under evaluation, but you should explore our ever-growing collection of Music Tools!

AADL Music Tools:
littleBits Synth Kit:

Custom Barcode Scanning from your iPhone

We have a lot of items on our shelves, and each one of them contains a wealth of related information within our catalog system. But it's a pain to have to physically carry a item from the shelf to a computer to look up that data, which pales in comparison to hundreds of items on a cart or shelf. It'd be great to have a way to look up that information on a mobile device, ideally by entering the item's unique barcode number with a scanner.

First I built a drupal module that displayed the basic information we wanted for each item, and I added the barcode as an argument at the end of the page's URL. As a result, if you knew the item's barcode, you could open a web browser and type in the address + the barcode to automatically go to a page with the information you wanted.

Secondly, I looked for an App in the iTunes App Store which could do actual scanning of the barcode using the iPhone's camera. There are a TON of barcode scanners in the App Store, but the vast majority of them are tailored to scanning UPC codes and redirecting you to online retailers for the corresponding product, or to decode custom QR codes.

After checking about a dozen free Apps with no luck, the App I finally settled on was mobiscan, which cost $3. But it fulfilled the two requirements for this simple project:

  1. Scan a barcode in the codabar format
  2. Redirect to a custom URL with that barcode's value

There are other, similar apps that offer even more custom functionality, or even integration with your own iOS app. But for the quick and simple scan and go functionality, mobiscan worked the best.

mobiscan App:

Printing Labels from Drupal to a Zebra printer

Some of our large items have multiple pieces, and to keep track of them we place the same barcode label on each piece. Making multiple item barcodes is a tedious process, so I created a simple function as part of our drupal intranet to create a new item label from the barcode number:

function spew_print_barcode_label($barcode, $printer, $num) {
  $header = variable_get('spew_barcode_header_text', NULL);

$zpl = <<<ZPL
^FX/* Top text line */^FS
^FX/* Barcode */^FS
^FX/* Bottom Text Line */^FS

  for($i = 0; $i < $num; $i++) {
    try {
      $fp = pfsockopen($printer, 9100);
      fputs($fp, $zpl);
    catch (Exception $e) {
      drupal_set_message('Caught printer connection exception: ' . $e->getMessage(), 'error');

The function creates a string of ZPL commands, and sends them directly to the printer on port 9100 by opening a socket connection using pfsockopen(). This should save our materials processors a lot of time.

Summer Game Prize Fulfillment Workflow

The AADL Summer Game has an online shop where earned points can be spent on awesome schwag. To try to make it easy for the volunteers and staff to fulfill the orders we took advantage of some of the infrastructure we already had in place for other parts of the site.

As some know our hold notices currently go through a script that sends an email along with printing a custom label to a label printer, that is used for identification on our hold shelves. We reused this process to print a custom pickup/order label every time an order comes through the ubercart game shop by hooking into the payment process. This leaves a spool of order labels that those doing fulfillment can pick up throughout the week and start filling. A spool that has been increasing dramatically in length. This makes it easy for the shop keepers to keep on top of all the orders and properly mark the bags for pickup.

The Summer Game Shop is live and we have our first order labe... on Twitpic

As orders are filled the barcode on the custom label is scanned, which sets the order as fulfilled and adds a notification job to a redis queue. Players have the option of getting SMS notifications (sent through Twilio) or email. Shop keepers can also cancel orders if need be which refunds the points to the player account.

After the items are delivered to the branch destinations on Friday morning, a script goes through the jobs on the redis queue and sends the notifications letting players know their items are ready for pickup.

Our first batch of Summer Game stuff  (380,000 points worth),... on Twitpic

More background info on our Summer Game is in the works and keep that order spool growing!

Under the Hood of the AADL Summer Game

The 2011 Summer Game has brought big changes to the way we play here at the library. In addition to the "classic" summer reading game, players can earn points for writing reviews, adding comments and finding game codes at events and locations. Players also earn badges for special accomplishments. We just passed player ID #4000 and we still have weeks to go for even more players to join and earn points and prizes. The pieces that make up the Summer Game are diverse but by adding custom code to the solid foundations provided by these open tools we've been able to concentrate our efforts on adding new content and functionality rather than chasing bugs and putting out fires. Here's some of the tools and technologies that make up the Summer Game:

Drupal: The websites run on the Drupal Content Management System. In addition to giving us a framework for writing blogs, creating user accounts and writing comments, it has a extensive API which allows us to leverage those pieces to add our own functionality. A drupal module for Summer Game was created that keeps track of player data, lets players add points through multiple activities, and displays a leaderboard. Players are attached to user accounts, and a simple function which could be placed in any code that runs the site allows us to award points for any website action. The summer game module is available through github: Summer Game module.

Request for Others and SOPAC

Over the past few years we've taken advantage of having a catalog we can tweak and change. Recently as we've been able to store more data outside of the ILS we have gone the route of making our catalog one of our main development platforms.

However, staff still had to go back to the staff client for the ILS for some functions. While many of those functions don't really make sense as part of the catalog, requesting items for other patrons was one that did. Having full control over the search and what fields are indexed created a back and forth between the client and website for finding things.

We just rolled out the feature for staff so they can request for others via the public catalog (if they have the permission). Its a feature I'd recommend looking at implementing if you are working on an opac replacement or other catalog like feature.

request for patron

Just one more step moving more non-inventory things to the drupal/sopac side of things rather than the ILS.

Patron Comments Module Released

We've decided to release the source code that drives our handling of patron comments; It was one of the first custom drupal modules that our dev team developed for our use here at the Ann Arbor District Library when we started with drupal 4 in 2005. It was migrated to drupal 6 along with the rest of the site in 2009. It stores comments both from online and our record of hand-written comment cards. It also handles the thousands of title suggestions we receive online every year.

Currently we have just over 46000 comments stored in the system, and every time you contact us, we save it. Don't forget that in addition to submitting a comment, you can browse the comments that we have published for public information, good, bad and everything in-between.

About the module itself: it's written for drupal 6, and requires a fair amount of custom setup in a MySQL database by hand before all the pieces fit together properly. If you want to give it a spin, make sure you look at the README.txt file for installation and setup procedures. Grab it from our github repository at the link below.

Using RedLaser with AADL

Thanks to the help of rjstoneus, if you have an iPhone and use the RedLaser application you can use it to search the AADL Catalog, MelCat and World Cat.


To install the additional options you will need to visit the following links on your iphone in safari. You then save the bookmark to your home screen.

New Public Computers - Hardware

Computers at Traverwood Branch

We recently overhauled the public computing setup at AADL, though it hasn't been rolled out at all the branches yet. It consists of a mix of linux hosted web management software, linux thin clients and windows terminal servers. It is a bit of a unique setup so figure I should share. Once we get it farther towards complete we'll probably release the code.

Some History

For some background the previous setup consisted of windows thin clients and windows servers running Citrix. The thin clients had published application sets that connected to a fairly basic server farm. The farm wasn't really setup well resulting in high loads and slow logins. A custom set of flash applications and php gateways administered it all.

As I researched options I decided I wanted to drop Citrix as I didn't really see it as needed and the licensing costs aren't exactly small. I also decided I would prefer as much be opensource as possible though we decided on keeping Windows for the public facing part for now.

I tested out quite a few public computing management software, lockdown software, cyber cafe software but didn't really find anything that did everything I wanted, kept it fairly simple, was flexible, etc. For reference here are a few things about our setup:

  • Patrons can use the computer as long as they want without interruption unless there are other patrons waiting for a computer. They have a minimum 30 minutes if there is a line, after which they are given 5, 2, 1 minute warnings.
  • They can be idle for a total of 10 minutes before being ended (given a warning after 5)
  • They swipe their card at an assigner first that gives them a station. These are spaced out then random

The New Thin Clients

Debian Thin Clients

The thin clients we settled on are HP Compaq t5735 Thin Clients. In bulk they ran under $250 each. The specs worked out for what we needed:

  • VESA mountable on both sides. Made it easy to securely mount to tables and even to the back of monitors
  • 1 GB Flash, 256M RAM
  • VGA and DVI
  • Lots of USB ports including back, front and secure (within case)
  • Debian Linux preinstalled (stock plus some custom HP packages)

The thing I like most about the thin clients is the imaging process. The clients come with a HP programs called HPThinState which can write a bootable imager to a USB drive. Once the USB is imaged you can boot other machines from the USB and walk through a simple imaging process. The process is simple enough that front line staff now image machines themselves when needed (usually ext3 partition corruption after power failure). This has significantly cut time of IT staff and reduced how long a client is out of order for simple problems.

Another nice thing is that all changes are put on flash immediately, no special write/flashing software needed. You can apt-get upgrade and have the changes there on reboot with no further interaction.

Break Out Boxes

One of the biggest problems we had previously was USB ports being damaged on clients. We tried multiple things like hubs, etc but nothing really lasted. Our latest attempt is using a modular box that is meant to be inserted in a 5.25 cd bay on a tower. We put 2 usb extenders and a headphone jack extender in it and mount it to the table. This leaves an easily replaceable port and also lets us move the thin client out of harms way. So far this has worked great and we haven't had to replace a port yet. At about $10-12 it can't be beat.

Modular USB Boxes

Other Hardware

We have USB floppy drives available for use and may expand to other formats. The monitors are stock though we add on privacy screens. Each station is also equipped with a USB based barcode reader that is used for signin purposes.

We also have one of the thin clients VESA mounted to a monitor and barcode reader that acts as the assigner.

More information on the actual software / workflow behind it coming up in a second post. Overall though we've been really happy with the hardware described above. Really stable and much better priced.

Infrastructure Upgrade: Online CD Previews

About the Upgrade

We've been working hard lately on an infrastructure upgrade that includes updates to Drupal, SOPAC and the servers that run the site.

While it will still have the same look and feel, behind the scenes we've made changes to speed things up, fix bugs and give us a robust platform to more quickly roll out new features and bug fixes. You'll notice most of the changes in the catalog which was completely revamped. Below is one such update to the catalog you can look forward to when we go live with the changes.

Stay tuned for more previews and please leave any feedback and suggestions you have.

Online CD Previews

AADL CD Preview Station

You may have used our CD preview stations that are present in our branches. They allow you to scan a CD and listen to samples of the tracks. Thanks to the company that produces our stations we were able to get a head start on moving these samples online. Here is a screen shot of the tracks for Big Dave and the Ultrasonics:

cd preview

The display is based on the BSD licensed project SoundManager 2. While we're starting small with just simple previews the project supports more advanced scripting of volume and playlists which we can hopefully take advantage of. This also opens the door for featured previews, playlists and the like.

Currently our sample collection is rather incomplete but we hope to fill it out and hopefully get some of our more unique and obscure items up for easier discovery.

If you have ideas of projects/ideas that can take advantage of this new track and preview data, please leave a comment.

Syndicate content