Configuring Bluetooth

Tooth Print


Even if your printer vendor doesn't advertise Linux Bluetooth support, there are a few tools that may help you set up your Linux system for Bluetooth printing.

By James Mohr

Draga Michaela, Fotolia

My initial search for a Linux Bluetooth print driver took me to Google and a number of Internet sites. Unfortunately, the drivers I found were several years old, and the documentation included references to "supported" hardware that was no longer even produced. Searching for Bluetooth printers and related hardware brought up quite a few devices, and all of them naturally came with Windows drivers, but none of the devices specifically advertised Linux drivers.

If you read the documentation from printer vendors, you might wonder whether Linux is totally excluded from the world of Bluetooth printing. Luckily, the Linux community has already forged its own solutions to the problems of Bluetooth printing [1]. This article describes some of the tools you'll need to configure Bluetooth printing in Linux.

I am using SUSE 10.0 and discovered that, although I had not yet installed any Bluetooth components, everything I needed to print with Bluetooth was already in my own backyard. On SUSE systems, all you need to do is start up YaST and search for blue to find more than you need to configure Linux Bluetooth printing. See Table 1 "Packages for Bluetooth Printing" for a summary of the packages I used.

These packages are also available with other Linux distros. Consult your vendor documentation.

Getting Ready

My workstation has a BlueFRITZ USB 2.0 Bluetooth adapter. This device came with a CD containing various Windows drivers, but no driver for Linux. That actually didn't matter because the drivers provided by SUSE 10.0 work with this device right out of the box. However, the bluez-firmware package I installed from the SUSE media only provides support for the Broadcom BCM2033 chip. In my case, this was not a problem because this is the chip in my BlueFRITZ adapter. Support for other chips, such as the STMicroelectronics STLC2500, can be found in the bluez-firmware package available at the BlueZ Linux Bluetooth website [2].

I have two printers that I wanted to configure for Bluetooth printing. The HP Photosmart A618 comes "Bluetooth ready," so from the printer side, I didn't need to do anything special. The HP Deskjet 460 does not have Bluetooth support by default, and it requires an extra Bluetooth printer card.

Rather than editing a bunch of files, I chose to configure everything directly through CUPS. If CUPS is not installed, you will probably find it through the package system for your Linux distro. Details on configuring printers with CUPS are found on the CUPS homepage [3]. Bluetooth printing with CUPS requires the bluez-cup package. Configuring Bluetooth CUPS printing is as easy as configuring any other CUPS printer; however, you do need the hardware address of the printing device.

The first tool I found that could get me the hardware address of a Bluetooth printer was kbtserialchat, which is part of the kdebluetooth package. kbtserialchat is intended as an aid for debugging Bluetooth connections. This handy tool displays a list of devices it finds, from which you can then select a device to connect to. Once connected, the Bluetooth Serial Chat box displays the device's hardware address (Figure 1).

Figure 1: kbtserialchat displays the Bluetooth devices it discovers.

The command-line utility hcitool, which is part of the the bluez-utils package, provides information on the Bluetooth devices it finds and also offers some configuration options. Running hcitool scan shows the hardware address and a description of the devices it finds:

Scanning ...
08:00:17:33:6F:CD Deskjet 460 S/N
MY58A110Q9
00:16:41:1F:9D:83 Photosmart A610 series

The first term in each entry is the hardware address of the device. You need to make a note of this address because you will need to use it when you add the printer to your system.

After logging in to the CUPS server, from the Administration menu click on Add Printer. Input an appropriate name, location, and description, then click Continue. If the bluez-cups package is installed correctly, when you click on the Devices drop-down list, you should see the entry Bluetooth Printer. Select this and then click on Continue.

On the next screen, you are asked to input the URI for the device to which you want to print. The screen contains a number of examples, but none of these examples address Bluetooth. However, the syntax is more or less the same as for other protocols: protocol://path. In this case, the protocol is bluetooth, and you use the hardware address as part of the path. You also need to include the service you want to access. In this case, the service you are accessing is serial port printing (spp). As of this writing, I have not found any cases in which you would use a different service.

In the output above, note that the hardware address of the the Deskjet 460 is 08:00:17:33:6F:CD. When you combine this address with the protocol and service, the complete URI is bluetooth://080017336FCD/spp. Remove all of the colons from the hardware address. The screen on which you add the URI is shown in Figure 2.

Figure 2: Configuring the Device URI to connect to a Bluetooth printer.

After you input the URI, click Continue to proceed with the rest of the printer configuration. As is often the case, it is possible that no driver for your particular model of printer shows up. As in other cases, choose the nearest model. For example, when I first configured the HP Deskjet 460, I could only find a driver for the HP Deskjet 450, so I used it instead. In most cases, the results will be fine. After you add the driver, the complete printer configuration looks like the configuration in Figure 3.

Figure 3: The completed Bluetooth printer configuration.

I was surprised to discover that the HP Photosmart A618 does more than just simply accept the Bluetooth connection. Through the configuration menu, which is shown on a small screen, you have several different Bluetooth-related configuration options. You can change the passkey for the device, define whether the device is visible to other devices, or disable all of the security features.

The two HP printers I used are not the only Bluetooth-capable printers. Although the number of available printers is nowhere near what is available with a USB connection, Bluetooth supports many different kinds of printers from various vendors. Some of the printers I found have already been replaced by newer models, so check vendor home-pages for information.

Conclusions

A problem occurs when you want to print to existing printers that are not Bluetooth capable. There are several different Bluetooth printer adapters that plug into the printer and turn it into a Bluetooth-capable device. For example, the HP BT450 printer adapter and the Ambicom Bluetooth printer adapter convert a USB printer into a Bluetooth printer. I also found a number of adapters that provide Bluetooth access to a parallel printer. However, when I checked vendor websites, all of the parallel printing adapters I saw were either discontinued or expensive. In the latter case, it may make more sense to buy a new printer that is Bluetooth capable rather than investing in an adapter.

INFO
[1] Marcel Holtmann's Bluetooth Information: http://www.holtmann.org/linux/bluetooth
[2] BlueZ Official Linux Bluetooth protocol stack homepage: http://www.bluez.org/
[3] Common Unix Printing System (CUPS) homepage: http://www.cups.org/