Posts in coding

Raspberry Pi

Raspberry Pi
A Raspberry Pi computer
A Raspberry Pi computer (image credit: Wikimedia Commons)

 

This post was originally published on the ACRL TechConnect Blog at: http://acrl.ala.org/techconnect/?p=2962.

Raspberry Pi, a $35 fully-functional desktop computer about the size of a credit card, is currently enjoying a high level of buzz, popularity, and media exposure. Librarians are, of course, also getting in on the action. I have been working with a Raspberry Pi to act as a low-power web server for a project delivering media-rich web content for museum exhibits in places without access to the internet. I've found working with the little Linux machine to be a lot of fun and I'm very excited about doing more with Raspberry Pi. However, as with many things librarians get excited about, it can be difficult to see through the enthusiasm to the core of the issue. Is the appeal of these cute little computers universal or niche? Do I need a Raspberry Pi in order to offer core services to my patrons? In other words: do we all need to run out and buy a Raspberry Pi, are they of interest to a certain niche of librarians, or are Raspberry Pi just the next library technology fad and soon to go the way of offering reference service in Second Life? [1. Good and necessary work is still being done in Second Life, but it has become a niche service, not a revolution in the way we provide library services. ] To help us answer this question, I'd like to take a moment to explain what a Raspberry Pi device is, speculate who will be interested in one, provide examples of some library projects that use Raspberry Pi, and offer a shopping list for those who want to get started.

What is Raspberry Pi

From the FAQ at raspberrypi.org:

The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.

This description from Raspberry Pi covers the basics. (H2G2 has a more detailed history of the project.) A Raspberry Pi (also known as a Raspi, or an RPi) is a small and inexpensive computer designed to extend technology education to young students who don't currently have access to more expensive traditional computers. The Raspberry Pi project counteracts a movement away from general-purpose computing devices and toward internet appliances and mobile devices. The Pew Internet and American Life Project notes that: "smartphone owners, young adults, minorities, those with no college experience, and those with lower household income levels are more likely than other groups to say that their phone is their main source of internet access.[2. http://www.pewinternet.org/~/media//Files/Reports/2012/PIP_Digital_differences_041312.pdf] Access to the internet today is pervasive and less expensive than ever before, but also more likely to come from an appliance or mobile device and without the programming tools and command-line control that were standard for previous generations of computer users. This means a smaller percentage of computer users are likely to pick up these skills on their own. Raspberry Pi offers a very-low cost solution to this lack of access to programming and command-line tools.

In addition to the stated goal of the Raspberry Pi organization, a lot of adults who already have access to technology are also very excited about the possibilities enabled by the small and cheap computing platform. What sets the Raspberry Pi apart from other computers is its combination of small size and low price. While you can do very similar things with a re-purposed or salvaged computer system running Linux, the Raspberry Pi is much smaller and uses less power. Similarly, you can do some of these things with a similarly-sized smart-phone, but those are much more expensive than a Raspberry Pi. For the technology hobbyist and amateur mad scientist, the Raspberry Pi seems to hit a sweet spot on both physical size and cost of entry.

The heart of the Raspberry Pi (or RPi) Model B is a Broadcom system-on-a-chip that includes a 700mhz ARM processor, 512mb RAM, USB and Ethernet controllers, and a graphics processor capable of HD resolutions. According to the FAQ its real-world performance is on par with a first generation Xbox or a 300mhz Pentium II computer. In my personal experience it is powerful enough for typical web browsing tasks or to host a WordPress based web site. Raspberry Pi devices also come with a GPIO (general purpose input and output) port, which enables an RPi to control electronic circuits. This makes the RPi a very flexible tool, but it doesn't quite provide the full functionality of an Arduino or similar micro-controller[3. Check out this forum thread for a basic distinction between Arduino and Raspberry Pi.].

Out of the box, a Raspberry Pi will require some extra equipment to get up and running. There is a shopping list included at the bottom of the article that contains known working parts. If you keep boxes of spare parts and accessories around, just in case, you likely already have some of these parts. In addition to a $35 Raspberry Pi model b computer, you will definitely need an SD card with at least 4gb storage and a 5 volt 1 amp (minimum) micro-usb power supply. An extra cell phone charger looks like the right part, but probably does not put out the minimum amperage to run an RPi, but a tablet charger likely will. You can read the fine print on the 'wall wart' part of the charger for its amperage rating. If you want to use your Raspberry Pi as a workstation[3. The alternative is to run it 'headless' over your network using SSH.], you'll also need an HDMI cable, a digital monitor and a USB keyboard and mouse. Any USB keyboard or mouse will work, but the monitor will need to have an HDMI input. [4. Monitors with DVI input will work with a small and cheap HDMI to DVI adaptor. Analog monitors--the ones with blue VGA connectors--will work if you purchase an HDMI to VGA converter-adapter which start around $20.] Additionally, you may also want to use a USB wifi adapter to connect to wireless networks and since the Raspberry Pi has only two USB ports, you may also want a powered USB hub so you can connect more peripherals. The Raspberry Pi unit ships as a bare board, so you may want to keep your RPi in a case to protect it from rough handling.

