Captain's Universe Home
Captain's Universe Home
Cosmic Ray Muon DetectorTeleGarden Pages
Time on MarsBryophyllum Plants
Jupiter Radio AstronomyAncient Pages
Salzburg Tourist GuideEarth Magnetometer
  H O M E     AJAX & MORE     LINUX & MORE     RTAI     XENOMAI     ADEOS IPIPE      
    JAVA & BROWSERS     *NIX     ELECTRONICS     REVIEWS     ARTEMIA     FAIRY SHRIMP      



JAVA: Serial Port Console for Windows, Linux etc.

Here we have a simple Serial Console e.g. for testing embedded microcontroller board. This shell send the line you type in at the top of the application window to the serial port and the received characters are displayed in the text-area below. For testing this application just connect the RX pin of your serial port with the TX pin. So the application will display the string typed into the text-line in the text-area below.


Screenshot

JAVA: Serial Port Console for Windows, Linux etc.


UPDATE:
If you use a USB-to-Serial converter, remove the line:
serialPort.notifyOnOutputEmpty(true);
Otherwise the application will hang. It seems that the linux kernel driver usbserial doesn't support the event OUTPUT_BUFFER_EMPTY.

If you run the JAVA application from your shell or the windows command line, you see something like this:
$ ./run.sh
Set default port to /dev/ttyS0
Experimental:  JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
RXTX Warning:  Removing stale lock file. /var/lock/LCK..ttyS0
Available port: /dev/ttyS1
Available port: /dev/ttyS0
Found port: /dev/ttyS0
Send: Nullmodem test
Read: Nullmodem test
numBytes: 14
The default ports are:
  • COM1 for windows
  • /dev/ttyS0 for linux
If you want to use another port, just specify it in the run-script:
java -Djava.library.path=lib -jar Splash.jar [port]
where [port] is e.g. COM1 or /dev/ttyS1

Download

JAVA Serial Port Console V200702250830

If you run the provided .jar file you need to have JAVA 1.6.0 or better installed. If you have an older JAVA version, recompile it.

Acknowledgement:
Thanks to www.rxtx.org for the serial port library!
This ZIP archive contains rxtx-2.1-7.




Last-Modified: Sat, 19 May 2007 18:40:01 GMT

Google
 
Web www.captain.at
go to top
© 1996-2010 . All rights reserved.
No reproduction, distribution, publishing or transmission of the copyrighted materials at this site is permitted. Policy
go to top