Wednesday, January 25, 2012

Setting up FTDI (for XBee) on Mac OS X

My awesome brother and I have been playing with XBee radios for the past few days.  Darned near all of the programming interfaces -- and fancier breakout boards -- use a USB-to-FTDI serial translator.  I've got a new Air here that doesn't have the drivers installed yet.  So, since it took a minute or two to determine what I needed, here's my quick outline for the next time:
  • You want the Virtual Comm Port (VCP) version of the driver.
  • Plug in.  See if Terminal.app shows the new cu and tty devices, with `ls -l /dev/*usbserial*`
  • CoolTerm seems to be a nice terminal emulator.  (ZTerm still works, for the old-skoolers!)
  • Plug in USB .. to FTDI translator .. to breakout board .. to XBee radio.
  • XBees ship with 8N1 serial at 9600 baud.  Set your terminal emulator accordingly.
    • XBees don't echo your input, so turn on Local Echo in your terminal emulator.
  • In the terminal emulator, type "+++" to get into command mode.  XBee will reply "OK."
  • Continue building your robot army.
You don't actually need CoolTerm or ZTerm, if you don't mind that `screen` won't do a local echo.  If you're okay with typing blind, a `screen /dev/cu.usbserial*` command should work just fine (as long there's only one usbserial device connected at a time).  Crafting a one-liner that fakes local echo is left as an exercise for our new robotic overlords.

No comments:

Post a Comment