Wednesday, September 28, 2011

Run X-CTU with MacOS X Lion

X-CTU is the Windows software that is required to update the firmware of the XBee radios. It is not compatible with neither Linux nor Mac, but it can be used with wine - the Windows emulator.

I used Wineskin which produces standalone Mac Software packages based on wine.
First of all, get the X-CTU program from digi.com, and get wineskin for Mac.

Follow the tutorial for software with a windows installer that comes with wineskin.
Just name your wrapper X-CTU and point to the X-CTU installer from digi.com in the steps where the tutorial uses Neverball.

After clicking the advanced tab of your new wrapper, in the tools section you click "Test run application" to test your X-CTU program that you just wrapped for Mac.
You will see immediately that it complains that it cannot connect to com ports - as there are no com ports on the Mac.

We have to map the USB ports to the com ports by hand:
The port mappings for your new wrapper live under Contents/Resources/dosdevices in the wrapper we just created and should have still opened in finder (at /Users/yourusername/Applications/Wineskin/X-CTU.app).
We now create softlinks from the mac USB ports to windows com ports. Plug in your device, open terminal and go to the dosdevices folder:
cd /Users/yourusername/Applications/Wineskin/X-CTU.app/Contents/Resources/dosdevices

Look up the device location of your plugged in device, it should be /dev/tty.usbserialXXXX for an XBee on a XBee explorer connected via USB. Here, XXXX is the device ID and is different for every device.
Choose a high number for the com port, as the lower ones may be already in use by wine. I have chosen 10.
ln -s /dev/tty.usbserialXXXX com10

Kill and test run your X-CTU wrapper application again, and the complaint about the missing com ports should be gone. Add your new com port now, so that X-CTU knows it:
In the bottom panel, go to the "User Com Ports" tab. At the right, put your com port number in the box (e.g. 10) and press the "Add" button.
It now appears in the top panel, and you should be able to test/query the XBee sucessfully.

Your very own selfmade Mac version of X-CTU and your XBee should now be able to play well together.

Caveat: The com port number is forgotten by X-CTU on shutdown. So you have to go to "User Com Ports"->"Add" every time you start up your X-CTU wrapper again.

2 comments:

  1. Thank you! Constantly amazed at the great resources out there! This is going to help me out tremendously out at Burningman.

    mauricio

    ReplyDelete