Operation Manual
The kernel ring buffer is a special portion of memory used by the Linux kernel to store its human-readable output. It’s an
important part of the Linux operating system: the text flashes by too quickly to read while the Pi boots, so it’s critical that users
are able to view the messages at a later date to read errors and diagnose problems.
With the adapter connected but no wireless firmware packages installed, the kernel will print a series of error messages to the
ring buffer. To read these messages, you can use the dmesg command to print the contents of the buffer to the screen. At the
terminal, or at the console if you haven’t loaded the desktop environment, simply type the following command to view the buffer:
dmesg
This will print out the entire kernel ring buffer, which will contain all messages output by the kernel since the Pi was switched on.
If the Pi has been running a while, that can be a lot of text. To locate error message particular to the wireless adapter, it can help
to send the output of dmesg through a tool called grep. Using grep, you can search through the buffer for text relating to missing
firmware. By piping the output of dmesg through grep with a search term, things become significantly clearer. Type the following
at the terminal:
dmesg | grep ^usb
The | symbol is known as a pipe, and tells Linux to send the output of one program—which would normally go to a file or the
screen—to the input of another. Multiple programs can be chained this way. In this example, grep is being told to search
through the output of dmesg—the screens full of text from the earlier command—for any use of the term usb at the start of the
line (denoted by the ^ character).
The exact output of that search will depend on the manufacturer of your USB wireless adapter. In Figure 4-3, the output is
shown with a Zyxel NWD2015 Wireless USB Adapter connected to the Pi.
Figure 4-3: Searching the kernel ring buffer for usb with a Zyxel wireless adapter connected
The important part of this output is the line that reads Manufacturer. In the case of the example Zyxel NWD2105, this reads
Ralink, which is the company that makes the actual chip found inside Zyxel USB wireless adapter. It’s this company’s firmware
that must be installed for the wireless adapter to work.
If you couldn’t find anything using usb as a search term, you can try the same command using the search term firmware, wlan or wireless. If you
still can’t see anything useful, type lsusb for a list of all USB devices connected to the system.
Using the manufacturer name from dmesg, search for the firmware files using the apt-cache search tool introduced earlier in this
chapter. For the example Zyxel NWD2015 adapter, the apt-cache command would be
apt-cache search ralink