CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Tue, 05 Aug 2025 19:11:32 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20071221202404
location: https://web.archive.org/web/20071221202404/https://www.oreilly.com/catalog/lnxunwired/toc.html
server-timing: captures_list;dur=0.816004, exclusion.robots;dur=0.085119, exclusion.robots.policy;dur=0.068698, esindex;dur=0.015596, cdx.remote;dur=113.635909, LoadShardBlock;dur=363.391235, PetaboxLoader3.datanode;dur=252.057087, PetaboxLoader3.resolve;dur=80.172356
x-app-server: wwwb-app217
x-ts: 302
x-tr: 506
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app217; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Tue, 05 Aug 2025 19:11:33 GMT
content-type: text/html
x-archive-orig-date: Fri, 21 Dec 2007 20:24:04 GMT
x-archive-orig-server: Apache
x-archive-orig-p3p: policyref="https://www.oreillynet.com/w3c/p3p.xml",CP="CAO DSP COR CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa CONo OUR DELa PUBi OTRa IND PHY ONL UNI PUR COM NAV INT DEM CNT STA PRE"
x-archive-orig-last-modified: Wed, 19 Dec 2007 03:52:00 GMT
x-archive-orig-accept-ranges: bytes
x-archive-orig-content-length: 309768
x-archive-orig-x-cache: MISS from olive.bp
x-archive-orig-x-cache-lookup: MISS from olive.bp:3128
x-archive-orig-via: 1.0 olive.bp:3128 (squid/2.6.STABLE13)
x-archive-orig-connection: close
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: iso-8859-1
memento-datetime: Fri, 21 Dec 2007 20:24:04 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Thu, 15 Apr 2004 20:32:42 GMT", ; rel="prev memento"; datetime="Mon, 30 Apr 2007 02:42:26 GMT", ; rel="memento"; datetime="Fri, 21 Dec 2007 20:24:04 GMT", ; rel="next memento"; datetime="Fri, 26 Feb 2021 20:45:41 GMT", ; rel="last memento"; datetime="Fri, 26 Feb 2021 20:45:41 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_1_20071221194500_crawl106-c/52_1_20071221201912_crawl100.arc.gz
server-timing: captures_list;dur=0.541788, exclusion.robots;dur=0.023797, exclusion.robots.policy;dur=0.011196, esindex;dur=0.010747, cdx.remote;dur=332.382619, LoadShardBlock;dur=167.594703, PetaboxLoader3.datanode;dur=242.422383, PetaboxLoader3.resolve;dur=122.632891, load_resource;dur=214.463757
x-app-server: wwwb-app217
x-ts: 200
x-tr: 901
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
O'Reilly Media | Linux Unwired
Buy this Book
Table of Contents
- Chapter 1: Introduction to Wireless
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterWireless networks use radio waves to move data without wires and they have been around in one form or another for decades. Teletype, or telex, systems were established worldwide in the early 1920s. These systems used copper lines to connect two or more teletype machines. Government investments in military radios lead to innovations in radio; teletype over radio (TOR), or radioteletype , replaced many teletype systems, particularly in third-world countries that lacked copper-wire infrastructures. In many parts of the world, TOR is still used as the primary communications medium for governments. TOR uses the high frequency (HF) radio band. We'll cover the types of radio bands later in this chapter.In 1970, Norm Abramson, a professor of engineering at the University of Hawaii, developed a radio-based communications system known as ALOHANET. This was the world's first wireless packet-switched network, which allows multiple devices to transmit and receive data simultaneously. The research behind ALOHANET was used by Bob Metcalfe to develop the Ethernet standard for wired networking.Presently, there are many types of wireless networks in use around the world. The 802.11 protocol set, popularly known as Wi-Fi, includes wireless network standards that allow data transmission up to a theoretical 54 Mbps. The Global Positioning System (GPS) uses a wireless connection from a receiver to a series of satellites to fix a location precisely on the planet. There are several wireless networking standards in the mobile-phone world, including General Packet Radio Service (GPRS) and Code Division Multiple Access (CDMA) 1xRTT (1x Radio Transmission Technology). Subsequent chapters will discuss all of these in detail.Radio waves are created when electrically charged particles accelerate with a frequency that lies in the radio frequency (RF) portion of the electromagnetic spectrum. Other emissions that fall outside of the RF spectrum include X-rays, gamma rays, and infrared and ultraviolet light. When a radio wave passes a copper wire or another electrically sensitive device, it produces a moving electric charge, or voltage, which can be transformed into an audio or data signal.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Radio Waves
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterRadio waves are created when electrically charged particles accelerate with a frequency that lies in the radio frequency (RF) portion of the electromagnetic spectrum. Other emissions that fall outside of the RF spectrum include X-rays, gamma rays, and infrared and ultraviolet light. When a radio wave passes a copper wire or another electrically sensitive device, it produces a moving electric charge, or voltage, which can be transformed into an audio or data signal.Radio waves can be depicted mathematically as a sinusoidal curve, as shown in Figure 1-1.Figure 1-1: A sine wave representing a radio waveThe distance covered by a complete sine wave (a cycle) is known as the wavelength . The height of the wave is called the amplitude . The number of cycles made in a second is known as the frequency . Frequency is measured in Hertz (Hz), also known as cycles per second. So, a 1 Hz signal makes a full cycle once per second. You should be familiar with this unit of measurement: if your new computer's CPU operates at 2 GHz, the internal clock of your CPU generates signals roughly at two billion cycles per second.Note that frequency is inversely proportional to the wavelength: the longer the wavelength, the lower the frequency; the shorter the wavelength, the higher the frequency. The wavelength of a 1 Hz signal is about 30 billion centimeters, which is the distance that light travels in one second. A 1 MHz signal has a wavelength of 300 meters.To regulate the use of the various radio frequencies, the Federal Communications Commission (FCC) in the United States determines the allocation of frequencies for various uses. Table 1-1 shows some of the bands defined by the FCC (see
https://www.fcc.gov/oet/spectrum/table/fcctable.pdf
).Table 1-1: Range of frequencies defined for the various bands FrequencyBandAdditional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Connections Without Wires
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterThere are many types of wireless networks, such as Cellular (wide-area wireless networking), Wi-Fi (local and wide area wireless networking), and Bluetooth (cable-replacement and short-range wireless networking). All of these networks run with Linux. Here is a list of tasks you can complete with Linux and wireless networks:
- Build your own wireless access point. At home, use a Linux box as your wireless access point and secure firewall for a broadband connection, and use a Linux notebook as a wireless client. To control who uses your access point, build a captive portal. It's also possible that your broadband connection is wireless and uses a point-to-point directional wireless network.
- Synchronize your contacts. At the office, keep your contacts list from your Linux desktop synchronized with your cell phone using Bluetooth or an infrared port.
- Use a cellular network and GPS for the ultimate road warrior experience. On the road, use your Linux-powered PDA to check email from a wireless hotspot. Connect your cell phone and laptop, and use a high-speed data network where there is a digital cell signal. Hook a GPS receiver to your laptop and find that out-of-the-way hotel.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Wireless Alphabet Soup
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterWhile it is not the sole focus of this book, there are several chapters that deal entirely with "Wi-Fi," or Wireless Fidelity . This phrase is trademarked by the Wi-Fi Alliance, a group that consists of nearly all 802.11 manufacturers. The Wi-Fi Alliance does product testing and certification for interoperability.802.11 was defined as a protocol by the Institute of Electrical and Electronics Engineers (IEEE) in 1997. This protocol specification allowed for 1 and 2 Mbps transfer rates using the 2.4 GHz ISM (Industrial, Scientific, and Medical) band, which is open to unlicensed public use. Prior to the adoption of this standard, there were various wireless network vendors manufacturing proprietary equipment using both the 2.4 GHz and the 900 MHz bands. The early adopters of the proprietary technologies and 802.11 were primarily the manufacturing and health care industries, which rapidly benefited from their employees' mobile access to data. The 802.11 standard uses spread spectrum modulation to achieve high data rates. Two types of modulation were specified: Frequency Hopping and Direct Sequence. 802.11 also uses the Carrier Sense Multiple Access (CSMA), which was developed for Ethernet in 1975 with the addition of Collision Avoidance (CA)—referred to as CSMA-CA.In 1999, the IEEE adopted two supplements to the 802.11 standard: 802.11a and 802.11b. The 802.11b standard is also referred to as High Rate DS and is an extension of the Direct Sequence Spread Spectrum type of modulation specified in 802.11. 802.11b uses 14 overlapping, staggered channels, each channel occupying 22 MHz of the spectrum. This standard's primary benefit is that it offers data rates of 5.5 and 11 Mbps in addition to the 12 megabits provided by 802.11. 802.11b has been widely adopted around the world, and its products have been readily available since 1999.However, 802.11a products did not begin shipping until 2001. 802.11a utilizes a range in the 5 GHz frequency and operates with a theoretical maximum throughput of 54 Mbps. It provides for 12 nonoverlapping channels. Products based on this protocol have not seen the adoption rate of 802.11b products for several reasons. At higher frequencies, more power is needed to transmit. The power of 802.11 radio types is limited; therefore, 802.11 and 802.11b have longer range transmission and reception characteristics than 802.11a. Because of its higher frequency, 802.11a is absorbed more readily by obstacles, reducing range and throughput.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Bluetooth
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterBluetooth is a low-power radio technology aimed at replacing cables for connecting devices. It was originally developed by the Swedish telecommunications manufacturer Ericsson and then formalized by an industry consortium. The name is taken from a Danish king, Harald Bluetooth, who ruled Denmark and Norway in A.D. 936.The standards for Bluetooth define a low-power radio with a maximum range of 300 feet. The radios are actually on a transceiver microchip to keep size and power consumption to a minimum. Bluetooth uses the 2.45 GHz band of the ISM radio spectrum and divides the band into 79 channels. To further reduce any crosstalk into other ISM bands, Bluetooth devices can change channels up to 1,600 times per second.Bluetooth is becoming widely available on mobile phones and PDAs, and one of its "killer" applications is hands-free wireless headsets for mobile phones. Bluetooth is also a popular way to "tether" a notebook computer to a cellular phone, which allows you to connect to the Internet even when an 802.11 network is not available (because current cellular data speeds are much slower than Bluetooth, Bluetooth's relatively slow speeds are not the limiting factor). Bluetooth adapters are available for PDAs, desktops, and notebooks. There are some printers and keyboards available that use Bluetooth to communicate with the host device as well.Compared to Wi-Fi, Bluetooth speeds are not impressive, but they are quite useful for transferring small amounts of data. Download speeds can max out at 720 kbps with a simultaneous upload speed of 56 kbps. Every Bluetooth device can simultaneously maintain up to seven connections, making a personal Bluetooth LAN a real possibility.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Cellular Data
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterWith the rise of digital cellular phone networks, it became possible to use these networks to transfer data rather than just voice. There are several differing and competing technologies available.Cellular Digital Packet Data (CDPD) was one of the first data networking technologies available for mobile phones. CDPD utilizes unused bandwidth in the 800-900 MHz range normally used by mobile phones. Data transfer rates max out at a theoretical 19.2 kbps. Today, CDPD is obsolete, and cellular carriers are actively trying to phase it out.General Packet Radio Service (GPRS) is an add-on technology to existing Time Division Multiple Access (TDMA)-based GSM mobile phone networks. Timeslots in the GSM network are normally allocated to create a circuit-switched voice connection. With a GPRS-enabled network, the timeslots are used for packet data as needed. This by design creates a very slow data network with high latency and, theoretically, the speed of a 56 kbps modem. AT&T Wireless, T-Mobile, and Cingular Wireless use this technology. In 2003, an enhancement to GPRS, Enhanced Data Rates for Global Evolution (EDGE), was partially rolled out in the United States by AT&T Wireless and Cingular. In theory, EDGE can triple the data rate of GPRS, but you need an EDGE-capable handset, such as the Nokia 6200, to use it.1xRTT stands for Single Carrier Radio Transmission Technology and is part of the CDMA2000 family of protocols, which includes successors to 1xRTT such as Single Carrier Evolution Data Only (1xEV-DO). It is built on top of the CDMA-based mobile phone networks and allows for ISDN-like data transfer speeds up to 144 kbps (1xEV-DO is capable of much higher speeds). Sprint's PCS Vision and Verizon's Express Network use this technology. As of this writing, Verizon Wireless is experimenting with 1xEV-DO in two U.S. markets, with testers obtaining data rates between 500 and 800 kbps.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Infrared
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterThe electromagnetic (EM) spectrum contains many different wavelengths of which the RF spectrum is a small part. Another part of the EM spectrum is infrared light. This light has a longer wavelength than visible light, but a much shorter wavelength than radio or microwave radiation. Infrared is usually linked to body or mechanical heat, as many objects above room temperature emit infrared radiation. These emissions can be seen by night vision equipment.Infrared is used in television remote controls, because the signal does not interfere with the TV transmission. Remote controls and Infrared Data (IrDA) equipment utilize light-emitting diodes to emit infrared radiation that is then focused by a lens into a narrow beam. The beam is modulated on and off to encode the data transmission.The IrDA Association publishes specifications that are used by PDA, notebook, and mobile phone device manufacturers for the infrared ports on their devices. IrDA devices typically have a maximum throughput of 4 Mbps. While most mobile devices still have IrDA, many manufacturers are replacing these with Bluetooth.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Chapter 2: Wi-Fi on Your Linux Box
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterWireless support on Linux has come a long way. With modern Linux distributions, you may not need to recompile your kernel to receive support for your Wi-Fi card. You probably won't need to install driver software or even touch a command line. However, this isn't always the case, especially as new cards come on the market, so you should still have a good understanding of how Wi-Fi works under Linux. This chapter starts out with an explanation of what you need to do with some common distributions and a common radio card, and then gets into the details you need to know to take things a little further, including radio chipsets, drivers, kernel compilation, the PCMCIA subsystem, and the Linux wireless tools.If you haven't purchased a Wi-Fi card yet, and are happy with 802.11b (about 5.5 Mbps real-world speed versus about 20 for 802.11a or g), pick up either a Lucent/Agere/Avaya/Proxim Orinoco Silver or Orinoco Gold (see Section 2.2.1.2 later in this chapter). If you've purchased a different card, it may work out of the box with Linux. But if it doesn't, the rest of this chapter describes chipsets and drivers in enough detail for you to find your way. Unfortunately, the orinoco_cs driver does not support monitor mode, which passive monitoring tools such as Kismet require. See Chapter 3 for information on monitor mode and available patches for orinoco_cs. If you want to use monitor mode with an unpatched driver, we suggest that you use a Prism or Atheros-based card.When you install Linux for the first time, load the modules for all the built-in network interfaces, especially any wired Ethernet adapters you might use in the future to avoid a particular situation where your Wi-Fi card is assigned and configured as eth0 during installation, but the system later detects the onboard Ethernet and assigns it to eth0 (bumping up your Wi-Fi adapter to eth1 and messing up the configuration files that think eth0 is your Wi-Fi adapter).You must install the wireless tools package, which is described in Section 2.3.4 later in this chapter. The name of this package in all the Linux distributions in the following list isAdditional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Quick Start
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterIf you haven't purchased a Wi-Fi card yet, and are happy with 802.11b (about 5.5 Mbps real-world speed versus about 20 for 802.11a or g), pick up either a Lucent/Agere/Avaya/Proxim Orinoco Silver or Orinoco Gold (see Section 2.2.1.2 later in this chapter). If you've purchased a different card, it may work out of the box with Linux. But if it doesn't, the rest of this chapter describes chipsets and drivers in enough detail for you to find your way. Unfortunately, the orinoco_cs driver does not support monitor mode, which passive monitoring tools such as Kismet require. See Chapter 3 for information on monitor mode and available patches for orinoco_cs. If you want to use monitor mode with an unpatched driver, we suggest that you use a Prism or Atheros-based card.When you install Linux for the first time, load the modules for all the built-in network interfaces, especially any wired Ethernet adapters you might use in the future to avoid a particular situation where your Wi-Fi card is assigned and configured as eth0 during installation, but the system later detects the onboard Ethernet and assigns it to eth0 (bumping up your Wi-Fi adapter to eth1 and messing up the configuration files that think eth0 is your Wi-Fi adapter).You must install the wireless tools package, which is described in Section 2.3.4 later in this chapter. The name of this package in all the Linux distributions in the following list is wireless-tools.We tested the Proxim Orinoco Classic Gold (pictured in Figure 2-1) with several Linux distributions on an IBM ThinkPad A20m with onboard Ethernet (eth0), and this is what we found:
- Debian 3.0r1
- We used disk 5 (kernel 2.4.18-bf2.4) to boot the installer and installed the base system using disk 1. During installation, the card was recognized and configured properly using orinoco_cs and the eth1 adapter.
- SuSE 9.0
- We used the free download version of SuSE 9.0 and installed everything over FTP. The installer did not automatically detect the card, so we had to use wired Ethernet for the installation. However, when we booted the system for the first time, SuSE found the card and configured it automatically using the orinoco_cs driver as wlan0 (the default for orinoco_cs would be to use eth1).
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Chipset Compatibility
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterWhile there are many vendors selling Wi-Fi hardware, the radio chipsets come from a relatively small set of manufacturers. With a few exceptions, radio chipset support under Linux is quite good, and getting better.Before getting into the nuts and bolts of radio chipsets, there is one online resource that you absolutely need. Jean Tourrilhes at Hewlett Packard is the author of the Linux Wireless Tools (covered later in this chapter). He also maintains an extensive web page that includes the Wireless LAN How-To. The page is located at
https://www.hpl.hp.com/personal/Jean_Tourrilhes/index.html
. For information regarding a specific radio chipset and driver support in Linux, look on the Devices & Drivers page:https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Linux.Wireless.drivers.html
. The page is updated frequently and has extensive information on many esoteric wireless devices and drivers.Although there are probably less than 50 manufacturers of Wi-Fi radio chipsets, this book simply does not have the space to cover each of these manufacturers in detail. We cover the five most popular manufacturers and their chipsets, which, in reality, produce 80% of all 802.11 hardware.Section 2.2.1.1: Intersil Prism II
Before it became a part of Intersil, a company called Harris developed the Prism I reference standard for 802.11, based on an AMD AM930 processor core. This chipset is 802.11 only, so we won't cover any details of driver support, but they are available on Jean Tourrilhes' web site, listed in the previous section.At one point, Prism II has been the most widely available and popular 802.11b radio chipset. Intersil licensed the chipset and reference designs for Prism II to a large number of vendors. A partial list of vendors using Prism II radios in their access points, PCMCIA cards, PCI cards, USB adapters, and Compact Flash (CF) cards includes:- Compaq
- Nokia
- Proxim
- D-Link
- Linksys
- Netgear
- SMC
- Senao/Engenius
Nearly all of these vendors have products using other radio chipsets. Unfortunately, many products have kept the same name and sometimes even the same part number, while changing the underlying radio chipset. A good case in point: the D-Link DWL-650. This radio card initially shipped with a Prism II chipset and was very popular, because it worked in a Linux box. However, D-Link changed chipsets when it released the DWL-650 Version 2, choosing an ADMtek chipset. It is very difficult to tell from the packaging which version of the DWL-650 you are purchasing.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Four Steps to Wi-Fi
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterTo use a Wi-Fi card on your Linux system, you need several things:
- The correct driver software for your Wi-Fi card
- The Linux Wireless Tools software
- If your system uses a PC Card interface for the Wi-Fi card, the pcmcia-cs software package must be installed and configured OR
- Your kernel must have kernel PCMCIA support compiled in. You may need to recompile your kernel, depending on your system and distribution.
If you installed your Linux distribution on a notebook or laptop, there's a good chance that you already have at least part of the necessary packages to make a configured and operational Wi-Fi network card. Current versions of Red Hat, Debian, and SuSE with 2.4 kernels all include a "notebook" option during the installation process that installs kernel PCMCIA support.You have two options for PCMCIA support in Linux: the pcmcia-cs package or kernel PCMCIA support. All 2.4.x distributions of the Linux kernel include the option for compiling in PCMCIA support, which removes the need for the external pcmcia-cs package. However, there are some valid reasons to use the pcmcia-cs package rather than the kernel PCMCIA support, which we discuss later in this section.Kernel PCMCIA support is based on the pcmcia-cs package. The pcmcia-cs README for Version 2.4 kernels, found athttps://pcmcia-cs.sourceforge.net/ftp/README-2.4
, has several good questions on this topic:Q: Are these two versions of PCMCIA both going to continue with active development?A: The kernel PCMCIA subsystem should be the focus for ongoing development. The standalone pcmcia-cs drivers are still being maintained but the focus has shifted from adding functionality, towards mainly bug fixes.Q: Which should I use / which is better? The kernel PCMCIA, or the standalone PCMCIA?A: It rarely matters. The client drivers should generally behave the same. At this point, most current distributions use the kernel PCMCIA subsystem, and I recommend sticking with that unless you have a particular need that is only met by the standalone drivers.Your Linux distribution may not install the Linux Wireless Tools or the pcmcia-cs packages by default. You must select these packages during the installation process or add them at a later time.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Linux Wi-Fi Drivers in Depth
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterMost Linux distributions include a number of wireless drivers. In many cases, the driver that you need will be available. However, there are a number of situations where you must obtain the driver source and build it yourself. This is true for many newer Wi-Fi cards, particularly cards that support 802.11a, 802.11g, or both. The drivers for these cards are still under development and are not included with most Linux distributions.A second reason to obtain the driver source and build it yourself is if you wish to build your own access point. (The details of Linux access points are covered in Chapter 6.) However, the drivers that enable you to have your own Linux AP all require that you obtain the source code and compile it.In addition to the drivers described in this chapter, there are two ways you can get Windows drivers to load on your Linux system. NdisWrapper (
https://ndiswrapper.sourceforge.net/
) is an open source project that loads Windows drivers, and Linuxant (https://www.linuxant.com/
) is a proprietary product that also accomplishes this. We'll talk more about Linuxant in Chapter 4, where we discuss using Wireless Protected Access (WPA) with non-Prism cards.There are two original drivers available for the Lucent WaveLan/Orinoco radio cards: wvlan_cs and wavelan2_cs. wvlan_cs was the first driver for Linux that supported the WaveLan IEEE (802.11 and 802.11b) radio cards. wavelan2_cs is a binary driver released by Lucent. The downside of the binary driver is that it's limited to i386 architecture, and the source is not available. With the sale of Orinoco to Proxim, development of the wavelan2_cs driver stopped. However, Agere continues to build the chipsets for the Orinoco radios, and has developed a driver called wlags49 based on the wavelan2_cs code. Details on wlags49 are found in Chapter 6.The orinoco_cs driver was written by David Gibson, who was maintaining the wvlan_cs driver and was not satisfied with the code or the performance of the driver. orinoco_cs was written based on low-level parts of the wlan-ng driver and BSD drivers. The driver also supports Prism II radio cards, Symbol Spectrum 24, and Apple AirPort (but not AirPort Extreme) cards, with varying degrees of feature support. This driver is primarily written for support of the Lucent WaveLan IEEE cards, which are also known as Orinoco and are also sold by Agere and Avaya. Proxim is now selling cards branded "Orinoco" for 802.11a and 802.11g, which are based on the Atheros chipset.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Chapter 3: Getting On the Network
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterAssuming that you didn't encounter any problems in Chapter 2, you should now have a functional wireless network adapter, and the knowledge to configure and use it under Linux. If you have a wireless network set up at home or at work, chances are you will use this network most of the time.If, however, you have Linux installed on a notebook PC, chances are you're often in transit, and you probably want to find and use wireless networks in cities, airports, hotels, and conferences.This chapter discusses tools and techniques that allow you to find available wireless networks, whether they are fee-based or free.It would be pretty much impossible for any notebook user not to have heard the term hotspot . Wireless hotspots are popping up in many locations; coffee shops, airports, hotels, conferences, restaurants, city parks, and libraries are just a few places where you might find a hotspot.You can easily build your own hotspot, and we cover this in detail in Chapter 6. A hotspot requires at least one access point, a good antenna that covers the needed area, a broadband Internet connection, and some form of access control (if you want to restrict access).Most hotspots are built around these four basic pieces. Some use DSL as their broadband Internet connection, while many of the commercial hotspots use a T1 line or other dedicated circuit. However, many hotspots are simply in a house or apartment, particularly in dense urban areas, and these connections are DSL, cable, or even simply dial-up.Before you leave for a trip, research online to find hotspots along the way to your destination. To find both fee-based and free hotspots, consult the following web sites:
- WiFinder
https://www.wifinder.com/search.php
- HotSpotList
https://www.hotspotlist.com
- T-Mobile Hotspots
https://www.t-mobile.com/hotspot
- Wi-Fi Zone Finder
https://www.wi-fizone.org/zoneLocator.asp
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Hotspots
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterIt would be pretty much impossible for any notebook user not to have heard the term hotspot . Wireless hotspots are popping up in many locations; coffee shops, airports, hotels, conferences, restaurants, city parks, and libraries are just a few places where you might find a hotspot.You can easily build your own hotspot, and we cover this in detail in Chapter 6. A hotspot requires at least one access point, a good antenna that covers the needed area, a broadband Internet connection, and some form of access control (if you want to restrict access).Most hotspots are built around these four basic pieces. Some use DSL as their broadband Internet connection, while many of the commercial hotspots use a T1 line or other dedicated circuit. However, many hotspots are simply in a house or apartment, particularly in dense urban areas, and these connections are DSL, cable, or even simply dial-up.Before you leave for a trip, research online to find hotspots along the way to your destination. To find both fee-based and free hotspots, consult the following web sites:
- WiFinder
https://www.wifinder.com/search.php
- HotSpotList
https://www.hotspotlist.com
- T-Mobile Hotspots
https://www.t-mobile.com/hotspot
- Wi-Fi Zone Finder
https://www.wi-fizone.org/zoneLocator.asp
- JiWire
https://www.jiwire.com
There are an increasing number of commercial hotspot providers, ranging from large companies, such as T-Mobile and WayPort, to small operations in local coffee shops, and wireless aggregators that allow you to access multiple networks from different hotspot providers.Nearly all of these providers restrict access to their hotspots through a captive portal . This form of access control intercepts all TCP/IP traffic. To gain access through a captive portal, simply open a web browser and attempt to navigate to any web page, such asAdditional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Wireless Network Discovery
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterIf your network card supports it, the easiest method of locating available wireless networks is included with the Wireless Tools, which you installed in Chapter 2. The
iwlist
command supports ascanning
parameter that lists any access points in range. It's worth noting, however, that some wireless card drivers do not support this feature. Chief among them is the orinoco_cs driver. If you're using this driver, you must use one of the alternative discovery methods next.To determine if your card and driver support scanning, execute theiwlist
command with no other parameters. If you see "scanning" listed in the output, you should be able to scan for available access points. Note that you must have root access to use this command.# iwlist Usage: iwlist [interface] frequency [interface] channel [interface] ap [interface] accesspoints [interface] bitrate [interface] rate [interface] encryption [interface] key [interface] power [interface] txpower [interface] retry [interface] scanning
Once you've determined that you can use thescanning
parameter, execute the command. You must specify the network adapter that corresponds to your wireless card (eth1
in the following example). Again, you must have root access.# iwlist eth1 scanning eth1 Scan completed : Cell 01 - Address: 00:02:6F:01:76:31 ESSID:"NoCat " Mode:Master Frequency: 2.462GHz Quality:0/92 Signal level:-50 dBm Noise level:-100 dBm Encryption key:off Bit Rate:1Mb/s Bit Rate:2Mb/s Bit Rate:5.5Mb/s Bit Rate:11Mb/s Cell 02 - Address: 00:30:65:03:E7:0A Essid:"SurfandSip " Mode:Master Frequency:2.422GHz Quality:0/92 Signal level:-66 dBm Noise level:-96 dBm Encryption key:off Bit Rate:1Mb/s Bit Rate:2Mb/s Bit Rate:5.5Mb/s Bit Rate:11Mb/s
Now that you've obtained a list of available networks, see what providers are in your area, and make a decision on the hotspot to use.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Chapter 4: Communicating Securely
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterIn a wired network, physical security is complicated but manageable. You can restrict physical access to routers, switches, and network hardware. You can provide a complex authentication mechanism for proving that users are who they say they are. You can set up Virtual LANs or Virtual Private Networks for even more security. Even if an attacker were to plug into your wireless network, it would be difficult to penetrate further with these kinds of security measures in place.The wireless network world is not nearly this secure. In fact, it's not secure at all. Disassembling your network packets and transmitting them wirelessly means that anyone within reach can see them. A wily attacker could join or passively monitor your network from a mile away with a high-gain antenna, and you would never see him.The IEEE specifications for 802.11a/b/g all provide a form of encryption called Wired Equivalent Privacy (WEP). WEP operates at the Media Access Control (MAC) layer, or the Data Link layer, between the Physical Layer (radio waves) and the Network Layer (TCP). WEP encryption is based on the RC4 algorithm from RSA Data Security and employs a 40-bit encryption key.Anyone who knows the secret key (unless you're the only user on the network, this key is shared, so it's not all that secret) can participate in a WEP network. Secret keys are generally either plaintext words or somewhat longer combinations of hexadecimal numbers.There are two major problems with WEP:
- Encryption is handled at the Data Link layer, so if you connect to a WEP network with your notebook, the communication between your notebook and the access point is encrypted. All packets are decrypted at the access point and sent from there in the clear.
- Other computers that also have the secret key for this WEP network can read all packets sent to and from your computer. The secret key is a "shared" key, which means that all devices that encrypt packets must use the same key. Some access points use a passphrase to generate the WEP key, making the key even easier to deduce. Once you are connected to a WEP network, you can do all the packet sniffing you want with a tool like Ethereal.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - The Pitfalls of WEP
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterThe IEEE specifications for 802.11a/b/g all provide a form of encryption called Wired Equivalent Privacy (WEP). WEP operates at the Media Access Control (MAC) layer, or the Data Link layer, between the Physical Layer (radio waves) and the Network Layer (TCP). WEP encryption is based on the RC4 algorithm from RSA Data Security and employs a 40-bit encryption key.Anyone who knows the secret key (unless you're the only user on the network, this key is shared, so it's not all that secret) can participate in a WEP network. Secret keys are generally either plaintext words or somewhat longer combinations of hexadecimal numbers.There are two major problems with WEP:
- Encryption is handled at the Data Link layer, so if you connect to a WEP network with your notebook, the communication between your notebook and the access point is encrypted. All packets are decrypted at the access point and sent from there in the clear.
- Other computers that also have the secret key for this WEP network can read all packets sent to and from your computer. The secret key is a "shared" key, which means that all devices that encrypt packets must use the same key. Some access points use a passphrase to generate the WEP key, making the key even easier to deduce. Once you are connected to a WEP network, you can do all the packet sniffing you want with a tool like Ethereal.
A team of cryptographers from the University of California at Berkeley, as well as several other groups (see the references at the end of this section), have identified weaknesses in the way that WEP keys are generated and used, effectively making the number of bits in the key immaterial. Even though many manufacturers have added extra bits to the key length, up to 152 bits, the longer key length provides minimal protection, because WEP is not a well-designed cryptographic system.With all of these problems, why is WEP still supported by wireless equipment manufacturers? Until recently, there had not been another standard for wireless encryption. You could have run a Virtual Private Network (VPN) on top of your wireless network, but this would have presented its own set of challenges, and it is not practical for home or even small-business users. The Wi-Fi Alliance announced a standard called Wireless Protected Access (WPA) in mid-2002. WPA is based on a draft of the IEEE 802.11i specification, which will probably be ratified in mid-2004. We cover WPA a bit later in the chapter.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - The Future Is 802.11i
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterThe future solution from the IEEE to provide real wireless security and a strong cryptographic system is the proposed 802.11i standard. The IEEE Task Group responsible for this standard maintains a web page at
https://grouper.ieee.org/groups/802/11/Reports/tgi_update.htm
. As of December 2003, draft 7 of this proposal has been sent to a "sponsor ballot," and the results are not yet available. The word on the street is that 802.11i will become a ratified standard sometime in mid-2004.The final standard of 802.11i will likely address the following:- Use of 802.1x for authentication
- 802.1x is a specification framework for mutual authentication between a client and an access point. 802.1x may also use a backend authentication server such as RADIUS and take advantage of one of the Extensible Authentication Protocol (EAP) variations. 802.1x uses a new key for each session, so it resolves the issue of a single static WEP key.
- Use of the Temporal Key Integrity Protocol (TKIP)
- TKIP uses 128-bit dynamic keys that are changed at random times. Because of the constantly changing keys, intruders would be hard pressed to collect enough radio frames to compromise the keys.
- Use of the Advanced Encryption Standard (AES)
- The full implementation of 802.11i will utilize AES encryption to make a very strong cryptographic system. However, using AES requires significant computational horsepower. Current models of access points will not be able to handle AES due to limited processors. Expect new models that are "802.11i ready" to arrive on the market in 2004.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - WPA: a Subset of 802.11i
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterWork on 802.11i began in 2001 after the weaknesses in WEP were made public by several teams of researchers. However, as with any standards body, the IEEE does not always work as fast as some people would like.In mid-2002, the Wi-Fi Alliance, an industry consortium, proposed a subset of 802.11i, based on draft 3 from the IEEE working group, and called it Wireless Protected Access (WPA). The upcoming full IEEE implementation is also being referred to as WPA v2.WPA, as a subset of the 802.11i proposed standard, incorporates two major features:
- Use of 802.1x for authentication
- Use of the Temporal Key Integrity Protocol (TKIP)
Chipsets supporting WPA began to become available in 2003. As of this writing, many access points either support WPA out of the box or have firmware updates available that include WPA.WPA is not only an encryption mechanism but also includes 802.1x authentication, so support is required on the client for the authentication mechanism. As of this writing, your options are very limited regarding WPA support in Linux.A few vendors have released updated firmware for older radio cards with WPA support; Apple AirPort cards, the Linksys WPC-11, and the Dell TrueMobile 1150 all have updates available.WPA and 802.1x are starting to become available in new access points, and earlier models are getting firmware updates that support WPA. The Linksys WRT54G and D-Link 900AP+ can both support WPA after a firmware upgrade. Newer Linksys and D-Link models are packaged with this support already enabled. Enterprise-level access points from Cisco, Proxim, and others also support WPA and are starting to advertise themselves as "802.11i-ready."The Dell 1150 card is a rebranded Orinoco card; Agere has drivers on its web site listed "for evaluation only" that include this same update. However, Proxim, the new owner of the Orinoco brand, has nothing on its web site about WPA for older cards.All of this is interesting but not immediately useful, however, because you can't use any of these cards under Linux and take advantage of the WPA code in the cards. Why? Because their associated Linux drivers do not support WPA. As of early 2004, you have two options if you want to use WPA under Linux, which we discuss below. In order to take advantage of these methods, you should understand how 802.1x works.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - WPA on Linux
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterAs of this writing, if you want to use WPA and/or 802.1x as a client on Linux, you have two options:
- Obtain the WLAN Driver Loader from Linuxant. This is a compatibility wrapper that allows you to use the standard Windows NDIS drivers that ship with wireless network cards. The advantage to this is that you can use a wide array of WiFi cards that currently do not have open source drivers available.
- Use a Prism-based Wi-Fi card with the latest HostAP CVS code. The newest versions of HostAP contain a WPA Supplicant in software that allows you to connect to WPA-protected networks.
If you want to use your Linux box as a WPA Authenticator, you're currently out of luck. The HostAP development team is working towards a full implementation of a WPA Authenticator. Right now, however, the hostapd daemon acts as an 802.1x Authenticator and authenticates against a RADIUS database.Windows XP and Mac OS X both include support for 802.1x Supplicants. There is an open source implementation available for Linux called Xsupplicant, which is located athttps://www.open1x.org
.A last option is to use your Linux box as the RADIUS server (Authenticating Server), and use an inexpensive access point as the WPA Authenticator. You can then use any WPA Supplicant to connect to the access points, and the backend authentication is handled by Linux/RADIUS.The Linuxant WLAN Driver Loader is a compatibility wrapper that allows the use of Windows NDIS wireless network drivers under Linux. Open source purists have issues with this software, because parts of it are released only in binary form, and after 30 days you must pay $20 for a permanent license. If you're completely opposed to anything Windows-related, keep in mind that this solution requires you to run Windows binary drivers, so this option may not be for you.However, at this point in time, Linuxant is the only game in town if you need access to WPA-protected networks from a Linux box and you don't have a Prism-based wireless card. More to the point, the WLAN Driver Loader software allows you to use WiFi cards that do not have any open source drivers, including cards with chipsets from Broadcom and Texas Instruments. For many of the popular 802.11g cards, this may be your only option in Linux.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Chapter 5: Configuring Access Points with Linux
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterSo you've purchased an access point. You brought it home from the store, broke open the packaging, discarded all of the extraneous bits of fluff, and you're likely left with an access point, a power supply, an Ethernet cable and a CD that says "Windows Software Installation."This chapter explains how to avoid this scenario. While there are vendors of wireless equipment that still expect you to configure their gear from a Windows PC, there are many alternatives for the Linux user.Many of the early access points from vendors, such as WaveLAN/Lucent/Orinoco, Linksys, and others, required an external setup program. With few exceptions, these setup and configuration programs ran only under Windows. However, as the price of wireless equipment continued to drop and access points began to be marketed to home users, a number of vendors chose to make their equipment configurable with a web browser.There are also several manufacturers that allow Telnet access for configuration of their access points. One thing you're unlikely to find, however, is SSH-enabled access. As of this writing, there are no commercial access points capable of SSH. However, at least one company is producing wireless routers that operate using a Linux kernel. Several organizations have built custom firmware for these boxes that include SSH daemons. See Chapter 6 for details.While it is impossible to provide a complete and up-to-date list of all wireless vendors, Table 5-1 shows a list of many of the major manufacturers, the types of equipment they sell, and how their equipment is configured.
Table 5-1: Linux-friendly wireless vendors VendorEquipment typesConfiguration methodsLinksyswww.linksys.com
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Linux-Friendly Wireless Vendors
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterWhile it is impossible to provide a complete and up-to-date list of all wireless vendors, Table 5-1 shows a list of many of the major manufacturers, the types of equipment they sell, and how their equipment is configured.
Table 5-1: Linux-friendly wireless vendors VendorEquipment typesConfiguration methodsLinksyswww.linksys.com
Access points, bridges, routersWeb-basedNetgearwww.netgear.com
Access points, bridges, routersWeb-basedD-Linkwww.dlink.com
Access points, bridges, routersWeb-basedCiscowww.cisco.com
Access points, bridgesWeb-based, Telnet, SNMPSMCwww.smc.com
Access points, bridges, routersWeb-basedAdditional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Commercial Wireless Equipment Overview
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterWith the explosion in Wi-Fi popularity, a corresponding plethora of vendors and equipment choices have surfaced. There are an amazing number of access points, but there are also wireless routers, wireless bridges, wireless-to-Ethernet bridges, and some Linux-powered equipment as well.In Chapter 1, we covered the basics of 802.11 and the two modes of operation it supports. Infrastructure Mode, the most common mode, requires the use of a wireless access point.Most access points on the market share a common number of connectors: at least one external antenna, one Ethernet port, status LEDs, and an external power supply or wall wart. Other features you might find on some models include connectors for attaching external antennas, a reset button to return the unit to factory settings, multiple Ethernet ports, and support for Power Over Ethernet (POE).If you're familiar with network cabling, you know that Ethernet uses only two pairs of the wire inside a standard Category 5 cable. Pairs 1-2 and 3-6 are used, leaving 4-5 and 7-8 available.POE sends DC power over these unused pairs, enabling the placement of access points or other network hardware away from power sources. This is especially useful if you need to mount your access point on a pole, on the ceiling, or in other inaccessible places. Run CAT5 wire rather than going to the trouble of running electrical conduit. You can now supply both Ethernet and power to the unit.In June 2003, the IEEE released its specification for POE, 802.3af. More information on this standard can be obtained from the IEEE web site at
https://www.ieee802.org/3/af/
.The IEEE standard is only a few months old as of this writing, so most POE equipment available for purchase will not meet the standard. There are excellent documents from community wireless organizations available on building POE equipment. A few good examples are the Bay Area Wireless Users Group (BAWUG) page athttps://www.bawug.org/howto/hacks/PoE/
and the NYCWireless page athttps://www.nycwireless.net/poe/
.In order to make POE work, you need a power injector, which is referred to in the 802.3af standard as the Power Sourcing Equipment (PSE), and a corresponding unit on the other end. The standard refers to the end device as a PD.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Configuring Access Points
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterWhile many of the manufacturers we've covered allow their wireless equipment to be configured through a web or telnet interface, this is not an option for Orinoco or Apple access points. However, there are two options for configuring Orinoco access points under Linux and at least one option for Apple AirPort configuration.Orinoco provides a program it calls the CLI Proxy. It's available at
https://www.proxim.com/support/all/orinoco/software/dl2002_orinoco_apcli_117_linux.html
. If you look at the accompanying README file, there appears to be support from Orinoco for this product.The release notes and program are from 2002 and have not been updated in a while. The system requirements state that the program runs under Red Hat Linux 6.1 or similar systems. We were able to successfully install and run the package on both Red Hat 9 and Debian Woody distributions.To install the CLI Proxy, download the .tgz file from the Orinoco web site. The help notes suggest unpacking it in the /opt directory, but that's not necessary. The package can be unpacked in any location that makes sense for your filesystem. For our purposes, we'll assume you're using /opt. You'll need 1.5 MB of disk space for installation.To unpack, execute the following command as root:tar xzvf clili117.tar.gz
The package is a compiled binary with no source, so at this point all you can do is execute the program with the command/opt/cliproxy/cliproxy
. You'll see this prompt:[CLI]>
First, read through the HTML documentation that is installed with the program in the /opt/cliproxy/Help directory.The program works by downloading a configuration from an Orinoco access point on your local subnet. The program makes use of broadcast traffic, so your Linux box must be on the same physical network as the access point for it to work. You can also open a local configuration file. This is done through the use of theconfigure
command. Saving the file is accomplished by writing the file to disk or writing it to the access point, and is done by issuing the commandwrite
.The interface is very similar to Cisco IOS, along with tab-completion of commands and the use of theAdditional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Flashing Your Access Point
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterOne feature that is not immediately apparent in the Java Configurator is located in the drop-down File menu: Upload New Base Station Firmware. This feature is also available in the Orinoco configuration software for Windows and in the Apple AirPort software for Mac OS X, as well as in the FreeBase software mentioned earlier.However, a neat hack that the Java configurator and FreeBase allow is the uploading of firmware to a device that does not explicitly match the firmware in question.For example, the original Apple AirPort and the Orinoco RG-1000 are identical hardware, so you can flash either unit with the firmware image of the other. You can also flash both of these models and the Orinoco RG-1100 with the Orinoco AP-500 or AP-1000 firmware (which is quite a feature upgrade because it supports bridging, protocol filtering, RADIUS, and many other advanced configuration options).To flash the firmware, you need the firmware images. The Orinoco CLI proxy software comes with binary (.bin) firmware images for the AP-500 and AP-1000. The Orinoco AP Manager software for Windows comes with these images, as well as the RG-1000 and RG-1100 images. It is available from
https://www.proxim.com/support/all/orinoco/software/dl2002_orinoco_ap_75.html
.Apple has built its firmware updates into the executables for its AirPort updater software. If you're a Mac-head, you can use ResEdit to remove the binary firmware from the executable. However, we won't go into that here. There is a non-Apple web page available that provides binary firmware images for the various AirPort versions:https://www.icir.org/fenner/airport
. Use these images at your own risk. For more information on creative ways to flash an access point, see Chapter 6.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Chapter 6: Building Your Own Access Point
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterWi-Fi access points are inexpensive, because they are now accepted as commodity hardware. You can buy them at discount stores, warehouse clubs, and probably your local gas station. Models with many features and support for 802.11g can now be purchased for well under $100.Why then would you want to build your own access point? Aside from the usual geek reason ("because you can," a.k.a. "why even ask?"), there are many practical reasons:
- Make use of old or surplus PC hardware. An effective access point can be built with a 486/33 and 16 MB of RAM. Many commercial access points are not any more powerful inside. Don't know what to do with that old Pentium? Stick a radio card in it and unwire your house.
- Take advantage of a complete Linux installation. Run an iptables firewall to protect your network, build a web caching server, and set up intrusion detection. If you build a Linux-based access point, you can do almost anything with it.
- Run a customized Linux kernel on off-the-shelf hardware. Wireless access point/routers from Linksys and other manufacturers are actually running Linux kernels inside. Several groups of people have put out alternative firmware for these units. You can build your own custom firmware if you want.
These are only a few good reasons to build your own access point. In order to get started, you need some hardware, a Linux distribution, and some configuration basics. We cover each in turn.As we mentioned, building an access point can be a useful way to resurrect old PC hardware you may have sitting around. Depending on where you want to install it, you can leave it in that old bulky case or dress it up with a spiffy waterproof case and install it outside.One of the wireless routing nodes we built for the NoCat network (https://nocat.net
) in Sonoma County, California, is a beige Macintosh G3/266 desktop machine. It runs Yellow Dog Linux and has two PCI-PCMCIA converters and two Agere Orinoco Silver 802.11b radio cards. An odd choice, you might think—but we had the hardware and it has already functioned as a wireless router for over a year as of this writing.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Hardware
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterAs we mentioned, building an access point can be a useful way to resurrect old PC hardware you may have sitting around. Depending on where you want to install it, you can leave it in that old bulky case or dress it up with a spiffy waterproof case and install it outside.One of the wireless routing nodes we built for the NoCat network (
https://nocat.net
) in Sonoma County, California, is a beige Macintosh G3/266 desktop machine. It runs Yellow Dog Linux and has two PCI-PCMCIA converters and two Agere Orinoco Silver 802.11b radio cards. An odd choice, you might think—but we had the hardware and it has already functioned as a wireless router for over a year as of this writing.There are a few things you'll want to keep in mind when deciding whether any given hardware is right for building an access point:- Processor speed
- While it might seem nostalgic to consider using a 386 or a non-PowerPC Mac for your access point project, these machines are so slow and old that it can be painful running Linux on them. Once you do, they don't have the horsepower to do many neat Linux tricks such as firewalling. Anything faster than a 486/33 is able to act as an access point with little trouble.
- Support
- Older PCs can certainly be made into access points. Bear in mind, though, that you must dig up such ancient artifacts as ISA network cards and SIMM memory. If you need to build on the cheap, this can be the way to go, but all hardware ages and fails sooner or later. If you want reliability, you might want to think about newer hardware. There's also the issue of relying on a PC with a spinning hard disk inside—they will fail, often when you really need them.
- Standardization
- You might be expanding a larger network rather than just installing an access point in your closet. If you build more than one access point for whatever reason, you've just crossed over into the zone of network administration. In this world, standard hardware is the norm, because you can keep single types of replacement hardware on hand, and if you're in a multisite network, it means that everyone who's responsible is familiar with the same hardware.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Software
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterThere are a number of ways you can set up Linux on any of the hardware we discussed in the previous section, ranging from custom-built distributions specifically designed for a particular motherboard to simply installing a full Linux distribution on the hard disk of your recycled PC. We discuss several of the most common distributions that you may want to consider.What all of these distributions share in common is, at least, the wireless drivers you need. As mentioned in Section 6.1.4.1, there are currently two drivers that support the use of master mode: the HostAP and Madwifi drivers. In addition, there are two driver options you can use with a Hermes I (Lucent WaveLAN IEEE/Orinoco/Agere 802.11b) or Hermes II (Agere/Proxim 802.11g) radio card to run in master mode. We cover all four of these driver options in detail.There are several available versions of Linux that are specifically geared toward building your own Linux-powered access point. Most of them have been under development for quite some time and are very stable. Wireless ISPs and community network organizations use these distributions to power their access points.
Section 6.2.1.1: Running Linux off a CF card
One thing you will need for many of these installations is a Linux system that can read a CF card. Don't panic! You don't need a custom-built motherboard such as the Soekris or the Via MII. You need a CF adapter, and you can find it in three flavors:- CF-to-PC Card adapter sleeves
- USB CF reader
- CF-to-IDE adapter
Any of these types of units will work fine for our purposes. The USB reader will obviously require that your Linux system be configured properly for USB, and we don't have the space to go into those details here. However, most USB card readers, once recognized, will use a device name of /dev/sd<x> where x=a-z. If you have other SCSI devices in your system, the CF may not be recognized as /dev/sda.The CF-to-PC Card adapter sleeve is your best option if you are working with a laptop system. You simply fit the CF card into the end of the adapter, then insert the adapter like a regular PC Card. In order for this to work in Linux, you must have pcmcia-cs installed or kernel tree PCMCIA configured in your kernel. We covered both of these in detail in Chapter 2.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Linux-Powered Off-the-Shelf
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterElectronics manufacturers are increasingly turning to Linux to power all sorts of devices: e.g., TV set-top boxes, handheld computers, and mobile phones. Now wireless vendors have begun shipping products running a Linux kernel.For example, Linksys is now selling the WRT54G Wireless Router. As the name implies, it uses an 802.11g radio. However, the name doesn't tell you that the box is really running a custom Linux kernel based on the 2.4.5 kernel code, running on a Broadcom processor, based on a 125 MHz MIPS processor core. As of this writing, a WRT54G can be purchased for as little as $70, making it probably the cheapest project in this book.The Seattle Wireless folks have an excellent page on their web site detailing the work they have done peeking into the innards of this device. You can find it at
https://www.seattlewireless.net/index.cgi/LinksysWrt54g
. Even before Linksys began releasing the source code, people were hacking away at the WRT54G, trying to get a login shell and figure out what made it tick.In the fall of 2003, several of the NoCat folks were hacking away at a newly acquired WRT54G, attempting to learn how to get a login shell on the box. Early on, the Seattle Wireless group had determined that you could execute arbitrary code by using the Ping.asp web page, which is part of the administrative web pages shipped with the unit.If you're just looking for a quick way to upload new firmware, such as a custom Linux distribution, to the unit, skip ahead to "Hacking the WRT54G Firmware," later in this chapter.It was then possible to upload arbitrary files to the unit, which we don't recommend for this reason: we managed to render our WRT54G completely useless by attempting to modify the administrative HTML pages. In other words, the configuration on the box was stuck that way, and we couldn't change it. Due to our error, none of the web pages were accessible, including Ping.asp, which was the only method at that time.The box sat unhappily in a paper bag for a few months. Recently, while reading through the Seattle Wireless pages again, we became aware that someone had managed to solder the correct components on the motherboard of a WRT54G and had a working serial port. With a working serial console, you can interrupt the boot of the unit with Ctrl-C:Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Chapter 7: Bluetooth
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterBluetooth is a wireless cable-replacement technology that uses low-power signals in the 2.4 GHz band. Using Bluetooth, devices can transfer up to 720 kbps. This bandwidth is restricted in comparison to those obtainable from 802.11 wireless technology, and while networking is one application of Bluetooth, it is not the primary application area.Bluetooth's goal is to be a low-cost, low-power, and, above all, pervasive technology. As well as to increase convenience for the user, its aim is also to reduce the cost to the manufacturer by eliminating the need to supply cables with devices. As opposed to single-use cables, a Bluetooth transceiver sustains multiple connections, and, for most applications, the bandwidth constraints are not an issue.As befits a cable-replacement technology, many of Bluetooth's applications are in areas where infrared, USB, or serial connections were previously used: in connecting peripherals, PDAs, cell phones, and other portable devices. One much-trumpeted application that bucks this general trend is mobile phone headsets, which use Bluetooth to carry the audio to and from the user, who is liberated from the tiresome cable.Support for Bluetooth in the Linux kernel is mature, being present in both the 2.4 and 2.6 series of stable kernels. Popular core functions of Bluetooth, such as emulated serial connections and networking, are well-supported. More recent Bluetooth technologies, such as keyboard and mice support, have less well-developed support and require more involvement from the user. User-level applications that support Bluetooth on Linux are of varying maturity: applications simply requiring an emulated serial port work out of the box, whereas specialized Bluetooth tools are under heavy development.This chapter first introduces the core Bluetooth concepts that will aid a Linux system administrator in his deployment, discusses kernel configuration and system-level tools, and finally covers user-level applications.We tested a Belkin Bluetooth USB adapter with several Linux distributions on an IBM ThinkPad A20m. In all cases, we got it up and running to the point where we created a serial port connection between a Bluetooth cell phone (Nokia 3650) and the Linux machine.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Quick Start
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterWe tested a Belkin Bluetooth USB adapter with several Linux distributions on an IBM ThinkPad A20m. In all cases, we got it up and running to the point where we created a serial port connection between a Bluetooth cell phone (Nokia 3650) and the Linux machine.After we set up Bluetooth on each distribution, we completed the following steps (all of this is explained in detail throughout the chapter):
- Set the pinin /etc/bluetooth/pin to a numeric-only pin (
1234
) - Restarted the hcid daemon with
killall -HUP hcid
- Plugged in the adapter
- Discovered the cell phone's Bluetooth address with
hcitool scan
- Configured the serial port (/dev/rfcomm0) with:
# rfcomm bind 0 bluetooth_address
Upon completion, we conversed with the phone over the serial port using Kermit (see Section 9.3).The following sections describe our distribution-specific notes. Even if your distribution isn't listed here, check these notes out.We abandoned the older 2.4.18 kernel that was the latest 2.4 kernel available for Debian 3.0, and we compiled kernel 2.4.24 according to the instructions in "Configuring the kernel," later in this chapter. To get Bluetooth to the point where we could make an rfcomm connection, we follow these steps:- Edited /etc/apt/sources.list according to the instructions at
https://bluez.sourceforge.net/download/debian/APT-README
. - Next, we completed an
apt-get update
and then installed the following packages:- bluez-hcidump
- bluez-pan
- bluez-sdp
- bluez-utils
- hotplug
- The bluez-utils and bluez-sdp packages configured themselves to start in runlevel 3 and 5. After installing these packages, we started them with the following commands (but we could also have rebooted):
/etc/init.d/bluez-utils start /etc/init.d/bluez-sdp start
- The /dev/rfcomm* devices already exist, so we didn't need to create them.
We used SuSE 9.0 (FTP install) with the latest available kernel package (2.4.21-166-default). To enable Bluetooth, we followed these steps:- Installed the following packages using YaST:
- bluez-bluefw
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Bluetooth Basics
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterBluetooth Special Interest Group (SIG), a consortium of telecommunications, electronics, and computer manufacturers, develops Bluetooth. The founding members were Ericsson, Nokia, IBM, Intel, and Toshiba. The first version of the Bluetooth specification was formally adopted by the SIG in 1999.The first revisions of the Bluetooth specification had a mixed reception, because implementations were dogged by interoperability problems. The 1.1 release, published in 2001, eliminated the gray areas from the 1.0b specification and, as a result, improved device interoperability. Over two years since the 1.1 release, Bluetooth is well on its way to becoming a ubiquitous technology in portable devices. At the time of writing, the current approved revision of the Bluetooth specification is Version 1.2, released in November 2003.The Bluetooth specification itself covers the many levels involved in getting a signal between two applications, from the radio through link control to application-level protocols. Figure 7-1 shows just some of the various strata specified by Bluetooth, which we encounter in this chapter. Further details, including the specifications themselves, can be obtained from
https://www.bluetooth.org
.Figure 7-1: Some layers of the Bluetooth specificationBluetooth hardware typically takes the form of one or two microchips, which are embedded in devices. Computers are increasingly shipping with integrated Bluetooth adapters, but the prevailing way of adding Bluetooth support is by adding an external adapter, typically via the USB or PC card ports. Before a device can sport the Bluetooth logo and use the Bluetooth trademarks, it must be put through a series of tests known as qualification. Qualification involves tests for all parts of the Bluetooth specification, from radio testing to protocol conformance.As Bluetooth is intended to replace cable, it can be used for more or less the same purposes as a cable, within the bandwidth constraints of the technology. All the following usage scenarios are supported within Linux and are discussed in this chapter:Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Bluetooth Hardware
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterThere is a wide variety of hardware available for adding Bluetooth support to your computer. Devices fall into several categories:
- USB dongle
- Plugs into the USB port. This device is the most common and economical.
- Built-in
- Increasingly, laptops are shipping with a Bluetooth transmitter built in. Typically this device appears to the operating system as if it were a USB device.
- PC card
- Plugs into a laptop's PCMCIA slot and provides a serial interface to the Bluetooth transmitter.
- CF card
- Behaves in the same way as a PCMCIA card, and it is used with PDA devices.
- Serial dongle
- A Bluetooth transmitter that plugs into the serial port. In the early days of Bluetooth deployment, it was a popular choice; today, however, it is not a recommended option.
Compatibility between Linux and Bluetooth hardware is good. A comprehensive table of verified device compatibility can be found on Marcel Holtmann's web site, athttps://www.holtmann.org/linux/bluetooth/devices.html
. This table includes information for laptops with built-in Bluetooth, too. If you have no specific overriding criteria, it is best to choose a USB dongle. Due to the standardization of the Bluetooth USB interface, compatibility is very good.If you dual-boot your computer between Linux and the manufacturer's operating system, such as Windows XP or Mac OS X, you may want to use the Bluetooth device your vendor recommends. Both the Apple-sold D-Link USB dongle and Microsoft-manufactured USB dongle are known to work with Linux. If in doubt, consult the Linux device compatibility list.When choosing a Bluetooth device, be aware of the difference between Class 1 and Class 2 Bluetooth devices. Class 1 devices have a more sensitive radio and work up to distances of 100 meters, whereas Class 2 devices work up to 10 meters and are cheaper.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Linux Bluetooth Support
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterAs with many emerging technologies, there are competing implementations of Linux Bluetooth support. The main two implementations are Affix and BlueZ. Affix was originally developed by Nokia and is now hosted as an open source project at SourceForge (
https://affix.sourceforge.net
). BlueZ is also available (https://www.bluez.org
) and is the official Bluetooth stack of the Linux kernel.Although Affix is a mature and functional project, BlueZ receives more testing and has more widespread adoption. For this reason, this chapter focuses on the uses of the BlueZ Linux Bluetooth stack and libraries.This section includes all the information that you need to install and configure Bluetooth support from scratch. It is possible that your Linux distribution already contains preconfigured Bluetooth support, which will save you effort. However, the installation instructions provide useful background information for troubleshooting.As Bluetooth is a relative newcomer to Linux, BlueZ support across commercial distributions varies. Generally speaking, if the kernel shipping with your distribution is older than 2.4.22, it is a good idea to upgrade it. Users of "bleeding-edge" distributions such as Debian Unstable and Gentoo should find that Bluetooth is adequately supported.Bluetooth support under Linux requires a recent kernel. If your kernel is Version 2.4.22 or better, or a 2.6 series kernel, then you're all set. Otherwise, you must upgrade your kernel. Alternatively, if you do not wish to upgrade, and have kernel 2.4.18 or better compiled from source, you can apply the patches from the "kernel patches" area of the BlueZ web site (https://www.bluez.org
). Regardless, it's worth checking out the patches, because there are often improvements available that have not yet been merged into the main Linux kernel source.To patch the kernel, first download the most recent patch for your kernel version from the BlueZ web site (for example, patch-2.4.22-mh1.gz), and place it somewhere convenient, such as /usr/src/. Change into the directory where your kernel source is unpacked, typically /usr/src/linuxAdditional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Installing the BlueZ Utilities
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterIn addition to the kernel support, you must install a set of utility programs to help you manage your Bluetooth devices. Table 7-5 shows the names of the packages and their purpose. You can either install the versions of these tools that come with your Linux distribution, or compile and install them from source.
Table 7-5: BlueZ software packages PackagePurposebluez-libsThe application library that all other Bluetooth tools require in order to functionbluez-utilsMain utilities that enable you to initialize and control Bluetooth devicesbluez-sdpService discovery protocol tools that enable the advertisement and discovery of Bluetooth servicesbluez-panTools that enable personal area networking using Bluetoothbluez-hcidumpA debugging tool that permits the monitoring of Bluetooth packetsbluez-bluefwThe firmware for Broadcom chipset-based Bluetooth devicesIf you are compiling the tools from source code, compile and install in the order shown in Table 7-5 to avoid dependency problems.Precompiled version of the utilities can be obtained for Red Hat Linux as RPMs, for Debian stable as .deb packages (the latest BlueZ utilities are an integral part of Debian unstable), and as packages suitable for the Sharp Zaurus Linux PDA. These can be downloaded, along with the source code packages, from the BlueZ download page atAdditional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Basic Configuration and Operation
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterThe bluez-utils package contains the tools you need to configure and test your Bluetooth setup. Once you've installed the package, run the init script (
/etc/init.d/bluez-utils start
on Debian,/etc/init.d/bluetooth start
on Red Hat) to start the Bluetooth subsystem. These scripts normally run on boot, so they may have been started already if you installed from RPMs or Debian packages.The hcid daemon should now be running. This program controls the initialization of Bluetooth devices on the system and handles the bonding process with other devices. We discuss configuration of hcid later in this chapter.The prefix "hci" derives from the name of the interface between the computer and the Bluetooth device, the Host Controller Interface.The hciconfig tool allows the configuration of the characteristics of your Bluetooth adapter. If you are familiar with the configuration of network interfaces, you will find it parallel in operation to ifconfig. Use-a
to display extended information about each Bluetooth device attached to the computer:# hciconfig -a hci0: Type: USB BD Address: 00:80:98:24:15:6D ACL MTU: 128:8 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN RX bytes:4923 acl:129 sco:0 events:168 errors:0 TX bytes:2326 acl:87 sco:0 commands:40 errors:0 Features: 0xff 0xff 0x05 0x00 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 Link policy: HOLD SNIFF PARK Link mode: SLAVE ACCEPT Name: 'saag-0' Class: 0x100100 Service Classes: Object Transfer Device Class: Computer, Uncategorized HCI Ver: 1.1 (0x1) HCI Rev: 0x73 LMP Ver: 1.1 (0x1) LMP Subver: 0x73 Manufacturer: Cambridge Silicon Radio (10)
From this output, you can observe several things, which have been rendered in bold text in the example.- Bluetooth interfaces are referred to as hci0, hci1, etc. in the same way as Ethernet interfaces are generally named eth0, eth1, etc.
- The unique Bluetooth address of our device is 00:80:98:24:15:6D.
- The hci0 device in question is activated, that is, UP.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Graphical Applications
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterLinux has several popular graphical user interface systems, the most well-known being KDE and GNOME. These projects both have tools that provide an easy-to-use interface to your system's Bluetooth devices. At the time of writing, neither project is an official part of the KDE or GNOME desktop, but both will be integrated in future. This section presents a brief survey of the tools available and where to get them.The KDE Bluetooth Framework's home page is at
https://kde-bluetooth.sourceforge.net/
. Its features include:- A control center plug-in to configure Bluetooth devices
- An OBEX server application
- An OBEX sending client
- Graphical exploration of remote devices
- Cell phone handsfree implementation using your computer's microphone and speakers
- Proximity-based screen locking
The KDE Bluetooth Framework can be downloaded from the project's web page. Figure 7-8 and Figure 7-9 show KDE's Bluetooth applications in action.Figure 7-8: Browsing a device's services in KDEFigure 7-9: Receiving a file via OBEX in KDEThe GNOME Bluetooth subsystem's home page is available athttps://usefulinc.com/software/gnome-bluetooth
. Download it from the project's home page. RPM and Debian packages are also available. Features of the GNOME Bluetooth subsystem include:- An OBEX server application
- An OBEX sending client
- A phone manager application allowing sending and receiving of SMS messages
- Graphical exploration of remote devices
- Programming libraries for creating Bluetooth-aware applications in C, Python, or C#
Figure 7-10 and Figure 7-11 show GNOME's Bluetooth features in action.Figure 7-10: Exploring nearby Bluetooth devices in GNOMEFigure 7-11: Sending a file via OBEX in GNOMESection 7.7.2.1: Synchronization
If your PDA uses Bluetooth and you use Ximian Evolution as your calendar and contacts management tool, you can synchronize the two over Bluetooth using the Multisync application. Multisync is available in most Linux distributions, and you can download it from its home page athttps://multisync.sourceforge.net
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Cool Bluetooth Tricks
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterAside from the everyday file management and connectivity, Bluetooth on Linux provides scope for some fun applications. This section outlines a few of them, mostly involving interfacing a cell phone with your computer.Wireless devices that control presentations have been available for some time, but at a relatively hefty price tag, they're probably not worth the investment for the occasional presenter. Instead, why not program your cell phone to do the work?This trick works with Ericsson phones, such as the T610, T68i, and R520m. These phones provide an advanced ability to map keypad presses to output over an RFCOMM serial connection. In turn, a program running on the Linux side can translate these codes into system input events.You can find the code at
https://www.hackdiary.com/projects/bluetoothremote
.Using a similar trick as mentioned previously, the popular MP3-playing application XMMS can be controlled from a suitable Ericsson phone. The bluexmms program even supports display of the MP3 playlist on the phone's screen. You can find instructions and a download athttps://linuxbrit.co.uk/bluexmms
.The BlueZ Bluetooth stack reports the signal strength of an active Bluetooth connection. The KDE Bluetooth Framework has a program that takes advantage of this and activates your screensaver when you take your cell phone out of range.If you don't run the KDE desktop, then try Jon Allen's Perl script to do a similar task, available fromhttps://perl.jonallen.info/bin/view/Main/BluetoothProximityDetection
.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Chapter 8: Infrared
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterInfrared is a legacy technology that won't die any time soon. Sure, it has lousy range and can be a hassle to set up, but sometimes, it's the only common communications medium between your Linux box and something you want to talk to.If you have ever used a remote control, you have used infrared technology. Infrared is a wireless communication technology that makes use of the invisible spectrum of light that is just beyond red in the visible spectrum. It's suitable for applications that require short-range, point-to-point data transfer. Because it uses light, line of sight is a prerequisite for using infrared. Despite this limitation, infrared is widely used in household equipment and is increasingly popular in devices such as digital cameras, PDAs, and notebook computers.Founded in 1993 as a nonprofit organization, the Infrared Data Association (IrDA) is an international organization that creates and promotes interoperable, low-cost infrared data interconnection standards that allow users to transfer data from one device to another. The Infrared Data Association standards support a broad range of appliances, computing, and communications devices.The term IrDA is typically used to refer to the protocols for infrared communications, not exclusively to the nonprofit body.There are currently four versions of IrDA; their differences are mainly in the transfer speed:
- Serial Infrared (SIR)
- The original standard with a transfer speed of up to 115 kbps
- Medium Infrared (MIR)
- Improved transfer speed of 1.152 Mbps; it is not widely implemented
- Fast Infrared (FIR)
- Speed of up to 4 Mbps; most new computers implement this standard
- Very Fast Infrared (VFIR)
- Speed of up to 16 Mbps; it is not widely implemented yet
When two devices with two different IrDA implementations communicate, one steps down to the lower transfer speed.In terms of operating range, infrared devices can communicate up to one or two meters. Depending on the implementation, if a device uses a lower power version, the range can be stepped down to a mere 20 to 30 cm. This is crucial for low-power devices.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - IrDA in the Kernel
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterMost modern kernels have all the support that you need to get infrared to work. If you build your own kernel, make sure that you've enabled infrared support. Most of the infrared support is configured under the IrDA (Infrared) Support section that appears in the kernel configuration. Figure 8-2 shows the make menuconfig kernel configuration screen open to the IrDA Support section. (You may need to select Prompt for development and/or incomplete code/drivers under the top-level Code maturity level options section of the kernel configuration to see all the available options.)Figure 8-2: Configuring IrDA support with make menuconfigYou'll definitely want to configure IrDA Subsystem Support (CONFIG_IRDA) as well as the IrCOMM Protocol (CONFIG_IRCOMM), which lets you use the IrDA port as a serial port via one of the /dev/ircommN ports. We suggest that you compile these as modules and go into Infrared-port Device Drivers and select every driver that it offers you, configuring each as a module.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - PC Laptop with Built-In IrDA
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterThere is a lot of hardware out there, and it's all put together slightly differently. We got infrared working under a couple of different distributions, both with a dongle and the internal infrared. Your configuration should be similar, but if you run into any trouble, check out Jean Tourrilhes's Linux-IrDA Quick Tutorial at
https://www.hpl.hp.com/personal/Jean_Tourrilhes/IrDA/IrDA.html
.To make sure you are up to date with the most recent bug and security fixes, make sure you've installed the most recent updates that are available for your Linux distribution, especially for the kernel and associated modules.Out of the box, we were unable to get infrared working in SIR or FIR mode on our computer, a ThinkPad A20m. On a whim, we went into the BIOS and tried different IRQ and port settings. The combination of IRQ 4 and port 0x3E8 did the trick. The ThinkPad didn't let us switch from FIR to SIR mode in the BIOS, but it let us use SIR mode without any complaints under several Linux distributions.On all of the Linux distributions described in the following list, we performed some initial steps to discover the infrared port. First, we booted the system, and then inspected the output of dmesg to get a list of serial ports:debian:~# dmesg | grep tty ttyS01 at 0x02f8 (irq = 3) is a 16550A ttyS02 at 0x03e8 (irq = 4) is a 16550A
We used this information to figure out which serial devices corresponded to the infrared hardware. If there are a lot of serial devices on your system, this may involve some guesswork or at least a look around the BIOS settings. In this infrared port, we knew that the first serial devices listed (/dev/ttyS1) corresponds to the 9-pin serial port on the back of the computer, so that left /dev/ttyS2.In each of the following examples, we rebooted after making the changes to ensure that everything worked. If you'd like to preserve your uptime, try running/etc/init.d/irda
restart
after making the changes instead of rebooting.- Debian 3.0r1
- Because the latest 2.4 kernel-image package (2.4.18-14.1) was showing its age, we compiled and installed the latest kernel from source (2.4.24). Other than that, we worked with a stock 3.0r1 install with the latest updates. To get infrared working, we installed the irda-common and irda-tools packages, and edited
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Infrared Dongle
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterIf you don't have built-in infrared support, or if you can't get the built-in infrared to work, use an infrared dongle. If your dongle is compatible with the USB and IrDA specifications, it should just work. We tested the WINIC W-USB-180 IrDA dongle (
https://www.winic.com.tw/180.htm
), which is available in the U.S. from MadsonLine (https://www.madsonline.com/
).The most compelling reason to use an external dongle is the awkward placement of infrared ports on devices. Figure 8-3 shows how we had to position an HP iPaq upside down to use it with the ThinkPad's built-in IrDA port. Figure 8-4 shows a much more relaxed positioning using the W-USB-180..Figure 8-3: Awkward infrared port placementFigure 8-4: Taking things into your own hands with an external IrDA adapterAt the time of this writing, support for USB infrared dongles was experimental. We suggest you compile the latest kernel available in the series you are using and configure irda-usb as a module (CONFIG_USB_IRDA
). You should also disable ir-usb, which conflicts with irda-usb. See "IrDA in the Kernel" earlier in this chapterWe got the W-USB-180 adapter to work by following these steps:- We stopped irda, just in case it had been started earlier:
# /etc/init.d/irda stop
- We disabled the ir-usb module, which appears in some recent kernels and conflicts with the driver that we should be using, irda-usb:
# cd /lib/modules/ # find . -name ir-usb.o # cd ./2.4.21-166-default/kernel/drivers/usb/serial/ # mv ir-usb.o ir-usb.o.unused
- (Optional.) If you've already plugged in the dongle in the ir-usb module may have already claimed it. You can convince that module to release the dongle with this command (you may have to run it more than once if there are some other dependencies that prevent the modules from unloading):
# rmmod ircomm-tty ircomm irtty ir-usb irda-usb irda
- Next, we modprobeed the irda-usb module, and dmesg showed that the device irda0 had come up (the actual device name may vary on your system):
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Sharing a Network Connection over IrDA
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterIf you want to accept PPP connections from other IrDA-enabled devices, start pppd listening on the ircomm device that corresponds to your IrDA adapter (these devices are numbered ircomm N, where N is a number from 0 to one less than the number of IrDA adapters on your system). See Chapter 7.In most cases, you'll want more than just a PPP connection. If you want to connect to the Internet from the other device, you'll need your Linux box to act as a NAT router, and you'll also need to tell the PPP client device where it can find its name server. We've found that the following script works well (you may need to customize
$LOCAL
,$REMOTE
,$DNS
,$INTERFACE
, and$IRDEV
):#!/bin/sh LOCAL=192.168.2.1 # IP address for the server running pppd REMOTE=192.168.2.2 # IP address for the device DNS=192.168.254.1 # A DNS server INTERFACE=wlan0 # Interface that connects to the network IRDEV=/dev/ircomm0 # Infrared device # Set up forwarding. # echo 1 > /proc/sys/net/ipv4/ip_forward /usr/sbin/iptables -t nat --flush /usr/sbin/iptables -t nat -A POSTROUTING -o "$INTERFACE" -j MASQUERADE # Start the PPP link. # /usr/sbin/pppd $IRDEV 115200 local \ $LOCAL:$REMOTE ms-dns $DNS \ silent noauth persist nodetach \
To connect from another IrDA-enabled Linux device, align the infrared ports and then issue the following command:# pppd /dev/ircomm0 115200 usepeerdns local nodetach defaultroute
You may need to bring down any existing network interfaces, because thedefaultroute
option generally does not override existing default routes. Some versions of Linux ship with a modified pppd that lets you use thereplacedefaultroute
option to replace any existing default route.To set up the connection to the Linux system:- Select Prefs → Communication → Network (Figure 8-5)
- The Network preferences appear, which list the existing services; click New.
- Give the new service a name and select IR to a PC/Handheld under Connection as shown in Figure 8-6.
Figure 8-5: Opening Network Preferences on the PalmFigure 8-6:Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Connecting to the Internet with a Cell Phone
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterMaking an Internet connection over infrared is really no different from making it over any other serial port, which is described in detail in Chapter 9. For example, to connect to AT&T Wireless's EDGE network with a Nokia 6200 (see "GSM/GPRS Phone with Data Cable" in Chapter 9), use the peers script as shown in Example 8-1. You can use the same attws-connect and attws-disconnect scripts as shown in Chapter 9.Example 8-1. PPP peer settings for AT&T Wireless and the Nokia 6200 over IrDA
# File: /etc/ppp/peers/attws-irda # /dev/ircomm0 # Nokia 6200 115200 # speed defaultroute # use the cellular network for the default route usepeerdns # use the DNS servers from the remote network nodetach # keep pppd in the foreground nocrtscts # no hardware flow control lock # lock the serial port noauth # don't expect the modem to authenticate itself local # don't use Carrier Detect or Data Terminal Ready connect "/usr/sbin/chat -v -f /etc/chatscripts/attws-connect" disconnect "/usr/sbin/chat -v -f /etc/chatscripts/attws-disconnect"
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Transferring Files with OpenOBEX
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterOBEX (Object Exchange) is an IrDA standard (
https://www.irda.org/standards/standards.asp
) for transferring files between devices. OpenOBEX (https://sourceforge.net/projects/openobex/
) is an open source implementation of this standard. To install OpenOBEX, download the latest release (openobex-x.y.z.tar.gz), extract the tarball, then configure, compile, and install it:bjepson@linux:~/Documents> tar xfz openobex-1.0.1.tar.gz bjepson@linux:~/Documents> cd openobex-1.0.1/ bjepson@linux:~/Documents/openobex-1.0.1> ./configure bjepson@linux:~/Documents/openobex-1.0.1> make bjepson@linux:~/Documents/openobex-1.0.1> sudo make install
You'll also want the applications, so download the latest release of the apps (openobex-apps-x.y.z.tar.gz), and go through the same steps:bjepson@linux:~/Documents> tar xfz openobex-apps-1.0.0.tar.gz bjepson@linux:~/Documents> cd openobex-apps-1.0.0/ bjepson@linux:~/Documents/ openobex-apps-1.0.0> ./configure bjepson@linux:~/Documents/ openobex-apps-1.0.0> make bjepson@linux:~/Documents/ openobex-apps-1.0.0> sudo make install
(You may need to add /usr/local/lib to /etc/ld.so.conf and run ldconfig as root for everything to work.)After you've installed the applications, you can transfer files with the irobex_palm3 utility. Don't let the "palm" in the name put you off; we've used it with cellular phones as with well as a Palm (you should be able to use any infrared device that supports OBEX). To receive files, start irobex_palm3, initiate sending a file from your device, and align the ports. After irobex_palm3 receives the file, it exits. Here's a session where irobex_palm3 receives a business card from a Nokia phone:bjepson@linux:~ > irobex_palm3 Send and receive files to Palm3 Waiting for files ..HEADER_LENGTH = 220 Filename = Nokia.vcf Wrote /tmp/Nokia.vcf (108 bytes)
To send a file, be sure that your device is configured to receive files via infrared, align the ports, and useirobex_palm3
filename:bjepson@linux:~> irobex_palm3 sample.png Send and receive files to Palm3 name=sample.png, size=11439 ........... PUT successful
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Synchronizing with a Palm
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterThere are several tools that you can use to synchronize your Palm and Linux system. pilot-xfer, which is part of the pilot-link (
https://www.pilot-link.org/
) package, lets you synchronize your Palm to a directory. You can synchronize to KDE address books, calendars, etc. with KPilot (https://www.slac.com/pilone/kpilot_home/
). GNOME-Pilot (https://www.gnome.org/projects/gnome-pilot/
) lets you do the same with GNOME applications.In each of these applications, you'll be asked to press the HotSync button somewhere along the way. When this happens, launch HotSync on your Palm, select IR to a PC/Handheld, and click the on-screen HotSync button (not the HotSync button on your cable or cradle), as shown in Figure 8-17.You can use KPilot as a free alternative to the Palm Desktop software for Windows and Mac OS X. To set up KPilot with your Palm over infrared:- Launch KPilot (select it from a menu or run the command
kpilot
). The main window appears as shown in Figure 8-14.
Figure 8-14: The KPilot main window- Click Settings → Configure KPilot. The settings window appears, as shown in Figure 8-15. Specify /dev/ircomm N (where N is the number of your infrared device, usually 0) as the Pilot device and click OK.
Figure 8-15: Setting the Pilot device in KPilot- The main window should update to display the following (if it doesn't, check your IrDA configuration):
13:05:54 Trying to open device... 13:05:54 Device link ready.
- Next, click Settings → Configure Conduits to choose the kind of information you want to synchronize. The conduit configuration window appears, as shown in Figure 8-16. Select each conduit you want, and click Enable. Click OK when you are done.
Figure 8-16: Selecting which conduits to use in KPilotTo synchronize with your Palm:- Place your Palm's infrared port in range of that of your Linux system.
- On your Palm, click the on-screen HotSync button as shown in Figure 8-17.
- The first time you sync, you may get a dialog indicating that the Palm already has a username associated with it. If you haven't synced the Palm before, the dialog may be slightly different.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Pocket PC
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterYou can sync with a Pocket PC using SynCE (
https://synce.sourceforge.net/synce/
). If SynCE is not available with your distribution, follow the excellent instructions at the SynCE site for installing and configuring the software.After it's installed, you can generally start SynCE withsynce-serial-config
ircomm
N (where N is the number of your infrared device, usually 0) and then usesynce-serial-start
(run these as root):# synce-serial-config ircomm0 You can now run synce-serial-start to start a serial connection. # synce-serial-start
Oncesynce-serial-start
is running, you should run the dccm utility as the mortal user who wants to play with the Pocket PC (this utility communicates with the synce process that you started as root):bjepson@linux:~> dccm
Now, align your Pocket PC's infrared port with that of your Linux system, and launch ActiveSync. Click Tools → Connect via IR, and your Pocket PC should make an ActiveSync connection, as shown in Figure 8-24. Note that the progress bar never goes anywhere. It's just a live link between the two; it's not actually syncing.Figure 8-24: Never-ending ActiveSyncTo move data between your Linux system and your Pocket PC, you can use commands likepls
to list files on the Pocket PC andpcp
(may bePcp
on some systems) to copy files to and from the Pocket PC. Note that you must prefix the root of the filesystem with ":" when you usepcp
.bjepson@linux:~> pls /My\ Documents/ AC-------- 57727 Thu Jul 31 20:00:02 2003 000013a8 Sample4.jpg AC-------- 67617 Thu Jul 31 20:00:02 2003 00001393 Sample3.jpg AC-------- 45053 Thu Jul 31 20:00:02 2003 00001386 Sample2.jpg AC-------- 64168 Thu Jul 31 20:00:02 2003 00001374 Sample1.jpg Directory Thu Jul 31 20:00:02 2003 0000134a Business/ Directory Thu Jul 31 20:00:02 2003 00001349 Personal/ Directory Thu Jul 31 20:00:02 2003 00001287 Templates/ bjepson@linux:~> Pcp ":/My Documents/Sample1.jpg" File copy of 64168 bytes took 0 minutes and 7 seconds, that's 9166 bytes/s.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Chapter 9: Cellular Networking
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterThe widest of the wide area wireless networks are the cellular networks. They're also among the slowest, unless you're in one of the markets where third-generation (3G) cellular networks are available. At the time of this writing, San Diego and Washington, D.C. users could receive between 300 and 500 kbps from Verizon for $80 a month. The rest of the United States, and much of the world, is still plodding along at between 30 and 130 kbps, depending on several variables: the type of network, capabilities of their terminal (a phone or PC Card), and quality of coverage. This chapter explains these variables to help you make the best choice in cellular data service, and also talks about configuring a cellular phone or PC Card with Linux (although this is usually just a small matter of PPP chat scripting).There are several types of cellular data networks. The most popular are General Packet Radio Services (GPRS) and 1x Radio Transmission Technology (1xRTT). At the time of this writing, slightly faster Enhanced Data rates for GSM Evolution (EDGE) and 1x Evolution Data Only (1xEV-DO) networks are emerging.You use Circuit Switched Data (CSD) when you use your cellular phone as a dial-up modem. When you do this, you use your voice plan. Generally, this is not the best option: CSD calls typically don't receive the full throughput that's available to a data connection. However, there is a high-speed variant called High Speed CSD (HSCSD) that can provide you with better speeds.Unless you need to dial into a private network using a modem, we suggest that you use a packet-switched protocol, such as GPRS, EDGE, 1xRTT, or 1xEV-DO, to make your data connection. With these technologies, you're not dialing a bank of modems; rather, you're effectively using your cellular carrier as your ISP and your phone as a network adapter. Additionally, CSD calls are billed by the minute; with the exception of one plan offering from Verizon Wireless (Express Network NationalAccess) that we're aware of, packet-switched data connections are billed by the amount of data used, rather than the amount of time you spend online (unless you have an unlimited plan, in which case you are paying a flat rate).Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Cellular Data
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterThere are several types of cellular data networks. The most popular are General Packet Radio Services (GPRS) and 1x Radio Transmission Technology (1xRTT). At the time of this writing, slightly faster Enhanced Data rates for GSM Evolution (EDGE) and 1x Evolution Data Only (1xEV-DO) networks are emerging.You use Circuit Switched Data (CSD) when you use your cellular phone as a dial-up modem. When you do this, you use your voice plan. Generally, this is not the best option: CSD calls typically don't receive the full throughput that's available to a data connection. However, there is a high-speed variant called High Speed CSD (HSCSD) that can provide you with better speeds.Unless you need to dial into a private network using a modem, we suggest that you use a packet-switched protocol, such as GPRS, EDGE, 1xRTT, or 1xEV-DO, to make your data connection. With these technologies, you're not dialing a bank of modems; rather, you're effectively using your cellular carrier as your ISP and your phone as a network adapter. Additionally, CSD calls are billed by the minute; with the exception of one plan offering from Verizon Wireless (Express Network NationalAccess) that we're aware of, packet-switched data connections are billed by the amount of data used, rather than the amount of time you spend online (unless you have an unlimited plan, in which case you are paying a flat rate).If your cellular carrier and GSM device supports it, you can make an HSCSD at speeds up to 40 kbps. To enable this capability, you must issue the command
AT+CBST=
speed,0,1
, where speed is a value supported by your phone (you can enumerate the supported values by issuing theAT+CBST=?
command). For example, request 14.4 kbps withAT+CBST=14,0,1
.The isdn4linux FAQ has some information on using HSCSD with ISDN:https://www.mhessler.de/i4lfaq/i4lfaq-6.html#config_gsmv110
. The following sites have information on HSCD commands, although support varies from device to device, and some providers do not support HSCD at all (contact your cellular provider if you are unsure):Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Some Cellular Carriers
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterThere are major cellular carriers around the world; This section looks at some of the major U.S. providers. Of the ones described here, we have hands-on experience with Sprint, Verizon Wireless, AT&T Wireless, and T-Mobile.To connect to the Internet using a GPRS carrier, you must specify an Access Point Name (APN), which is the name of a gateway on the carrier's network that gets you on the Internet. After that, dial *99#***1# to connect. APNs for networks not listed here can be found in a variety of places online, but your best bet is to contact your cellular provider. Opera Software maintains a list of user-submitted carriers and APNs at
https://www.opera.com/products/smartphone/docs/connect/
.All plans and prices listed in the following sections are accurate as of this writing, but are subject to change.AT&T Wireless (https://www.attwireless.com
) offers GSM service with GPRS under a variety of plans. Its consumer-oriented mMode plan tops out at 8 megabytes of data per month for $19.99, with additional megabytes costing about six dollars each.mMode plans must be accompanied by a voice plan. However, AT&T Wireless offers standalone Mobile Internet data plans starting at $29.99 for 10 megabytes (about three dollars per additional megabyte), going up to $79.99 a month for unlimited data (you can also add these plans to service with an existing voice plan). In late 2003, AT&T rolled out support for EDGE on its North American network.AT&T Wireless uses a GPRS APN namedproxy
, which also works with its EDGE data service. You can set your APN with the following AT command sequence:AT+CGDCONT=1,"IP","proxy"
AT&T Wireless maintains online support forums athttps://forums.attwireless.com/attws
that are valuable more for the community discussion than for the actual tech support that goes on there. Check out the mMode and GSM(TM)/GPRS/EDGE General Discussion forums for insights into AT&T Wireless' data services.At the time of this writing, Cingular has just purchased AT&T Wireless, and it is expected to merge its network with AT&T's by the end of 2004. Whether that changes any of the AT&T Wireless-related instructions in this chapter remains to be seen. For more information, consult this book's errata atAdditional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Phones and Cards
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterThe following sections describe the cards and phones that we tested with Linux. They include an assortment of devices that can talk CDMA 1xRTT, GPRS, and EDGE. Each section includes the information you need to make a data call.Table 9-1 contains the results of the testing with these devices. In each download test, we moved a 384 KB compressed datafile down from an HTTP server using wget 1.8.1 (wget_1.8.1-6.1_i386.deb) and recorded the transfer rate. In each upload test, we uploaded the same file using Debian's ftp client (ftp_0.17-9_i386.deb) and recorded the transfer rate.
Table 9-1: Download and upload speeds with various devices DeviceCarrierSignalDownload test 1Upload test 1Download test 2Upload test 2Merlin C201Sprint65%12.64 KB/sec8.7 KB/sec12.86 KB/sec9.0 KB/secMotorola v120eVerizon Wireless97%13.94 KB/sec5.7 KB/sec13.3 KB/sec7.5 KB/secNokia 6200Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Sending a Fax
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterYou can send a fax from your cell phone if both your cellular carrier and your cell phone support it. You can figure out quickly whether your phone supports it by making a Kermit connection (see Section 9.3 earlier in this chapter). Here's a session with a Motorola v120e in which the phone acknowledges that it's capable of Class 2 fax modem commands:
bjepson@debian:~$ kermit -l /dev/ttyACM0 -b 115200 C-Kermit 7.0.196, 1 Jan 2000, for Linux Copyright (C) 1985, 2000, Trustees of Columbia University in the City of New York. Type ? or HELP for help. (/home/bjepson/) C-Kermit>connect Connecting to /dev/ttyACM0, speed 115200. The escape character is Ctrl-\ (ASCII 28, FS) Type the escape character followed by C to get back, or followed by ? to see other options. ---------------------------------------------------- AT+FCLASS=? 0,2.0 OK
However, the following session with the Nokia 6200 shows that it doesn't have any fax modem capabilities:bjepson@debian:~$ kermit -l /dev/ttyUSB0 -b 115200 C-Kermit 7.0.196, 1 Jan 2000, for Linux Copyright (C) 1985, 2000, Trustees of Columbia University in the City of New York. Type ? or HELP for help. (/home/bjepson/) C-Kermit>set carrier-watch off # required for some phones (/home/bjepson/) C-Kermit>connect Connecting to /dev/ttyUSB0, speed 115200. The escape character is Ctrl-\ (ASCII 28, FS) Type the escape character followed by C to get back, or followed by ? to see other options. ---------------------------------------------------- AT+FCLASS=? 0 OK
To send a fax with your cell phone, install a package such as efax (https://www.cce.com/efax/
) and configure it for your modem. In the case of efax, you must edit /etc/efax.rc. At a minimum, you should set the device (DEV), your phone number (FROM), and name (NAME):DEV=ttyACM0 # Your fax number in international format, 20 characters maximum. # Use only digits, spaces, and the "+" character. FROM="+1 401 555 1234" # Your name as it should appear on the page header. NAME="Brian Jepson"
Once you've done this, you can use a client program, such as fax (included as part of the efax package), to send a file:Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Text Messaging
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterSome phones and modems let you send a text message via Short Message Service (SMS) using AT commands. To find out whether your device supports this (nearly all GSM devices do), connect with Kermit, as shown in Example 9-1, and issue the query
AT+CSMS=0
(the three columns indicate whether the device is capable of receiving messages, sending messages, or sending broadcast messages):AT+CSMS=0 +CSMS: 1,1,1 OK
If your cell phone supports this capability, you can work with text messages using AT commands. You can list your text messages withAT+CMGL=4
(the 4 indicates all messages: use 0 for unread, 1 for read, 2 for unsent, and 3 for sent messages) and read a message withAT+CMGR=
MESSAGE_NUMBER:AT+CMGL=4 +CMGL: 1,1,,28 07919170389103F2040B91XXXXXXXXXXF100013011320211500A0AD3771D7E9A83DEEE10 +CMGL: 2,1,,25 07919170389103F2040B91XXXXXXXXXXF100013011329135610A06C8F79D9C0F01 OK AT+CMGR=1 +CMGR: 1,,28 07919170389103F2040B91XXXXXXXXXXF100013011320211500A0AD3771D7E9A83DEEE10 OK
However, you'll want to put the phone into text mode, so the responses that you receive are human-readable. UseAT+CMGF=1
for this, and try reading the message again:AT+CMGF=1 OK AT+CMGR=1 +CMGR: "REC READ","+14015559000",,"03/11/23,20:11:05-20" Soup's on! OK
You can send a message withAT+CMGS=
"PHONE_NUMBER" (but make sure you've set responses to be human-readable withAT+CMGF=1)
. You'll be prompted for the message; type it and press Ctrl-Z when you are finished:AT+CMGF=1 OK AT+CMGS="4015559000" > Hello, world!^Z OK
You can also use the gsmsendsms utility from gsmlib (https://www.pxh.de/fs/gsmlib/index.html
) to send the message:bjepson@debian:~$ gsmsendsms -d /dev/ttyUSB0 4015559000 "Hello, World"
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Acceleration
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterAlthough GPRS and CDMA are pretty slow, some providers have put compression servers on their network to compress documents before they make it to your computer.Verizon Wireless uses a two-tier proxy server called Venturi (
https://www.venturiwireless.com/products.html
). One tier of the proxy server sits on the cellular carrier's network and compresses documents before they come down to your machine. The other tier is a local proxy server that runs on your machine and decompresses the content on the fly before presenting it to your web browser or any other application. (Venturi can compress data sent over a number of protocols including SMTP and POP3.) AT&T Wireless uses something similar, but we do not know what it is. At the time of this writing, there isn't a Linux client for either Venturi (or whatever it is that AT&T Wireless uses). But that shouldn't stop you from asking customer support about it, because it may have changed (at the very least, you should let them know the demand exists).Sprint and T-Mobile have transparent acceleration on their networks. The nice thing about this approach is that it should, in theory, obey web standards without requiring any fiddling on the client side; so it doesn't matter what operating system you're on. To compress HTML, the compression server can use gzip compression; to compress images, it can reduce the image quality. Figure 9-6 shows the T-Mobile Internet Accelerator configuration page (https://getmorespeed.t-mobile.com
). You will not be able to reach this page unless you are connected to the internet2.voicestream.com or internet3.voicestream.com APNs on T-Mobile's GPRS network.Figure 9-6: Configuring the T-Mobile Internet AcceleratorFigure 9-7 shows detail from an image that was sent across T-Mobile's network with compression disabled. Figure 9-8 shows that same detail with maximum compression. Although some artifacts appear in the image, the differences should not annoy most users. This 799 × 599 pixel image started out at 96 KB; compression reduced it to 48 KB.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Chapter 10: GPS
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterThe Global Positioning System (GPS) consists of 27 earth-orbiting satellites (of which 24 are operational and 3 are backups) circling the earth twice each day. These satellites are arranged in six orbital paths, as shown in Figure 10-1.Figure 10-1: Satellites circling the earth in six orbital pathsThese satellites continuously emit coded positional and timing information using low-power radio waves at frequencies around 1,500 MHz. GPS receivers on earth can pick up the signals and calculate the exact (we discuss what we mean by "exact" later in this chapter) positioning on earth. The orbits of the satellites are arranged in such a manner that at least four satellites are visible at any given time. Thus, a GPS receiver is able to receive signals from these four satellites and, based on the various signals transmitted by them, derive positional information on earth.So how does the GPS receiver calculate its position? It does so by measuring the distance between itself and the satellites. Signals emitted by the satellites are received by the GPS receiver after a time lag, and based on the speed of light, the GPS receiver calculates the distance from itself to the satellite. But obtaining the distance from one satellite is not enough, because it tells you only that you are somewhere on the surface of the sphere (think in terms of three-dimensional space). Figure 10-2 shows that you can be anywhere on a sphere with a radius equal to the estimated distance to the satellite.Figure 10-2: A sphere containing all the possible positionsTo pinpoint your exact location, GPS uses at least three satellites to triangulate an exact location on earth. Figure 10-3 shows that if you have two satellites, then you can narrow down your location to the intersection of the two spheres. In this case, you can be anywhere on the dotted line (which is an ellipse).Figure 10-3: Intersection of two spheres forming an ellipseThis is not precise enough. With a third satellite, you can reduce the possibilities to two (see Figure 10-4). But one of these two points is in space, which is not likely the position you are in. Hence, you can effectively derive your position from three satellites, but four or more satellites are needed to get a decent altitude fix.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Uses of GPS
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterThe function of GPS is fairly straightforward—with a GPS receiver, you can obtain your positional information in the form of longitude, latitude, and altitude. It is the way that you use this information that is important. Some useful applications of GPS are described in the following list:
- Military use
- As GPS was originally developed for military use, the U.S. Department of Defense is the main user of the technology.
- Location-Based Services (LBS)
- GPS has been increasingly deployed in the commercial scene. LBS make use of the knowledge of your precise location to provide location-sensitive services. For example, you can use LBS to receive a list of restaurants near your current location.
- Navigation services
- GPS is popularly used for navigational purposes, such as driving and flying. A GPS-enabled PDA can help a driver navigate unfamiliar cities. GPS is also widely used in the shipping industry, as well as in airplane navigational systems. Courier companies, such as UPS and FedEx, make extensive use of GPS in their delivery infrastructures.
- Tracking
- Using GPS to track the whereabouts of people or objects is rapidly gaining acceptance. This is useful in the medical sector: patients suffering from diseases such as Alzheimer's can wear a GPS watch, and, when needed, they can press a panic button to reveal their exact location to their family members.
- Mapping
- GPS is also popularly used in mapping software, allowing you to combine a GPS receiver with mapping software to display your current location. This is useful for travelers or explorers who need navigational aids.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - A GPS Glossary
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterHere are some GPS terms that you will encounter when you use GPS and GPS software:
- 8/12 channels receiver
- An 8-channel receiver uses 8 channels to access 8 different satellites at any one time. A 12-channel receiver can access 12 satellites at once.
- Bearing
- The direction you are aiming for.
- CEP, RMS, and 2D RMS
- Circular Error Probable (CEP), Root Mean Square (RMS), and 2D RMS are all measures of the accuracy of a GPS receiver. CEP represents the radius of a circle containing 50% of the GPS readings. RMS represents the radius of a circle containing 68% of the GPS readings. 2D RMS represents the radius of a circle containing 98% of the GPS readings. If three GPS receivers each claims to have 2m CEP, 2m RMS, and 2m 2D RMS respectively, then the third one is the most accurate, because it has readings accurate to within a 2-meter radius 98 percent of the time.
- DGPS
- Differential GPS is an enhancement to the satellite-based GPS that makes use of receivers on fixed reference points on the ground and improves accuracy to within 3-5 meters. These receivers transmit error-correcting information to DGPS receivers to enhance the information supplied by the satellites.
- Fix
- A location returned by the GPS receiver after processing the readings of at least three satellites.
- Heading
- The actual direction you are traveling towards. It is not the same as bearing. Bearing is your desired direction, but you may not be heading towards the desired direction due to factors such as obstacles (e.g., water, fences, and mountains). Therefore, you have to momentarily head in another direction in a bid to get to your destination.
- Latitude, longitude, and altitude
- The coordinates of a specific location on earth. These three pieces of information together define a point in the three-dimensional space.
- National Marine Electronics Association (NMEA)
- The NMEA-0183 standard has been universally adopted by GPS manufacturers and virtually every GPS product for exchanging navigational information between devices. NMEA-0183 defines a "sentence" format (using printable ASCII text) describing navigational information.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - GPS Devices
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterThere are two main types of GPS receivers on the market at the moment:
- Plain GPS receivers
- GPS receivers with maps
A plain GPS receiver simply interprets the readings from the satellite and returns the result in latitude, longitude, and altitude. Figure 10-5 shows the PocketMap (https://www.pocketmap.com
) PMG-220 Compact Flash (CF) GPS receiver. You can use the PMG-220 on a handheld or your notebook computer (which may require a PCMCIA adapter for the CF card).Figure 10-5: The PocketMap PMG-220 CF GPS receiver with a CF-to-PCMCIA adapterFigure 10-6 shows the Deluo Laptop GPS receiver. This is an affordable receiver ($99) that's available from Deluo (https://www.deluo.com
) in serial or USB configurations. We used the Deluo USB model in our testing for this chapter.Figure 10-6: The Deluo Laptop GPS receiverFigure 10-7 shows two standalone GPS receivers equipped with their own mapping software. The Magellan Meridian Gold and the Garmin StreetPilot III contain built-in screens to display maps. There is no need to connect the receivers to any device for them to work. Standalone GPS receivers are useful for travelers who need a lightweight GPS solution.Figure 10-7: The Magellan Meridian Gold GPS (left) and the Garmin StreetPilot III (Magellen used by permission, Thales Navigation, Inc. 2003; Garmin courtesy of Garmin Ltd.)Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Listening to a GPS
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterListening to a GPS from a Linux box is as simple as listening to any serial device: plug it in, make sure the driver (if any) is loaded, open the port, and read the stream. We tried connecting both the PocketMap CF GPS (using a CF-to-PCMCIA adapter) and the Deluo USB GPS. The PocketMap GPS was detected automatically as a serial port; we needed to load the Prolific 2303 USB/Serial module (modprobe pl2303) for the Deluo GPS to be recognized (it appeared on /dev/ttyUSB0, as did the Nokia 6200 described in Chapter 9).Most GPS devices use a format called NMEA 0183; however, many of them include proprietary extensions. The NMEA standard specifies a transport of RS-232 at 4,800 kbps, 8 data bits, 1 stop bit, and no parity, but some devices support higher speeds. The Deluo GPS that we used sends standard NMEA sentences in the sequence GPGGA-GPGSA-GPGSV-GPRMC. Each sentence is a line of comma-separated text that begins with
$
TYPE (where TYPE is the NMEA 0183 sentence type) and ends with a checksum value, as shown in Example 10-1.Example 10-1. Sample output from the Deluo GPS$GPGGA,071110.000,3242.8536,N,11709.7626,W,1,05,01.5,00104.2,M,-34.0,M,,*50 $GPGSA,A,3,22,16,,14,20,,,,,25,,,02.5,01.5,02.1*05 $GPGSV,3,1,10,22,11,117,35,16,13,151,35,11,44,256,,14,26,056,35*78 $GPGSV,3,2,10,20,32,316,34,01,22,266,,30,09,052,,02,07,172,*76 $GPGSV,3,3,10,23,30,110,33,25,70,061,39*77 $GPRMC,071110.000,A,3242.8536,N,11709.7626,W,000.0,000.0,100204,013.0,E*7D
The checksum is a two-digit hexadecimal value that's created by XORing the ASCII values of each character in the sentence, except for the leading$
and*
that precede the checksum itself. For example, the Perl code shown in Example 10-2 verifies the checksum of each line in Example 10-1.Example 10-2. Verifying NMEA 0183 sentence checksums#!/usr/bin/perl -w # # gpscksum.pl--verify each NMEA 0183 sentence in standard input # use strict; my $count=1; while (<>) { my ($string, $cksum); if (/^\$(.*)\*([0-9A-Fa-f][0-9A-Fa-f])/) { $string = $1; # everything between leading $ and checksum $cksum = $2; # hex checksum from NMEA sentence } else { die "Malformed NMEA 0183 sentence: $_\n"; } # Calculate the checksum my $my_cksum; for (my $i = 0; $i < length ($string); $i++) { $my_cksum ^= ord(substr($string, $i, 1)) } # Compare the checksums if ($my_cksum != hex($cksum)) { print "Checksum for line $count doesn't match: ", $my_cksum, "!=", hex($cksum), "\n"; } $count++; }
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Mapping Wi-Fi Networks with Kismet
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterWe introduced Kismet in Chapter 3 as a powerful network scanner. You can also use it in conjunction with GPSd to map out the locations of Wi-Fi networks. (For the basics of getting Kismet running, see Chapter 3.) Once you have Kismet and GPSd up and running, you can make them work together.If you plan to do some network mapping with Kismet, keep the following in mind:
- Put the computer somewhere safe and out of the way. Don't put it someplace where a sudden stop will send it into your lap or through a window.
- Forget that the computer is there while you are driving. If you have to fiddle with it, pull over first. If you can have a friend driving with you who can operate the computer, all the better. Do not let the computer distract you while you are driving.
- Make sure that the GPS gets a fix before you start driving. It may be hard for it to get a fix while you are in motion.
- Put the GPS somewhere where it can easily pick up the satellite signals. Your best bet is to get a magnetized external antenna that can attach to your roof. Be sure that there are no loose wires sticking out of your window. Don't slam the wires in the door!
Above all, when you are driving a car, your first responsibility is to drive safely. Pay attention to the road and drive carefully.To map networks with Kismet and GPSd:- (Optional.) Load any modules needed for the serial port you're using for the GPS:
$ sudo modprobe pl2303 $ dmesg | grep tty ttyS00 at 0x03f8 (irq = 4) is a 16550A ttyS02 at 0x03e8 (irq = 4) is a 16550A usbserial.c: PL-2303 converter now attached to ttyUSB0 (or usb/tts/0 for devfs)
- Start GPSd, specifying the serial port with
-p
and the speed with-s
:$ sudo gpsd -D9 -p /dev/ttyUSB0 -s 4800
- Telnet to GPSd and use
p
until you have a reliable fix; you can disconnect when you are done:$ telnet localhost 2947 Trying 127.0.0.1... Connected to debian. Escape character is '^]'. p GPSD,P=0.000000 0.000000 p GPSD,P=41.485882 -71.524841 ^] telnet> q Connection closed.
- Launch Kismet with the
-g
(GPS) switch and specify the hostname and port that GPSd is listening on:
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - GpsDrive
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterGpsDrive (
https://www.gpsdrive.cc/index.shtml
) is an open source GPS-aware navigation system that uses GTK+. It works with maps from a variety of sources, and plot waypoints, and even lets you share your position with friends and send SMS text messages with position information.If you launch GpsDrive while GPSd is listening on the localhost, it will pick it up and start reading coordinates from it. By default, GpsDrive displays a placeholder map that's not very detailed (see Figure 10-9). However, you can download new maps by clicking the Download Map button and selecting the map server from the dialog that pops up, as shown in Figure 10-10.Figure 10-9: Default map from GpsDriveFigure 10-10: Selecting a map to download in GpsDriveUsing GpsDrive to download maps from a commercial map service may violate that site's Terms of Service (ToS). Be sure to consult that mapping site's ToS before proceeding.The latest beta version as of this writing (2.08pre12) comes with support for NASA's Blue Marble (https://earthobservatory.nasa.gov/Newsroom/BlueMarble/
) satellite images. You must download some extremely large files (over 1 GB uncompressed) and install them according to the README.nasamaps file that's included with the GpsDrive distribution. Figure 10-11 shows the NASA maps in action.GpsDrive does not support route planning, but it does show your speed, position, and altitude. What's more, a version is available that runs on Linux-powered handhelds (https://www.gpsdrive.cc/pda.shtml
), so you can load it up with waypoints for points of interest and use it while you wander around unfamiliar territory.Figure 10-11: Using NASA's Blue Marble satellite maps with GpsDriveAdditional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing! - Other Applications
- Content preview·Buy PDF of this chapter|Buy reprint rights for this chapterLinux is a playground for geographic information, and there are a lot of other applications out there for you to play with. GPStrans (
https://sourceforge.net/projects/gpstrans
) and GARNIX (https://homepage.ntlworld.com/anton.helm/garnix.html
) are free applications that exchange information (track, route, waypoint, etc.) with a Garmin GPS. If you want to enjoy the increased accuracy of Differential GPS without having to buy a DGPS radio, see the DGPS over the Internet project athttps://www.wsrcc.com/wolfgang/gps/dgps-ip.html
.If you're looking for a public map server with U.S. street maps, the U.S. Census Bureau makes street maps that date from 1998, available at the TIGER Map Server (https://tiger.census.gov/cgi-bin/mapbrowse-tbl
). The maps on this site are public domain, and you can specify latitude, longitude, marker positions, and more in the URL. If you want to put a bunch of markers on the map (such as Wi-Fi hotspots), see the instructions athttps://tiger.census.gov/instruct.html#MURL
. The Tiger web server is loosely maintained by the Census Bureau and is not always in a working state.One of the best resources for free/open source geographic information is the FreeGIS project (https://www.freegis.org/
). This site contains an overview of the massive world of free Geographic Information Systems (GIS) software and provides software on CD-ROM. FreeGIS also acts as a central point for communication and collaboration on free GIS projects. You can browse the software by category athttps://www.freegis.org/browse.en.html
and its list of geographic data (including maps and other geographic models) athttps://freegis.org/geo-data.en.html
.Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Return to Linux Unwired
About O'Reilly | Contact | Jobs | Press Room | How to Advertise | Privacy Policy
© 2007, O'Reilly Media, Inc.
All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.