Skip to content

Integrating a serial output window with Eclipse

HishamR edited this page Sep 18, 2014 · 12 revisions

Introduction

This tutorial shows how to integrate a basic serial terminal in Eclipse. This terminal can only receive and output serial data from the Arduino and not actually send data to the Arduino. It's simple to install and tutorial for all major operating systems are(soon) available. A tutorial of how to configure the serial terminal is also available at the bottom of this tutorial.

Mac

  1. Use the menu "Help --> Install New Software" and enter http://download.eclipse.org/releases/luna
    Then check the box next to "Target Management Terminal" in "Mobile and device management", then keep pressing "Next" until the install is complete.

  2. Download these files:
    http://jlog.org/v4/macosx/mac-10.5/RXTXcomm.jar
    http://jlog.org/v4/macosx/mac-10.5/librxtxSerial.jnilib
    http://jlog.org/v4/macosx/fixperm-217-leo.sh

  3. Move "RXTXcomm.jar" and "librxtxSerial.jnilib" into "/Library/Java/Extensions"

  4. Move "fixperm-217-leo.sh" to Desktop

  5. Open "Terminal"(found under Application --> Utilities)
    $ cd Desktop
    $ sudo sh ./fixperm-217-leo.sh
    Password: <your administrator password>

  6. Open(or restart) Eclipse

  7. Go into "Windows --> Show View --> Other ..."

  8. Choose "Terminal" under the "Terminal"-category, then press OK.

  9. Done! You should not see a terminal window available within Eclipse!
    Continue reading "Configuring the serial terminal" below, to properly configure your serial terminal!

Sources:
http://mcuoneclipse.com/2014/03/23/serial-terminal-view-with-eclipse-kepler/
http://jlog.org/rxtx-mac.html

Windows

Download files from here: http://jlog.org/rxtx-win.html

Put 'RXTXcomm.jar' in the 'lib/ext' folder of the Java VM (e.g. 'C:\Program Files\Java\jre1.8.0_20\lib\ext').

Put 'rxtxSerial.dll' in the 'bin' folder of the Java VM (e.g. for Sun's Java 1.6.0_04 it will be 'C:\Program Files\Java\jre1.8.0_20\bin').

Use the menu "Help --> Install New Software" and enter 'http://download.eclipse.org/releases/luna'

Then check the box next to "Target Management Terminal" in "Mobile and device management", then keep pressing "Next" until the install is complete.

To show the terminal you go to Show View -> Other -> Terminal -> Terminal

You should now have a functioning terminal inside of Eclipse. See below for configuration.

Linux

Install the Plugin

  1. Use the menu "Help --> Install New Software" and enter http://download.eclipse.org/releases/luna
    Then check the box next to "Target Management Terminal" in "Mobile and device management", then keep pressing "Next" until the install is complete.

  2. Launch Eclipse, go to Help->Install New Software, add this site location:

    rxtx: http://archive.eclipse.org/tm/updates/rxtx/

    Check the lastest version and click next until installed

Make it work

Just installing this alone will not work on linux, on ubuntu eclipse will crash every time you try to connect to a serial port.

Follow these additional steps to make it work:

  1. update sources

    sudo apt-get update

  2. install the Ubuntu version of the serial java library

    sudo apt-get install librxtx-java

  3. delete the plugin version of the library

    rm eclipse/plugins/gnu.io.rxtx.linux.x86_64_2.1.7.3_v20071015/os/linux/x86_64/librxtxSerial.so

  4. create a soft link from the system version of the library

    sudo ln -s /usr/lib/jni/librxtxSerial.so eclipse/plugins/gnu.io.rxtx.linux.x86_64_2.1.7.3_v20071015/os/linux/x86_64/librxtxSerial.so

    ** Do not use the one at /usr/lib/librxtxSerial.so instead of /usr/lib/jni/librxtxSerial.so **, it doesn’t work that way.

  5. Launch Eclipse and go to Window->Show View->Other on the pop-up window, select Terminal- >Terminal and click OK.

Sources: http://karibe.co.ke/2014/03/eclipse-kepler-terminal-plugin-serial-port-console-in-linux/

Configuring the serial terminal

  1. Press the "yellow notepad"-button in the "Terminal"-window. It looks like this:

  2. A new window should appear. In this window you primarily have to choose "Serial" in the "Connection Type:"-drop-down list. (Look at the image below)

  3. The window should update and show additional settings you can customize for the serial connection. What works fine so far cross over the operating system are the settings shown in the image below. What will vary between computer and operating system is the port setting, which should be easily configured using the drop-down list. Also note the "Baud Rate: " value can change depending on the program running on the Arduino you are trying to serial communicate with.