Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Raspberry Pi Server Essentials

You're reading from  Raspberry Pi Server Essentials

Product type Book
Published in Feb 2014
Publisher
ISBN-13 9781783284696
Pages 116 pages
Edition 1st Edition
Languages
Author (1):
Piotr J Kula Piotr J Kula
Profile icon Piotr J Kula

Chapter 3. Configuring Extra Features

There are some extra features on the Broadcom chip that can be used out of the box or activated using extra licenses that can be purchased.

Many of these features are undocumented and are found by developers or hobbyists working on various projects for the Pi.

In this chapter, we will learn how to keep the Pi up to date and how to use the extra features of the GPU.

Updating the Raspberry Pi


The Pi essentially has three software layers: the closed source GPU boot process; the boot loader, also known as the firmware; and the operating system. As of writing this book, we cannot update the GPU code. But maybe one day, Broadcom or hardware hackers will tell us how to do this.

This leaves us with the firmware and operating system packages. Broadcom releases regular updates for the firmware as precompiled binaries to the Raspberry Pi foundation, who then release it to the public. The foundation and other community members work on Raspbian and release updates via the aptitude repository; this is where we get all our wonderful applications from.

In this early stage of development, it is essential to keep both the firmware and packages up to date so that you can benefit from bug fixes and new or improved functionality from the Broadcom chip.

Updating firmware

Updating the firmware used to be quite an involved process, but thanks to a user on GitHub who goes by the...

Hardware watchdog


A hardware watchdog is a digital clock that needs to be regularly restarted before it reaches a certain time.

In the TV series Lost, there is a dead man's switch hidden on the island that needs to be pressed at regular intervals; otherwise, an unprecedented event will begin. In terms of the Broadcom GPU, if the switch is not pressed, it means that the system has stopped responding; the reaction event is to restart the Raspberry and reload the operating system.

Raspbian has a kernel module included that is disabled by default and deals with the watchdog hardware. A configurable daemon runs on the software layer that sends regular events (like pressing a button), referred to as a heartbeat to the watchdog, via the kernel module.

Enabling the watchdog and daemon

To get everything up and running, we need to do a few things in the console as follows:

sudo modprobe bcm2708_wdog
sudo vi /etc/modules

Add the line of text bcm2708_wdog to the file, then save and exit.

Next, we need to...

Enabling extra decoders


The Broadcom chip actually has extra hardware for encoding and decoding a few other well-known formats. The Raspberry Pi foundation did not include these licenses because they wanted to keep the costs down to a minimum, but they have included the H.264 license. This allows you to watch HD media on your TV or use the webcam module.

They provide a way for users to buy separate licenses if you would like to use these extra encoders/decoders.

At the time of writing, the only project to use these hardware codecs was the OMX project maintained by XBMC. We will compile GStreamer-OMX later in the book, which can be used to stream a video from the Pi to another computer or watch HD video from the console.

Buying licenses

You can go to http://www.raspberrypi.com/license-keys/ to buy licenses that can be used once per device. Follow the instructions on the website to get your license key.

MPEG-2

Known as H.222/H.262, this is the standard of video and audio encoding widely used by...

Hardware monitoring


The Raspberry foundation provides a tool called vcgencmd that gives you detailed data about various hardware used in the Pi. This tool is updated from time to time and can be used to log the temperature of the GPU, voltage levels, processor frequencies, and so on.

To see a list of supported commands, type the following command in the console:

vcgencmd commands

As newer versions are released, there will be more commands available in here. To check the current GPU temperature, use the following command:

vcgencmd measure_temp

We can use the following command to check how RAM is split for the CPU and GPU:

vcgencmd get_mem arm/gpu

To check the firmware version, use the following command:

vcgencmd version

The output of all these commands is simple text that can be parsed and displayed on a website or stored in a database.

Summary


The Raspberry Pi has very capable GPU and ARM processors with features that might not have been disclosed or discovered yet. Open development is slowed down by the fact that Broadcom is keeping everything closed source, and even if somebody gets a peak at some source code, they enforce strict non-disclosure terms and conditions. It is still in the early stages of development, but the hype created around the Raspberry Pi has brought you, me, and thousands of people to this hack space.

This chapter's intention was to teach you about how hardware relies on good software, but most importantly, to it also shows you how to leverage hardware using ready-made software packages.

In the next chapter, we will look at how to configure a web server and a database.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Raspberry Pi Server Essentials
Published in: Feb 2014 Publisher: ISBN-13: 9781783284696
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}