Java comm and basic stamp
Borna
Posts: 36
Hello all,
Im interested to have an external program written in Java, writes a byte to a serial port and have Basic Stamp listen for that. Once the byte is received, Stamp should perform a task based on that byte.
Im looking to write that in Java using PC with Windows. I cant find any example of Java writing to COM port. Can anyone suggest a good material, sample code that I use and expand? Also it seems that Sun/Oracle no longer support comm. APIs Programming in windows.
Im interested to have an external program written in Java, writes a byte to a serial port and have Basic Stamp listen for that. Once the byte is received, Stamp should perform a task based on that byte.
Im looking to write that in Java using PC with Windows. I cant find any example of Java writing to COM port. Can anyone suggest a good material, sample code that I use and expand? Also it seems that Sun/Oracle no longer support comm. APIs Programming in windows.
Comments
This post is propeller related - but the java communication API code targets any type of serial port.
I worked at Oracle for 5 years spanning Sun acquisition on an unrelated JSR-220/317. The API is not being worked on but it definitely is functional on Win32. I use it extensively to communicate to my Parallax propeller cores.
The official Oracle Communications API 3.0 page below only mentions non-Windows operating systems - but I can assure you that Java code running any 32 bit JVM on a windows machine from XP to Windows 7 64-bit works fine.
http://www.oracle.com/technetwork/java/index-jsp-141752.html
The standard javax.comm library originally developed for linux but extended for win32 up until 2004 works fine for me. The library will not work on a 64 bit JVM but I am able to control multiple quickstart boards simultaneously from a single java process after first reloading them all using propellent in an Ant script.
Follow the steps in my blog - quoted below.
see http://javahardware.blogspot.com/2010/11/led-display-board-driven-by-javaxcomm.html
and the original posts
http://forums.parallax.com/showthread.php?119851-Writting-propeller-data-to-a-file-on-my-PC&p=879906&viewfull=1#post879906
http://forums.parallax.com/showthread.php?109333-HowTo-Single-host-computer-and-multiple-propeller-serial-comm-and-programming&p=775612&viewfull=1#post775612
http://forums.parallax.com/showthread.php?137636-Quickstart-Board-reboots-when-PC-GUI-program-starts-and-stops&p=1071154&viewfull=1#post1071154
Ant picks up extra verbosity from propellent
thank you
michael.f.obrien at eclipselink.org