Exercise: Exploring Common Peripherals
Identifying and Testing Specialized Hardware
1 Purpose
Beyond the standard keyboard and mouse, technicians often need to connect and troubleshoot a wide variety of specialized peripherals. This exercise is a modular guide to testing several common device types in a Linux environment. The parts are optional and can be completed if you have access to the corresponding hardware. For each device, you will learn the standard tools and methods to verify that the system detects the hardware and receives input from it.
2 What You’ll Accomplish
By the end of this exercise, you will be able to:
- Use appropriate command-line tools to check for the presence of GPS, NFC, and Smart Card readers.
- Understand the concept of a “keyboard wedge” device for RFID and barcode scanners.
- Test various peripherals to confirm they are detected and functioning correctly.
3 Prerequisites
This exercise requires a running Fedora virtual machine. Each section in the tabbed guide below is optional and requires a specific piece of USB hardware.
4 Step-by-Step Guide
Open a terminal window in your Fedora VM to begin. Navigate to the tab corresponding to the hardware you wish to test.
This section requires a USB GPS receiver compatible with gpsd.
Install GPS Tools: The
gpsd-clientspackage providescgps, a text-based tool for viewing GPS data.sudo dnf install -y gpsd-clientsConnect and Test: Plug in your USB GPS receiver and run the
cgpscommand.cgpsAnalyze the Output:
- If you have no device: The command will likely fail with a
gps_open() failed: Connection refusederror. This is expected, as the maingpsdservice isn’t running because it didn’t find a GPS device to manage. This error is your confirmation that no device was found. - If you have a device: The
cgpsinterface will open. It may initially say “NO FIX,” but after a few moments (especially if near a window), it will populate with your coordinates and a list of satellites. Pressqto quit.
- If you have no device: The command will likely fail with a
This section requires a USB NFC reader.
Install NFC Tools: Install the
neardservice, theneard-toolspackage for thenfctoolcommand, andlibnfcfor the low-level utilities.sudo dnf install -y neard neard-tools libnfcConnect and List: Plug in your USB NFC reader. Use
nfctoolwith the--listflag to see if theneardservice detects it.nfctool --listIf no device is listed, your reader was not detected.
Poll for a Tag: If a device was listed, run the poll command. This will wait for you to present an NFC tag.
nfctool pollAnalyze: Tap an NFC-capable card or tag to the reader. The tool will print the details of the tag it discovered. Press
Ctrl+Cto stop polling.
This section requires a USB Smart Card or CAC reader.
Install PC/SC Tools: The
pcsc-toolspackage provides the standardpcsc_scanutility.sudo dnf install -y pcsc-toolsConnect and Scan: Plug in your reader and run the scan tool.
pcsc_scanAnalyze:
- If the reader is detected, the tool will print the reader’s name and wait, displaying “Waiting for card…”
- If you insert a compatible card, it will print the card’s ATR (Answer to Reset) data, confirming it can be read.
- If the command exits immediately with an error, no PC/SC compatible reader was found. Press
Ctrl+Cto stop scanning.
This section requires a simple “keyboard wedge” RFID reader (the most common type for 125KHz cards).
No Software Needed: These devices emulate a keyboard. No special drivers or tools are required.
Open a Text Editor: Open any application that accepts text input, like
geditor a terminal window.Scan a Tag: Place an RFID card or fob on the reader.
Analyze: If the reader is a keyboard wedge, the card’s serial number will be “typed” into the text editor, usually followed by an automatic “Enter” keypress. If nothing happens, your reader may not be a keyboard wedge type or may not be detected correctly.
This section requires a standard USB barcode scanner.
No Software Needed: Like many RFID readers, most USB barcode scanners act as a “keyboard wedge.”
Open a Text Editor: Open any application that accepts text input.
Scan a Barcode: Scan any common barcode (e.g., on a book or food item).
Analyze: If the scanner is working, the data from the barcode will be “typed” into your text editor, typically followed by an “Enter” keypress.
5 Reflect and Review
Now that you have completed this exercise, reflect on your experience in your Microsoft Teams Student Notebook:
- 3 different types of peripherals you learned about.
- 2 different command-line tools you used to test hardware.
- 1 question you still have about how Linux interacts with USB devices.
Answer these questions in your notebook to solidify your understanding:
- For one of the devices you tested, what was the command you used to check for its presence? What was the output?
- What is a “keyboard wedge” device, and why doesn’t it require special software?
- What is the difference in purpose between a service like
neardand a low-level tool likenfc-list? - You run
pcsc_scanand it immediately exits with an error. What is the most likely cause?