Sunday, December 30, 2012

X-CTU on Ubuntu

Digi's X-CTU is a Windows only application. However, it can be made to run quite well under Linux. This is how I set it up under Ubuntu 12.10. (I used Google to find the answers to many of my questions. Thanks Lazyweb.)

Linux requires users to have permissions to access hardware. In this case the user needs to be a member of the dialout group. Do the following as the user you intend to run X-CTU under:
    sudo adduser ${USER} dialout
Note: You will have to logout and login for the changes to be fully realized.

First get wine:
   sudo apt-get install wine

Then symlink the Linux serial devices to:
   ln -s /dev/ttyUSB0 ~/.wine/dosdevices/com5
   ln -s /dev/ttyUSB1 ~/.wine/dosdevices/COM5
   ln -s /dev/ttyUSB0 ~/.wine/dosdevices/com6
   ln -s /dev/ttyUSB1 ~/.wine/dosdevices/COM6
Note: I used both uppercase and lowercase "COM" because it seemed that the lowercase worked when I was troubleshooting.

Go to: http://www.digi.com/support/productdetail?pid=3661 and click on "General Diagnostics, Utilities and MIBs" which will reveal the download for X-CTU. Download X-CTU (I used XCTU ver. 5.2.7.5):
    http://ftp1.digi.com/support/utilities/40003002_B.exe

Make the file executable:
    chmod 755 40003002_B.exe

Open X-CTU installer with wine program loader by right-clicking on the file in Nautilus and choosing: Open with Wine program loader. Install application.

Selecting Serial Port

Every time you run X-CTU you will need to add the user com port. I used '5' below for COM5, which represented /dev/ttyUSB0 on my machine:


You must select the COM port before the Test / Query operation will work

Updating firmware

One of the things that doesn't work in X-CTU under Wine is the auto firmware download from the web. However, when you download the files manually and extract them to the correct location, you can update the XBee just like under Windows.

Navigate to: http://www.digi.com/support/productdetail?pid=3661 and download the latest firmware. I used "XBee / XBee-PRO ZB firmware ver. 2xA7" which was the 82001817_G.zip file (Dec 2012). Then copy to the update directory:
    cp ~/.wine/drive_c/Program\ Files\ \(x86\)/Digi/XCTU/update/

Now from within X-CTU, add the updates using the Modem Configuration tab and clicking on "Download new versions..." button. Then click on the "File..." button and choose the zip file under the update directory. Restart X-CTU and the new firmware should be available.

Updating XBee Firmware

To update the XBee select the correct serial port and click on the Modem Configuration tab, then check the "Always update firmware" check box. Next select the correct Modem, Function Set, and Version (It appears that the list of versions are ordered in reverse, whereas the newest firmware is listed first). Once selected, click on the "Write" button. See screenshot below:



1 comment:

Sufi said...

Good job budy... helped me...