Who is the Raspberry Pi for?

Now that we've covered what kind of kit is needed to get started, we can ask: are you the kind of librarian who is likely to be interested in a Raspberry Pi? I've noticed some "enthusiasm fatigue" out there, or librarians who are weary of overhyped tools that don't provide the promised revolution. I love my Raspberry Pi units, but I don't think they have universal appeal, so I've made a little quiz that may help you decide whether you are ready to order one today or pass on the fad, for now.

  1. Are you excited to work in a Linux operating system?
  2. Are you willing to use trial and error analysis to discover just right configuration for your needs?
  3. Do you enjoy the challenge of solving a living problem more than the security of a well-polished system?

If the answer to all three of these questions is an enthusiastic YES, then you are just the kind of librarian who will love experimenting with a Raspberry Pi. If your enthusiasm is more tempered or if you answered no to one or more of the questions, then it is not likely that a Raspberry Pi will meet your immediate needs. RPi are projects not products. They make great prototypes or test-boxes, but they aren't really a turn-key solution to any existing large-scale library problems. Not every library or librarian needs a Raspberry Pi, but I think a significant number of geeky and DIY librarians will be left asking: "Where have you been all my life?"

If you are a librarian looking to learn Linux, programming, or server administration and you'd rather do this on a cheap dedicated machine than on your work machine, Raspberry Pi is going to make your day. If you want to learn how to install and configure something like WordPress or Drupal and you don't have a web server to practice on (and local AMP tools aren't what you are looking for) a Raspberry Pi is an ideal tool to develop that part of your professional skill set. If you want to learn code, learn robotics, or build DIY projects then you'll love Raspberry Pi. RPi are great for learning more about computers, networks, and coding. They are very educational, but at the end of the day they fall a bit more on the hobby end of the spectrum then on the professional product end.

Raspberry Pi Projects for Librarians

So, if you've taken the quiz and are still interested in getting started with Raspberry Pi, there are a few good starting points. If you prefer printed books O'Reilly Media's Getting Started with Raspberry Pi is fantastic. On the web. I've found the Raspberry Pi wiki at elinux.org to be an indispensable resource and their list of tutorials is worth a special mention. Adafruit (an electronics kit vendor and education provider) also has some very good tutorials and project guides. For library specific projects, I have three suggestions, but there are many directions you may want to go with your Rasberry Pi. I'm currently working to set mine up as a web server for local content, so museums can offer rich interpretive media about their exhibits without having to supply free broadband to the public. When this is finished, I'm going to build projects two and three.

  • Project One: Get your RPi set up.

This is the out-of-the-box experience and will take you through the set up of your hardware and software. RaspberryPi.org has a basic getting started guide, Adafruit has a more detailed walkthrough, and there are some good YouTube tutorials as well. In this project you'll download the operating system for your Raspberry Pi, transfer it to your SD card, and boot up your machine, and perform the first time setup. Once you're device is up and running you can spend some time familiarizing yourself with it and getting comfortable with the operating system.

  • Project One-Point-Five: Play with your Raspberry Pi

Once your credit card sized computer is up and functional, kick the tires. Check out the graphical interface, use the command line, and try running it headless. Take baby steps if baby steps are what is fun and comfortable, or run headlong into a project that is big and crazy; the idea here is to have fun, get used to the environment, and learn enough to ask useful questions about what to do next. This is a good time to check out the Adafruit series of tutorials or elinux.org's tutorial list.

  • Project Two: Build an Information Kiosk to Display Local Mass Transit Information

http://blog.bn.ee/2013/01/11/building-a-real-time-transit-information-kiosk-with-raspberry-pi/

I found this on the elinux list of tutorials and I think it is great for libraries, provided they are in an area served by NextBus or a similar service. The tutorial walks users through the process of building a dedicated information kiosk for transit information. The steps are clear and documented with photographs and code examples. Beginning users may want to refer to other references, such as the O'Reilly Book or a Linux Tutorial to fill in some gaps. I suspect the tricky bit will be finding a source for real-time GPS telemetry from the local transit service, but this is a great project for those who have worked through basic projects and are ready to build something practical for their library.

  • Project Three: Build a Dedicated OPAC Terminal.

While dedicated OPAC terminals may no longer be the cutting edge of library technology, our patrons still need to find books on the shelves. Library Journal's Digital Shift blog and John Lolis from the White Plains public library describe a project that uses the Raspbian OS to power a catalog-only public terminal. The concept is straight-forward and working prototypes have been completed, but as of yet I do not see a step-by-step set of instructions for the beginner or novice. As a follow up to this post, I will document the build process for TechConnect. The gist of this project is to set up a kiosk-type browser, or a browser that only does a set task or visits a limited range of sites, on the Raspberry Pi. Eli Neiberger has raised some good questions on Twitter about the suitability of RPi hardware for rough-and-tumble public abuse use, but this is the sort of issue testing may resolve. If librarians can crowd-source a durable low-cost OPAC kiosk using Lolis' original design, we'll have done something significant.

Raspberry Pi Shopping List

As mentioned above, you may have many of these items already. If not, I've purchased and tested the following accessories for a couple of Raspberry Pi projects.

Basic Kit: (parts sourced through Amazon for ease of institutional purchase. Other sources may be preferable or less expensive.)

Accessories:

Raspberry Pi kits (Some vendors have put together full kits with a wide range of parts and accessories. These kits include breadboards and parts for arduino-type projects.)

(Comments on this site are closed. Please join the conversation at: http://acrl.ala.org/techconnect/?p=2962)

Notes

eBook Purchasing and Personal Values

An App to Proritize eBook Purchases by User-Set Priorities

I'm excited to read a new book, Sophia Samatar's A Stranger in OlondriaI came across Ms. Samatar's name and her work on the site Islam and Science Fiction and I was so excited about the perspective and literary references in A Stranger in Olondria that I immediately pre-ordered it from Amazon's Kindle store. Then, after I've already bought the book, I noticed that it is also available from Weightless books, a niche retailer of ebooks that is small press and author friendly and sells books without DRM. I immediately regretted my Amazon purchase and wished I had sent my money to a vendor whose values are more in line with my own. The values I'm concerned about deal with DRM-free purchase options and the amount of my purchase dollars that go into the authors' pockets.

I have a rough mental sketch of the ebook vendors I would prefer to use and in an ideal world, there are some resources available as well to help us choose. (If any readers cough librarians cough can help fill out this list, I'd appreciate it.)

My preferred ebook shopping list looks something like this:

  • Shop Smashwords first. In a conversation with Lindsay Buroker (the author of the fun steampunk series Emporer's Edge) on Twitter, I learned that authors get a bigger cut of the purchase price on Smashwords then they get from Amazon, Kobo, or Barnes & Noble.
  • Shop Weightless Books second. Weightless books have no DRM, and they work with small presses to develop new authors.
  • Shop direct from the publisher third. There are several publishers such as O'Reilly, No Starch, or BAEN who offer better service and DRM-free purchase options.
  • Shop Kobo next. Kobo sometimes has DRM-free options when the next item on the list does not. I buy John Scalzi's work from Kobo for this reason.
  • Shop Amazon if all other options fail. I like the convenience of Amazon. I don't necessarily care for their privacy policies, their clout in the industry, or their DRM policies. (Their MP3 store has no DRM, but Kindle and Audible books are locked down.) I don't mind shopping there and I maintain a Prime subscription, but I prefer to use them as a vendor of last resort, not my first stop. Shopping at Bezos' store first means that vendors with values that reflect my own are less likely to thrive or exist at all.

The App:

This  experience has me thinking: there should be an app that can do this for us. If such an app exists, please let me know about it in the comments. If not, it sounds like a good summer code project. Here's a back-of-the-napkin sketch of how I want this thing to work:

Step One:

  • The first step is for the user to enter an ISBN, title, title keyword for the book they are looking for. This is a tool for known-item-searching so it doesn't need to be able to browse.
  • The user input will return a list of possible titles and the users can confirm that this is the precise item they are looking for.

Step Two:

  • Once the exact title has been identified, a unique identifier such as an ISBN, DOI, or ASN will be used to search a set of vendors.

Step Three:

  • If multiple vendors stock the book, the user will be directed to the first vendor on a list of priorities. These priorities can be set by the user.

Step Four:

  • If the vendor selected has an affiliate program, purchase the book using the affiliate code. Otherwise, just send the user to the vendor's storefront. It is important *not* to privilege affilate programs, otherwise we could just use Amazon all the time, but if such options exist, no reason the designer can't get a small slice of each transaction enabled with the app.

I'll throw something together when I get some project time and put it up on Github. Unless, of course, it already exists or one of you smarty-pants beats me to it.

Wrapping Up:

That's it. It seems simple enough, but I've bought enough ebooks from the Kindle store, only to regret not shopping with my values that I think I'd benefit from having a tool like this. What do you all think? It should be noted that using a queue system like this assumes the user has the ability to strip the DRM from the books they buy. I use Apprentice Alf's plugins for Calibre to do this myself. If there is interest, I'll do a technical walkthrough for novices on how to own your ebooks using this method. Please let me know in the comments.