Page 336 - Hacking Roomba
P. 336

Chapter 14 — Putting Linux on Roomba                317



                             USB Serial Port Drivers

                             The Linux USB serial device drivers that have been packaged for OpenWrt are: ftdi_sio,
                             pl2303, belkin_sa, and mct_u232. These four drivers enable you to communicate with
                             90 percent of the USB-to-serial adapters out there and all of the generic ones.
                             Figure 14-9 shows a common generic USB-to-serial adapter. The actual chip for the adapter is
                             embedded in the hood of the RS-232 connector. These are available from various online retailers
                             like NewEgg.com for around $9. There’s no indication as to which chip one uses; you have to
                             plug it in to find out. But for only $9 it’s a pretty cheap experiment, and if it isn’t supported you
                             can probably use it on a fully-fledged PC.
                             The Keyspan adapter you’ve used in the previous chapters doesn’t use any of these drivers.
                             There does exist an open-source Linux driver for the Keyspan adapter. It just hasn’t been
                             packaged for OpenWrt yet. There’s no reason to think that it wouldn’t work. Most users of
                             USB serial on OpenWrt are connecting to GPS devices and PDAs, both of which tend to use
                             the same USB-to-serial chips as the generic adapters.
                             The RooStick uses the Silicon Labas CP2103 chip, which appears to work with the standard
                             Linux cp2101 driver. Unfortunately that’s another driver that hasn’t been packaged for use
                             with OpenWrt yet. There’s no reason to think it couldn’t be and it may be part of the next
                             OpenWrt distribution.

                             On the positive side, the Arduino board uses an FTDI chip that is supported by the ftdi_sio
                             driver. This means you could program an Arduino board to do something based on serial com-
                             mands and then plug the board into the WL-HDD. This is very powerful. It’s so easy to add
                             sensors and actuators to Arduino that Arduino could become a sort of I/O co-processor for the
                             WL-HDD.

                             There have been sporadic reports of problems with combinations of some WL-HDDs with certain
                             USB-to-serial adapters. If you have problems with one serial adapter, try another. If you think the
                             problem is due to the WL-HDD, try the Linksys WRTSL54GS discussed in Chapter 15. It’s almost
                             twice as expensive but has a more advanced USB interface with fewer reported problems. This is
                             the disadvantage of hacking consumer electronics: there’s no guarantee the vendor will keep the
                             device the same.

                             Installing USB Serial Port Drivers in OpenWrt
                             Thanks to ipkg, installing new kernel modules is a snap. Kernel modules are packaged up just
                             like normal programs. The two kernel module packages needed to get serial working are:

                                 kmod-usb-ohci: Contains the drivers usbcore and usb-ohci needed to talk to the
                                 USB interface.
                                 kmod-usb-serial: Contains the general driver usbserial and the device-specific
                                 drivers ftdi_sio, pl2303, belkin_sa, and mct_u232.
   331   332   333   334   335   336   337   338   339   340   341